EgtExecutor 2.6b2 :

- a ApproxCurve e ProjectCurveOnSurfTm aggiunto parametro dMaxSegmLen.
This commit is contained in:
Dario Sassi
2024-02-13 14:35:43 +01:00
parent d9cfc375a9
commit e06dd65888
3 changed files with 21 additions and 13 deletions
+10 -6
View File
@@ -186,7 +186,7 @@ ExeCurveMedialAxis( int nId)
//-------------------------------------------------------------------------------
bool
ExeApproxCurve( int nId, int nApprType, double dLinTol)
ExeApproxCurve( int nId, int nApprType, double dLinTol, double dMaxSegmLen)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
@@ -200,7 +200,8 @@ ExeApproxCurve( int nId, int nApprType, double dLinTol)
nApprType == APP_LEFT_LINES || nApprType == APP_LEFT_CONVEX_LINES ||
nApprType == APP_RIGHT_LINES || nApprType == APP_RIGHT_CONVEX_LINES) {
PolyLine PL ;
bOk = bOk && pCurve->ApproxWithLines( dLinTol, ANG_TOL_MAX_DEG, nApprType, PL) && pCC->FromPolyLine( PL) ;
bOk = bOk && pCurve->ApproxWithLines( dLinTol, ANG_TOL_MAX_DEG, nApprType, PL) &&
PL.AdjustForMaxSegmentLen( dMaxSegmLen) && pCC->FromPolyLine( PL) ;
// eliminazione di small Z
bOk = bOk && pCC->RemoveSmallDefects( 0.5 * dLinTol, ANG_TOL_STD_DEG) ;
}
@@ -2270,7 +2271,8 @@ ExeReorderCurvesInGroup( int nGroupId, const Point3d& ptNear, int nRefType)
//-------------------------------------------------------------------------------
static bool
MyProjectCurveOnSurfTm( int nCurveId, int nSurfTmId, const Vector3d& vtDir, int nDestGrpId, double dLinTol, int nRefType)
MyProjectCurveOnSurfTm( int nCurveId, int nSurfTmId, const Vector3d& vtDir, int nDestGrpId,
double dLinTol, double dMaxSegmLen, int nRefType)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
@@ -2301,7 +2303,7 @@ MyProjectCurveOnSurfTm( int nCurveId, int nSurfTmId, const Vector3d& vtDir, int
vtDirL.LocToLoc( frCrv, frStm) ;
// eseguo la proiezione
PNT5AXVECTOR vPt5ax ;
if ( ! ProjectCurveOnSurfTm( *CrvLoc.Get(), *pStm, vtDirL, dLinTol, vPt5ax))
if ( ! ProjectCurveOnSurfTm( *CrvLoc.Get(), *pStm, vtDirL, dLinTol, dMaxSegmLen, vPt5ax))
return false ;
// inserisco la composita nel gruppo destinazione
PtrOwner<ICurveComposite> pCompo ;
@@ -2338,9 +2340,10 @@ MyProjectCurveOnSurfTm( int nCurveId, int nSurfTmId, const Vector3d& vtDir, int
//-------------------------------------------------------------------------------
bool
ExeProjectCurveOnSurfTm( int nCurveId, int nSurfTmId, const Vector3d& vtDir, int nDestGrpId, double dLinTol, int nRefType)
ExeProjectCurveOnSurfTm( int nCurveId, int nSurfTmId, const Vector3d& vtDir, int nDestGrpId,
double dLinTol, double dMaxSegmLen, int nRefType)
{
bool bOk = MyProjectCurveOnSurfTm( nCurveId, nSurfTmId, vtDir, nDestGrpId, dLinTol, nRefType) ;
bool bOk = MyProjectCurveOnSurfTm( nCurveId, nSurfTmId, vtDir, nDestGrpId, dLinTol, dMaxSegmLen, nRefType) ;
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
@@ -2349,6 +2352,7 @@ ExeProjectCurveOnSurfTm( int nCurveId, int nSurfTmId, const Vector3d& vtDir, int
ToString( vtDir) + "}," +
ToString( nDestGrpId) + "," +
ToString( dLinTol) + "," +
ToString( dMaxSegmLen) + "," +
RefTypeToString( nRefType) + ")" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;