EgtGeomKernel :
- correzione alla ruled smooth - correzione all'offset3d.
This commit is contained in:
+6
-2
@@ -201,6 +201,7 @@ OffsetCurve3d::Make( const PNT5AXVECTOR& vPnt5Ax, double dOffDist, int nType)
|
||||
int nClosure = bClosed ? 1 : 0 ;
|
||||
bool bCheckingClosure = false ;
|
||||
bool bPlanarConcCvex = false ;
|
||||
bool bPrevTwoPointsWereConvex = false ;
|
||||
for ( int i = 1 ; i <= pCrv->GetCurveCount() + nClosure ; ++i) {
|
||||
int nCurr = i ;
|
||||
int nPrev = i - 1 ;
|
||||
@@ -224,7 +225,7 @@ OffsetCurve3d::Make( const PNT5AXVECTOR& vPnt5Ax, double dOffDist, int nType)
|
||||
// negli altri casi faccio la media
|
||||
if ( vFlag[nCurr] != OffsetCurve3d::AngType::ANG_CVEX)
|
||||
vtTang = Media( vtDirCurr, vtDirPrev) ;
|
||||
else if ( vFlag[nCurr] == OffsetCurve3d::AngType::ANG_CVEX && vFlag[nPrev] != OffsetCurve3d::AngType::ANG_CVEX)
|
||||
else if ( vFlag[nCurr] == OffsetCurve3d::AngType::ANG_CVEX && ( vFlag[nPrev] != OffsetCurve3d::AngType::ANG_CVEX || bPrevTwoPointsWereConvex))
|
||||
vtTang = vtDirPrev ;
|
||||
else
|
||||
vtTang = vtDirCurr ;
|
||||
@@ -244,7 +245,7 @@ OffsetCurve3d::Make( const PNT5AXVECTOR& vPnt5Ax, double dOffDist, int nType)
|
||||
dRadCorr = dOffDist ;
|
||||
ptP = ptP + dRadCorr * dCorrK * vtCorr ;
|
||||
// se secondo punto di angolo esterno di fianco, inserisco movimenti intermedi
|
||||
if ( vFlag[nCurr] == OffsetCurve3d::AngType::ANG_CVEX && vFlag[nPrev] == OffsetCurve3d::AngType::ANG_CVEX && bPlanarConcCvex) {
|
||||
if ( vFlag[nCurr] == OffsetCurve3d::AngType::ANG_CVEX && vFlag[nPrev] == OffsetCurve3d::AngType::ANG_CVEX && ! bPrevTwoPointsWereConvex && bPlanarConcCvex) {
|
||||
double dAlfa = acos( vtTang * vtTangPrev) ;
|
||||
double dDelta = dOffDist * tan( dAlfa / 4) ;
|
||||
Point3d ptAdd1 = ptPrev + dDelta * vtTangPrev ;
|
||||
@@ -256,7 +257,10 @@ OffsetCurve3d::Make( const PNT5AXVECTOR& vPnt5Ax, double dOffDist, int nType)
|
||||
pCL2->Set( ptAdd1, ptAdd2) ;
|
||||
vOffsetCrvs.emplace_back( pCL2, OffsetCurve3d::AngType::ANG_CVEX, -1) ;
|
||||
ptPrev = ptAdd2 ;
|
||||
bPrevTwoPointsWereConvex = true ;
|
||||
}
|
||||
else
|
||||
bPrevTwoPointsWereConvex = false ;
|
||||
Vector3d vtAng = vtDirPrev ^ vtDirCurr ;
|
||||
const double COS_ANG_MAX_PLANAR = 0.7 ;
|
||||
bPlanarConcCvex = false ;
|
||||
|
||||
+1
-1
@@ -6280,7 +6280,7 @@ ManageTwistInQuadrangulation( const ICurveComposite* pSubEdge1, const ICurveComp
|
||||
double dU0 ; pSubEdge1->GetParamAtPoint( vSyncLines.end()[-2].first, dU0, TOL) ;
|
||||
double dU1 ; pSubEdge1->GetParamAtPoint( vSyncLines.end()[-1].first, dU1, TOL) ;
|
||||
if ( dU0 > dU1 - EPS_SMALL)
|
||||
swap( vSyncLines.end()[-2], vSyncLines[-1]) ;
|
||||
swap( vSyncLines.end()[-2], vSyncLines.end()[-1]) ;
|
||||
// Verifico che le curve non si intreccino
|
||||
pSubEdge2->GetParamAtPoint( vSyncLines.end()[-2].second, dU0, TOL) ;
|
||||
pSubEdge2->GetParamAtPoint( vSyncLines.end()[-1].second, dU1, TOL) ;
|
||||
|
||||
Reference in New Issue
Block a user