EgtGeomKernel 2.2d2 :
- inCurveArc IsFlat speciale rinominata IsPlane - in tutte le Curve aggiunto parametro bUseExtrusion a IsFlat - a FromPlaneTrimmedWithBox di Polygon3d aggiunti parametri bOnEq e bOnCt - a GetSurfTriMeshPlaneInBox aggiunti parametri bOnEq e bOnCt.
This commit is contained in:
+15
-14
@@ -104,7 +104,7 @@ Polygon3d::FromPolyLine( const PolyLine& PL)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Polygon3d::FromPlaneTrimmedWithBox( const Plane3d& plPlane, const Point3d& ptMin, const Point3d& ptMax)
|
||||
Polygon3d::FromPlaneTrimmedWithBox( const Plane3d& plPlane, const Point3d& ptMin, const Point3d& ptMax, bool bOnEq, bool bOnCt)
|
||||
{
|
||||
// pulisco tutto
|
||||
Clear() ;
|
||||
@@ -127,33 +127,34 @@ Polygon3d::FromPlaneTrimmedWithBox( const Plane3d& plPlane, const Point3d& ptMin
|
||||
// lo trimmo con le facce del box
|
||||
Plane3d plFace ;
|
||||
plFace.Set( -ptMin.y, -Y_AX) ; // faccia 1 (Norm = Y-)
|
||||
Trim( plFace, true, true) ;
|
||||
Trim( plFace, true, bOnEq, bOnCt) ;
|
||||
plFace.Set( -ptMin.z, -Z_AX) ; // faccia 2 (Norm = Z-)
|
||||
Trim( plFace, true, true) ;
|
||||
Trim( plFace, true, bOnEq, bOnCt) ;
|
||||
plFace.Set( ptMax.y, Y_AX) ; // faccia 3 (Norm = Y+)
|
||||
Trim( plFace, true, true) ;
|
||||
Trim( plFace, true, bOnEq, bOnCt) ;
|
||||
plFace.Set( ptMax.z, Z_AX) ; // faccia 4 (Norm = Z+)
|
||||
Trim( plFace, true, true) ;
|
||||
Trim( plFace, true, bOnEq, bOnCt) ;
|
||||
plFace.Set( -ptMin.x, -X_AX) ; // faccia 5 (Norm = X-)
|
||||
Trim( plFace, true, true) ;
|
||||
Trim( plFace, true, bOnEq, bOnCt) ;
|
||||
plFace.Set( ptMax.x, X_AX) ; // faccia 6 (Norm = X+)
|
||||
Trim( plFace, true, true) ;
|
||||
Trim( plFace, true, bOnEq, bOnCt) ;
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Polygon3d::FromPlaneTrimmedWithBox( const Point3d& ptOn, const Vector3d& vtN, const Point3d& ptMin, const Point3d& ptMax)
|
||||
Polygon3d::FromPlaneTrimmedWithBox( const Point3d& ptOn, const Vector3d& vtN,
|
||||
const Point3d& ptMin, const Point3d& ptMax, bool bOnEq, bool bOnCt)
|
||||
{
|
||||
Plane3d plPlane ;
|
||||
plPlane.Set( ptOn, vtN) ;
|
||||
return FromPlaneTrimmedWithBox( plPlane, ptMin, ptMax) ;
|
||||
return FromPlaneTrimmedWithBox( plPlane, ptMin, ptMax, bOnEq, bOnCt) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Polygon3d::Trim( const Plane3d& plPlane, bool bInVsOut, bool bOnEq)
|
||||
Polygon3d::Trim( const Plane3d& plPlane, bool bInVsOut, bool bOnEq, bool bOnCt)
|
||||
{
|
||||
// calcolo le distanze dei punti del poligono dal piano
|
||||
int nNbrMinus = 0 ;
|
||||
@@ -176,8 +177,8 @@ Polygon3d::Trim( const Plane3d& plPlane, bool bInVsOut, bool bOnEq)
|
||||
if ( nNbrMinus == 0 && nNbrPlus == 0) {
|
||||
// determino se normali equiverse
|
||||
bool bEquivNormal = ( m_Plane.GetVersN() * plPlane.GetVersN() > 0) ;
|
||||
// se relazione tra normali opposta al desiderato, lo annullo
|
||||
if ( bOnEq != bEquivNormal)
|
||||
// se relazione tra normali opposte a entrambi i desiderati, lo annullo
|
||||
if ( ( bEquivNormal && ! bOnEq) || ( ! bEquivNormal && ! bOnCt))
|
||||
m_vVert.clear() ;
|
||||
return true ;
|
||||
}
|
||||
@@ -235,11 +236,11 @@ Polygon3d::Trim( const Plane3d& plPlane, bool bInVsOut, bool bOnEq)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Polygon3d::Trim( const Polygon3d& plyOther, bool bInVsOut, bool bOnEq)
|
||||
Polygon3d::Trim( const Polygon3d& plyOther, bool bInVsOut, bool bOnEq, bool bOnCt)
|
||||
{
|
||||
if ( GetSideCount() == 0 || ! plyOther.IsValid())
|
||||
return true ;
|
||||
return Trim( plyOther.m_Plane, bInVsOut, bOnEq) ;
|
||||
return Trim( plyOther.m_Plane, bInVsOut, bOnEq, bOnCt) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user