EgtGeomKernel :

- migliorie e correzioni a SurfExtend e Offset3d.
This commit is contained in:
Daniele Bariletti
2026-07-07 16:13:17 +02:00
parent dc46c92c95
commit f0137d26f4
2 changed files with 8 additions and 7 deletions
+2 -2
View File
@@ -269,7 +269,7 @@ OffsetCurve3d::Make( const PNT5AXVECTOR& vPnt5Ax, double dOffDist, int nType)
if ( vtDirPrevOff.IsValid())
dProj = vtDirCurrOff * vtDirPrevOff ;
// prima di inserirlo controllo che il tratto non torni indietro
if ( vFlag[nCurr] != ANG_STR || dProj > - 0.966) {
if ( ( vFlag[nCurr] != ANG_STR || dProj > - 0.966) && Dist( ptPrev, ptP) > 2 * EPS_SMALL) {
// aggiungo tratto
ICurveLine* pCL = CreateBasicCurveLine() ;
pCL->Set( ptPrev, ptP) ;
@@ -446,7 +446,7 @@ IsPointInsideCylinder( const Point3d& ptTest, const Cyl& offCyl, double dLinTol)
bool
CalcAdjustConcavePartsInPath( const ICurveComposite* pCrv, const OFFSETSEGVEC& vOffsetCrvs, double dRad, EDITCRVINFOVEC& vEditInfo)
{
const double dLinTol = 10 * EPS_SMALL ;
const double dLinTol = 0 * EPS_SMALL ;
for ( int i = 0 ; i < ssize( vOffsetCrvs) ; ++i) {
int nFlag = vOffsetCrvs[i].nFlag ;
// considero tutt le zone concave
+6 -5
View File
@@ -1295,8 +1295,7 @@ GetCurveOnSurfInfo( const ICurve& crCrv, const ISurfTriMesh& pSurf,
// approssimo la curva con una polilinea entro la tolleranza
PolyLine PL ;
if ( ! crCrv.ApproxWithLines( 10 * EPS_SMALL, ANG_TOL_STD_DEG, ICurve::APL_SPECIAL, PL) ||
! PL.RemoveAlignedPoints( dLinTol, false) )
if ( ! crCrv.ApproxWithLines( 10 * EPS_SMALL, ANG_TOL_STD_DEG, ICurve::APL_SPECIAL, PL))
return false ;
const double MAX_SEG_LEN = min( dMaxSegmLen, 0.977) ;
if ( ! PL.AdjustForMaxSegmentLen( MAX_SEG_LEN))
@@ -1345,7 +1344,7 @@ GetCurveOnSurfInfo( const ICurve& crCrv, const ISurfTriMesh& pSurf,
nTria = nTriaCurr ;
if ( bJoint) {
int nTria2 ; pCC->GetCurveTempProp( int( dPar), nTria2, 0) ;
Triangle3d trTria2 ; pSurf.GetTriangle( nTria2, trTria2) ;
Triangle3dEx trTria2 ; pSurf.GetTriangle( nTria2, trTria2) ;
if ( ! CalcNormal( ptP, trTria2, Pt5ax.vtDir2))
Pt5ax.vtDir2 = trTria2.GetN() ;
nTria = nTria2 ;
@@ -1368,13 +1367,15 @@ GetCurveOnSurfInfo( const ICurve& crCrv, const ISurfTriMesh& pSurf,
else
vtDir = vtDirPrev ;
// in caso sia stato superato l'angolo limite dò priorità alla direzione precedente
bool bEdge = false ;
if ( vtDirPrev.IsValid() && (! bFirst || ( bFirst && bClosed))) {
double dProj = vtDirNext * vtDirPrev ;
if ( dProj > COS_ANG_MAX_CORNER)
bEdge = dProj < COS_ANG_MAX_CORNER ;
if ( ! bEdge)
vtDir = Media( vtDirNext, vtDirPrev) ;
}
vtDirPrev = vtDirNext ;
bool bEdge = ! AreSameVectorExact( vPt5ax.back().vtDir1, vPt5ax.back().vtDir2) ;
bEdge = bEdge || ! AreSameVectorExact( vPt5ax.back().vtDir1, vPt5ax.back().vtDir2) ;
Vector3d vtTang = vtDir ^ vtNorm ; vtTang.Normalize() ;
vPt5ax.back().vtDir1 = vtTang ;
if ( bEdge) {