From 94900fcea43bfa363c6dbc906c848ecb456bebb7 Mon Sep 17 00:00:00 2001 From: DarioS Date: Mon, 5 Jul 2021 08:35:54 +0200 Subject: [PATCH 1/3] EgtGeomKernel 2.3f1 : - ricompilazione per cambio versione. --- EgtGeomKernel.rc | Bin 11710 -> 11710 bytes EgtGeomKernel.vcxproj | 2 ++ 2 files changed, 2 insertions(+) diff --git a/EgtGeomKernel.rc b/EgtGeomKernel.rc index 0aefca9eec3e279ab1c8aa2f0f8920b72665368e..5bc520ebbd5bd3187ae8ff501cf9ab2ef7861baf 100644 GIT binary patch delta 118 zcmdlNy)SyhH#Syt1|0^&&A-{?nVHiW3@0mc>u&bq>S2M3-{!MM7I$OZ+#~G9j8n2h Q8ZL=uq6g#VEaea`09-;I8UO$Q delta 118 zcmdlNy)SyhH#Sx?1|0_D&A-{?nVHiVj3+B{>u&bq>S2M3-{!MM7I$OZ+#~G9j8n2h Q8ZL=uq6g#VEaea`0A3g#A^-pY diff --git a/EgtGeomKernel.vcxproj b/EgtGeomKernel.vcxproj index 33cc8ca..02ef8b0 100644 --- a/EgtGeomKernel.vcxproj +++ b/EgtGeomKernel.vcxproj @@ -148,6 +148,7 @@ copy $(TargetPath) \EgtProg\DllD32 false true ProgramDatabase + stdcpp17 Windows @@ -239,6 +240,7 @@ copy $(TargetPath) \EgtProg\Dll32 true false None + stdcpp17 Windows From 60ea6cd54ce77397e3e8c0ca7bd3977c1055ae39 Mon Sep 17 00:00:00 2001 From: Emmanuele Sassi Date: Mon, 5 Jul 2021 08:43:25 +0200 Subject: [PATCH 2/3] Revert "EgtGeomKernel 2.3f3 :" This reverts commit 4b1bf75911b2db8711fbd7ac75b88ab77eeb8f28. --- EgtGeomKernel.rc | Bin 11710 -> 11710 bytes OffsetCurve.cpp | 20 ++++++-------------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/EgtGeomKernel.rc b/EgtGeomKernel.rc index 0aefca9eec3e279ab1c8aa2f0f8920b72665368e..fe56437e6e404fc3802b2dbf8f76b1f885d19728 100644 GIT binary patch delta 94 zcmdlNy)SyhFE&P_&A-_cnHh~HD{|{@_Trkr0u;H;XNwSVW8B;$>;>dw2zN+>g;Df- LFmBFL4&ed-Vf-5U delta 94 zcmdlNy)SyhFE&Qw&A-_cnHh~ID{|{@_Trkr0u;H;XNwSVW8B;$>;>dw2zN+>g;Df- LFmBFL4&ed-W11TR diff --git a/OffsetCurve.cpp b/OffsetCurve.cpp index e67f5ac..69ed9e1 100644 --- a/OffsetCurve.cpp +++ b/OffsetCurve.cpp @@ -178,25 +178,17 @@ OffsetCurve::Make( const ICurve* pCrv, double dDist, int nType) if ( IsNull( pCrv1)) return false ; pCrv1->SetTempProp( nInd1) ; - if ( ! pCrv1->SimpleOffset( dDist, ICurve::OFF_FILLET)) { - CurveArc* pArc = GetBasicCurveArc( pCrv1) ; - if ( pArc == nullptr) - return false ; - if ( pArc->MyExtendedOffset( dDist, true, ICurve::OFF_FILLET)) - pCrv1->SetTempProp( - nInd1) ; - } + if ( ! pCrv1->SimpleOffset( dDist, ICurve::OFF_FILLET) && + GetBasicCurveArc( pCrv1)->MyExtendedOffset( dDist, true, ICurve::OFF_FILLET)) + pCrv1->SetTempProp( - nInd1) ; // curve successive PtrOwner pCrv2( ccCopy2.RemoveFirstOrLastCurve( false)) ; while ( ! IsNull( pCrv2)) { // eseguo semplice offset pCrv2->SetTempProp( nInd1 + 1) ; - if ( ! pCrv2->SimpleOffset( dDist, ICurve::OFF_FILLET)) { - CurveArc* pArc = GetBasicCurveArc( pCrv2) ; - if ( pArc == nullptr) - return false ; - if ( pArc->MyExtendedOffset( dDist, true, ICurve::OFF_FILLET)) - pCrv2->SetTempProp( - ( nInd1 + 1)) ; - } + if ( ! pCrv2->SimpleOffset( dDist, ICurve::OFF_FILLET) && + GetBasicCurveArc( pCrv2)->MyExtendedOffset( dDist, true, ICurve::OFF_FILLET)) + pCrv2->SetTempProp( - (nInd1 + 1)) ; // verifico relazione con la curva precedente e aggiungo eventuali curve intermedie CurveComposite ccTemp ; bool bOk = VerifyAndAdjustExternalAngle( pCrv1, pCrv2, vAngs[nInd1], dDist, ICurve::OFF_FILLET, ccTemp) ; From 73f5b382c951101da31ff439de94fbb3ceb7792e Mon Sep 17 00:00:00 2001 From: DarioS Date: Tue, 20 Jul 2021 12:53:04 +0200 Subject: [PATCH 3/3] =?UTF-8?q?EgtGeomKernel=202.3g1=20:=20-=20versione=20?= =?UTF-8?q?x64=20compilata=20con=20Clang-cl/LLVM=20-=20modifiche=20varie?= =?UTF-8?q?=20per=20eliminare=20warning=20pi=C3=B9=20gravi=20di=20questo?= =?UTF-8?q?=20compilatore.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CAvToolTriangle.cpp | 2 +- CDeBoxClosedSurfTm.cpp | 4 ++-- CDeConeFrustumTria.cpp | 9 ++++++--- CDeConeTria.cpp | 6 ++++-- CDeRectPrismoidTria.cpp | 26 ++++++++++++++------------ CDeUtility.cpp | 4 ++-- CurveArc.h | 2 +- CurveAux.cpp | 2 +- CurveByApprox.cpp | 2 +- CurveByInterp.cpp | 4 ++-- CurveLine.h | 2 +- EgtGeomKernel.rc | Bin 11710 -> 11710 bytes EgtGeomKernel.vcxproj | 4 ++-- FontNfe.cpp | 1 - FontOs.cpp | 1 - GdbExecutor.cpp | 1 - GdbIterator.cpp | 6 +++--- GdbIterator.h | 4 ++-- GeoFrame3d.h | 2 +- IntersLineSurfStd.cpp | 18 +++++------------- NgeReader.cpp | 6 +++--- OffsetCurve.cpp | 6 +++--- StmFromCurves.cpp | 6 +++--- SurfBezier.cpp | 6 +++--- SurfTriMesh.h | 8 -------- SurfTriMeshBooleans.cpp | 22 +++++----------------- Tool.cpp | 6 +++--- Triangulate.cpp | 1 - VolZmap.cpp | 2 +- VolZmapCalculus.cpp | 33 +++++++++++++++++---------------- VolZmapGraphics.cpp | 14 -------------- VolZmapVolume.cpp | 20 ++------------------ 32 files changed, 88 insertions(+), 142 deletions(-) diff --git a/CAvToolTriangle.cpp b/CAvToolTriangle.cpp index 7bb6afb..c669426 100644 --- a/CAvToolTriangle.cpp +++ b/CAvToolTriangle.cpp @@ -762,7 +762,7 @@ CylTriaInteriorEscapeDistOrtMotion( const Point3d& ptCylOrig, const Vector3d& vt double dU = ( ( trTria.GetP( 0) - ptTouch0) * trTria.GetN()) / ( vtMove * trTria.GetN()) ; // Se avvicinamento, distanza nulla if ( dU < dDist) - dDist ; + dDist = 0. ; ptTouch0 += ( dU * vtMove) ; Point3d ptTouch1 = ptTouch0 - dCylHei * vtCylAx ; Point3d ptInt0, ptInt1 ; diff --git a/CDeBoxClosedSurfTm.cpp b/CDeBoxClosedSurfTm.cpp index a562058..e851ea6 100644 --- a/CDeBoxClosedSurfTm.cpp +++ b/CDeBoxClosedSurfTm.cpp @@ -46,8 +46,8 @@ CDeBoxClosedSurfTm( const Frame3d& frBox, const Vector3d& vtDiag, double dSafeDi if ( ! Stm.IsClosed()) return false ; // Verifico se il box è dentro la superficie tramite calcolo distanza minima. - Point3d ptBoxOrig ; - b3Box.GetMinMax( ptBoxOrig, Point3d()) ; + Point3d ptBoxOrig, ptBoxMax ; + b3Box.GetMinMax( ptBoxOrig, ptBoxMax) ; DistPointSurfTm DistBoxOrigSurfCalc( ptBoxOrig, Stm) ; // Se il box è interno c'è collisione return DistBoxOrigSurfCalc.IsPointInside() ; diff --git a/CDeConeFrustumTria.cpp b/CDeConeFrustumTria.cpp index 25fabb8..7576b0b 100644 --- a/CDeConeFrustumTria.cpp +++ b/CDeConeFrustumTria.cpp @@ -94,7 +94,8 @@ CDeSimpleConeFrustumTria( const Frame3d& frCone, double dMinRad, double dMaxRad, else if ( nMinBaseTriaIndex == IPPT_YES) { double dU1, dU2 ; if ( LineDisc( ptLine, vtLine, ORIG, -Z_AX, dMinRad, dU1, dU2) == D_INFINITE_INT_LINE_ON_PLANE) { - int nLineTriaIndex = IntersLineTria( ptLine + dU1 * vtLine, ptLine + dU2 * vtLine, trMyTria, Point3d(), Point3d()) ; + Point3d ptInt, ptInt2 ; + int nLineTriaIndex = IntersLineTria( ptLine + dU1 * vtLine, ptLine + dU2 * vtLine, trMyTria, ptInt, ptInt2) ; if ( nLineTriaIndex != ILTT_NO && nLineTriaIndex != ILTT_IN) return true ; } @@ -111,7 +112,8 @@ CDeSimpleConeFrustumTria( const Frame3d& frCone, double dMinRad, double dMaxRad, else if ( nMaxBaseTriaIndex == IPPT_YES) { double dU1, dU2 ; if ( LineDisc( ptLine, vtLine, Point3d( 0., 0., dHeight), Z_AX, dMaxRad, dU1, dU2) == D_INFINITE_INT_LINE_ON_PLANE) { - int nLineTriaIndex = IntersLineTria( ptLine + dU1 * vtLine, ptLine + dU2 * vtLine, trMyTria, Point3d(), Point3d()) ; + Point3d ptInt, ptInt2 ; + int nLineTriaIndex = IntersLineTria( ptLine + dU1 * vtLine, ptLine + dU2 * vtLine, trMyTria, ptInt, ptInt2) ; if ( nLineTriaIndex != ILTT_NO && nLineTriaIndex != ILTT_IN) return true ; } @@ -122,7 +124,8 @@ CDeSimpleConeFrustumTria( const Frame3d& frCone, double dMinRad, double dMaxRad, return false ; Point3d ptContactSt( dMinRad * vtTriaNormXY.x, dMinRad * vtTriaNormXY.y, 0.) ; Point3d ptContactEn( dMaxRad * vtTriaNormXY.x, dMaxRad * vtTriaNormXY.y, dHeight) ; - int nContactIndex = IntersLineTria( ptContactSt, ptContactEn, trMyTria, Point3d(), Point3d()) ; + Point3d ptInt, ptInt2 ; + int nContactIndex = IntersLineTria( ptContactSt, ptContactEn, trMyTria, ptInt, ptInt2) ; return ! ( nContactIndex == ILTT_NO || nContactIndex == ILTT_IN) ; } diff --git a/CDeConeTria.cpp b/CDeConeTria.cpp index a7812c9..d4fa5be 100644 --- a/CDeConeTria.cpp +++ b/CDeConeTria.cpp @@ -92,7 +92,8 @@ CDeSimpleConeTria( const Frame3d& frCone, double dRad, double dHeight, const Tri else if ( nBaseTriaIndex == IPPT_YES) { double dU1, dU2; if ( LineDisc( ptLine, vtLine, Point3d( 0., 0., dHeight), Z_AX, dRad, dU1, dU2) == D_INFINITE_INT_LINE_ON_PLANE) { - int nLineTriaIndex = IntersLineTria( ptLine + dU1 * vtLine, ptLine + dU2 * vtLine, trMyTria, Point3d(), Point3d()) ; + Point3d ptInt, ptInt2 ; + int nLineTriaIndex = IntersLineTria( ptLine + dU1 * vtLine, ptLine + dU2 * vtLine, trMyTria, ptInt, ptInt2) ; if ( nLineTriaIndex != ILTT_NO && nLineTriaIndex != ILTT_IN) return true ; } @@ -103,7 +104,8 @@ CDeSimpleConeTria( const Frame3d& frCone, double dRad, double dHeight, const Tri return false ; Point3d ptContactSt( 0., 0., 0.) ; Point3d ptContactEn( dRad * vtTriaNormXY.x, dRad * vtTriaNormXY.y, dHeight) ; - int nContactIndex = IntersLineTria( ptContactSt, ptContactEn, trMyTria, Point3d(), Point3d()) ; + Point3d ptInt, ptInt2 ; + int nContactIndex = IntersLineTria( ptContactSt, ptContactEn, trMyTria, ptInt, ptInt2) ; return ! ( nContactIndex == ILTT_NO || nContactIndex == ILTT_IN) ; } diff --git a/CDeRectPrismoidTria.cpp b/CDeRectPrismoidTria.cpp index 9dff093..9eefc88 100644 --- a/CDeRectPrismoidTria.cpp +++ b/CDeRectPrismoidTria.cpp @@ -50,6 +50,8 @@ CDeSimpleRectPrismoidTria( const Frame3d& frPrismoid, double dLenghtBaseX, doubl // Se c'è collisione con almeno un triangolo delle facce ho finito Triangle3d trFaceTria1, trFaceTria2 ; + Point3d ptInt, ptIn2 ; + TRIA3DVECTOR vTria ; // Faccia base trFaceTria1.Set( Point3d( - dHalfBaseX, - dHalfBaseY, 0.), Point3d( - dHalfBaseX, dHalfBaseY, 0.), @@ -59,8 +61,8 @@ CDeSimpleRectPrismoidTria( const Frame3d& frPrismoid, double dLenghtBaseX, doubl Point3d( dHalfBaseX, dHalfBaseY, 0.), Point3d( dHalfBaseX, - dHalfBaseY, 0.)) ; trFaceTria2.Validate() ; - if ( IntersTriaTria( trMyTria, trFaceTria1, Point3d(), Point3d(), TRIA3DVECTOR()) != ITTT_NO || - IntersTriaTria( trMyTria, trFaceTria2, Point3d(), Point3d(), TRIA3DVECTOR()) != ITTT_NO) + if ( IntersTriaTria( trMyTria, trFaceTria1, ptInt, ptIn2, vTria) != ITTT_NO || + IntersTriaTria( trMyTria, trFaceTria2, ptInt, ptIn2, vTria) != ITTT_NO) return true ; // Faccia top trFaceTria1.Set( Point3d( - dHalfTopX, - dHalfTopY, dHeight), @@ -71,8 +73,8 @@ CDeSimpleRectPrismoidTria( const Frame3d& frPrismoid, double dLenghtBaseX, doubl Point3d( dHalfTopX, - dHalfTopY, dHeight), Point3d( dHalfTopX, dHalfTopY, dHeight)) ; trFaceTria2.Validate() ; - if ( IntersTriaTria( trMyTria, trFaceTria1, Point3d(), Point3d(), TRIA3DVECTOR()) != ITTT_NO || - IntersTriaTria( trMyTria, trFaceTria2, Point3d(), Point3d(), TRIA3DVECTOR()) != ITTT_NO) + if ( IntersTriaTria( trMyTria, trFaceTria1, ptInt, ptIn2, vTria) != ITTT_NO || + IntersTriaTria( trMyTria, trFaceTria2, ptInt, ptIn2, vTria) != ITTT_NO) return true ; // Faccia laterale 1 trFaceTria1.Set( Point3d( - dHalfBaseX, - dHalfBaseY, 0.), @@ -83,8 +85,8 @@ CDeSimpleRectPrismoidTria( const Frame3d& frPrismoid, double dLenghtBaseX, doubl Point3d( dHalfBaseX, - dHalfBaseY, 0.), Point3d( dHalfTopX, - dHalfTopY , dHeight)) ; trFaceTria2.Validate() ; - if ( IntersTriaTria( trMyTria, trFaceTria1, Point3d(), Point3d(), TRIA3DVECTOR()) != ITTT_NO || - IntersTriaTria( trMyTria, trFaceTria2, Point3d(), Point3d(), TRIA3DVECTOR()) != ITTT_NO) + if ( IntersTriaTria( trMyTria, trFaceTria1, ptInt, ptIn2, vTria) != ITTT_NO || + IntersTriaTria( trMyTria, trFaceTria2, ptInt, ptIn2, vTria) != ITTT_NO) return true ; // Faccia laterale 2 trFaceTria1.Set( Point3d( dHalfBaseX, - dHalfBaseY, 0.), @@ -95,8 +97,8 @@ CDeSimpleRectPrismoidTria( const Frame3d& frPrismoid, double dLenghtBaseX, doubl Point3d( dHalfBaseX, dHalfBaseY, 0.), Point3d( dHalfTopX , dHalfTopY , dHeight)) ; trFaceTria2.Validate() ; - if ( IntersTriaTria(trMyTria, trFaceTria1, Point3d(), Point3d(), TRIA3DVECTOR()) != ITTT_NO || - IntersTriaTria(trMyTria, trFaceTria2, Point3d(), Point3d(), TRIA3DVECTOR()) != ITTT_NO) + if ( IntersTriaTria(trMyTria, trFaceTria1, ptInt, ptIn2, vTria) != ITTT_NO || + IntersTriaTria(trMyTria, trFaceTria2, ptInt, ptIn2, vTria) != ITTT_NO) return true ; // Faccia laterale 3 trFaceTria1.Set( Point3d( dHalfBaseX, dHalfBaseY, 0.), @@ -107,8 +109,8 @@ CDeSimpleRectPrismoidTria( const Frame3d& frPrismoid, double dLenghtBaseX, doubl Point3d( - dHalfBaseX, dHalfBaseY, 0.), Point3d( - dHalfTopX , dHalfTopY , dHeight)) ; trFaceTria2.Validate() ; - if ( IntersTriaTria( trMyTria, trFaceTria1, Point3d(), Point3d(), TRIA3DVECTOR()) != ITTT_NO || - IntersTriaTria( trMyTria, trFaceTria2, Point3d(), Point3d(), TRIA3DVECTOR()) != ITTT_NO) + if ( IntersTriaTria( trMyTria, trFaceTria1, ptInt, ptIn2, vTria) != ITTT_NO || + IntersTriaTria( trMyTria, trFaceTria2, ptInt, ptIn2, vTria) != ITTT_NO) return true ; // Faccia laterale 4 trFaceTria1.Set( Point3d( - dHalfBaseX, dHalfBaseY, 0.), @@ -119,8 +121,8 @@ CDeSimpleRectPrismoidTria( const Frame3d& frPrismoid, double dLenghtBaseX, doubl Point3d( - dHalfBaseX, - dHalfBaseY, 0.), Point3d( - dHalfTopX , - dHalfTopY , dHeight)) ; trFaceTria2.Validate() ; - if ( IntersTriaTria( trMyTria, trFaceTria1, Point3d(), Point3d(), TRIA3DVECTOR()) != ITTT_NO || - IntersTriaTria( trMyTria, trFaceTria2, Point3d(), Point3d(), TRIA3DVECTOR()) != ITTT_NO) + if ( IntersTriaTria( trMyTria, trFaceTria1, ptInt, ptIn2, vTria) != ITTT_NO || + IntersTriaTria( trMyTria, trFaceTria2, ptInt, ptIn2, vTria) != ITTT_NO) return true ; return false ; } diff --git a/CDeUtility.cpp b/CDeUtility.cpp index 6aed35d..13b44e4 100644 --- a/CDeUtility.cpp +++ b/CDeUtility.cpp @@ -141,8 +141,8 @@ CoplanarCircleTriangleInterference( const Point3d& ptCen, double dRad, const Tri return false ; // Classifico i vertici del triangolo in base alla loro posizione rispetto alla circonferenza. double dSqRad = dRad * dRad ; - double dSqRadInf = dRad * dRad - 2 * dRad * EPS_SMALL ; - double dSqRadSup = dRad * dRad + 2 * dRad * EPS_SMALL ; + double dSqRadInf = dSqRad - 2 * dRad * EPS_SMALL ; + double dSqRadSup = dSqRad + 2 * dRad * EPS_SMALL ; int nInOutVec[3] ; for ( int n = 0 ; n < 3 ; ++ n) { Point3d ptTriaVert = trTria.GetP( n) ; diff --git a/CurveArc.h b/CurveArc.h index 46d0858..768f5c9 100644 --- a/CurveArc.h +++ b/CurveArc.h @@ -153,7 +153,7 @@ class CurveArc : public ICurveArc, public IGeoObjRW { return m_PtCen ; } const Vector3d& GetNormVersor( void) const override { return m_VtN ; } - const Vector3d& GetStartVersor( void) const + const Vector3d& GetStartVersor( void) const override { return m_VtS ; } double GetRadius( void) const override { return m_dRad ; } diff --git a/CurveAux.cpp b/CurveAux.cpp index 88edcc9..57d456c 100644 --- a/CurveAux.cpp +++ b/CurveAux.cpp @@ -439,7 +439,7 @@ ArcToBezierCurve( const ICurve* pCrv) return nullptr ; // aggiungo la curva di Bezier a quella composita if ( ! pCrvCompo->AddCurve( Release( pCrvBez))) - return false ; + return nullptr ; } // copio estrusione e spessore CopyExtrusion( pArc, pCrvCompo) ; diff --git a/CurveByApprox.cpp b/CurveByApprox.cpp index 3b595a6..afb1d2e 100644 --- a/CurveByApprox.cpp +++ b/CurveByApprox.cpp @@ -60,7 +60,7 @@ CurveByApprox::GetCurve( int nType, double dLinTol, double dAngTolDeg, double dL // calcolo approssimazione PolyArc PA ; if ( ! GetArcs( dLinTol, dAngTolDeg, dLinFea, PA)) - return false ; + return nullptr ; // creo la composita formata da questa approssimazione PtrOwner pCC( CreateBasicCurveComposite()) ; if ( ! pCC->FromPolyArc( PA)) diff --git a/CurveByInterp.cpp b/CurveByInterp.cpp index f6b0acf..f3e9c05 100644 --- a/CurveByInterp.cpp +++ b/CurveByInterp.cpp @@ -91,7 +91,7 @@ CurveByInterp::GetCurve( int nMethod, int nType) // creo una curva di Bezier cubica per ogni intervallo PtrOwner pCBez( CreateCurveBezier()) ; if ( IsNull( pCBez)) - return false ; + return nullptr ; pCBez->Init( 3, false) ; pCBez->SetControlPoint( 0, m_vPnt[i-1]) ; pCBez->SetControlPoint( 1, m_vPnt[i-1] + ( m_vPar[i] - m_vPar[i-1]) / 3 * m_vNextDer[i-1]) ; @@ -103,7 +103,7 @@ CurveByInterp::GetCurve( int nMethod, int nType) return ::Release( pCrvCompo) ; } - return false ; + return nullptr ; } //---------------------------------------------------------------------------- diff --git a/CurveLine.h b/CurveLine.h index 6f5431c..dfb395c 100644 --- a/CurveLine.h +++ b/CurveLine.h @@ -112,7 +112,7 @@ class CurveLine : public ICurveLine, public IGeoObjRW bool SimpleOffset( double dDist, int nType = OFF_FILLET) override ; bool ModifyStart( const Point3d& ptNewStart) override ; bool ModifyEnd( const Point3d& ptNewEnd) override ; - bool SetExtrusion( const Vector3d& vtExtr) + bool SetExtrusion( const Vector3d& vtExtr) override { m_VtExtr = vtExtr ; m_VtExtr.Normalize() ; m_OGrMgr.Reset() ; return true ; } bool SetThickness( double dThick) override { m_dThick = dThick ; m_OGrMgr.Reset() ; return true ; } diff --git a/EgtGeomKernel.rc b/EgtGeomKernel.rc index 5bc520ebbd5bd3187ae8ff501cf9ab2ef7861baf..6c3373475938df8e28ee6dae041b543302850f8a 100644 GIT binary patch delta 94 zcmdlNy)SyhFE&P_&A-_cnHh~HD{|{@_Trkr0u;H;XNwSVW8B;$>;>dw2zN+>g;Df- LFmBFL4&ed-Vf-5U delta 94 zcmdlNy)SyhFE&QQ&A-_cnHdcyD{|{@_Trkr0u;H;XNwSVW8B;$>;>dw2zN+>g;Df- LFmBFL4&ed-U|t&X diff --git a/EgtGeomKernel.vcxproj b/EgtGeomKernel.vcxproj index 02ef8b0..d8284cb 100644 --- a/EgtGeomKernel.vcxproj +++ b/EgtGeomKernel.vcxproj @@ -37,7 +37,7 @@ true Unicode false - v142 + ClangCL false @@ -54,7 +54,7 @@ true Unicode false - v142 + ClangCL diff --git a/FontNfe.cpp b/FontNfe.cpp index 3ef55f5..a230b43 100644 --- a/FontNfe.cpp +++ b/FontNfe.cpp @@ -492,7 +492,6 @@ NfeFont::GetTextLines( const string& sText, int nInsPos, PNTVECTOR& vPt, STRVECT // calcolo i fattori di scala double dScaY = m_dHeight / m_dHCap ; double dScaX = dScaY * m_dRatio ; - double dScaZ = 1 ; // recupero altezza maiuscole e interlinea double dHCap = m_dHeight ; diff --git a/FontOs.cpp b/FontOs.cpp index 880cb8a..56cf0d5 100644 --- a/FontOs.cpp +++ b/FontOs.cpp @@ -604,7 +604,6 @@ OsFont::GetTextLines( const string& sText, int nInsPos, PNTVECTOR& vPt, STRVECTO // calcolo i fattori di scala double dScaY = m_dHeight / m_dHCap ; double dScaX = dScaY * m_dRatio ; - double dScaZ = 1 ; // recupero altezza maiuscole e interlinea double dHCap = m_dHeight ; diff --git a/GdbExecutor.cpp b/GdbExecutor.cpp index 370b888..0222750 100644 --- a/GdbExecutor.cpp +++ b/GdbExecutor.cpp @@ -5088,7 +5088,6 @@ GdbExecutor::ExecuteToolAvoidTriangle( const std::string& sCmd2, const STRVECTOR int nToolType = GetIdParam( vsParams[5], false) ; // Vettore di fuga IGeoVector3d * pGLeakV = GetGeoVector3d( m_pGDB->GetGeoObj( nIdLeakV)) ; - Point3d ptLeakBase = pGLeakV->GetBase() ; Vector3d vtLeakDir = pGLeakV->GetVector() ; // Vettore utensile IGeoVector3d * pGToolV = GetGeoVector3d( m_pGDB->GetGeoObj( nIdToolV)) ; diff --git a/GdbIterator.cpp b/GdbIterator.cpp index 07b7e9d..d35ad15 100644 --- a/GdbIterator.cpp +++ b/GdbIterator.cpp @@ -668,7 +668,7 @@ IGeoObj* GdbIterator::GetGeoObj( void) { if ( m_pGDB == nullptr || m_pCurrObj == nullptr) - return false ; + return nullptr ; // recupero l'oggetto Gdb GdbGeo* pGdbGeo = GetGdbGeo( m_pCurrObj) ; @@ -684,7 +684,7 @@ const IGeoObj* GdbIterator::GetGeoObj( void) const { if ( m_pGDB == nullptr || m_pCurrObj == nullptr) - return false ; + return nullptr ; // recupero l'oggetto Gdb const GdbGeo* pGdbGeo = GetGdbGeo( m_pCurrObj) ; @@ -1715,7 +1715,7 @@ bool GdbIterator::RemoveUserObj( void) { if ( m_pGDB == nullptr || m_pCurrObj == nullptr) - return nullptr ; + return false ; // cancello eventuale precedente UserObj if ( m_pCurrObj->m_pUserObj != nullptr) diff --git a/GdbIterator.h b/GdbIterator.h index c537b8b..d2e6efe 100644 --- a/GdbIterator.h +++ b/GdbIterator.h @@ -140,8 +140,8 @@ class GdbIterator : public IGdbIterator bool GetInfo( const std::string& sKey, INTVECTOR& vnInfo) const override ; bool GetInfo( const std::string& sKey, DBLVECTOR& vdInfo) const override ; bool GetInfo( const std::string& sKey, STRVECTOR& vsInfo) const override ; - bool ExistsInfo( const std::string& sKey) const ; - bool RemoveInfo( const std::string& sKey) ; + bool ExistsInfo( const std::string& sKey) const override ; + bool RemoveInfo( const std::string& sKey) override ; // TextureData bool SetTextureName( const std::string& sTxrName) override ; bool SetTextureFrame( const Frame3d& frTxrRef) override ; diff --git a/GeoFrame3d.h b/GeoFrame3d.h index 10eb25c..575e53a 100644 --- a/GeoFrame3d.h +++ b/GeoFrame3d.h @@ -69,7 +69,7 @@ class GeoFrame3d : public IGeoFrame3d, public IGeoObjRW bool Set( const Point3d& ptOrig, const Point3d& ptOnX, const Point3d& ptNearY) override ; bool Set( const Point3d& ptOrig, const Vector3d& vtDirZ) override ; bool Set( const Frame3d& frF) override ; - const Frame3d& GetFrame( void) const + const Frame3d& GetFrame( void) const override { return m_frF ; } bool GetDrawWithArrowHeads( double dLenA, double dFrazLenAH, PolyLine& plX, PolyLine& plY, PolyLine& plZ) const override ; diff --git a/IntersLineSurfStd.cpp b/IntersLineSurfStd.cpp index 3cfb691..24c8d16 100644 --- a/IntersLineSurfStd.cpp +++ b/IntersLineSurfStd.cpp @@ -299,7 +299,7 @@ SegmentSphere( const Point3d& ptPLine, const Vector3d& vtVLine, double dLen, nIntType = S_NO_INTERS ; } // La retta associata al segmento è secante - else if ( nIntType = S_TWO_INT) { + else if ( nIntType == S_TWO_INT) { // Segmento esterno if ( dU1 > dLen + EPS_SMALL) nIntType = S_NO_INTERS ; @@ -558,12 +558,9 @@ IntersLineInfiniteCylinder( const Point3d& ptPLine, const Vector3d& vtVLine, DBLVECTOR vdRoots ; int nRoot = PolynomialRoots( 2, vdCoef, vdRoots) ; // Studio delle soluzioni - int nIntType ; - // Non ci sono intersezioni - if ( nRoot == 0) - nIntType = CC_NO_INTERS ; + int nIntType = CC_NO_INTERS ; // C'è un punto di tangenza - else if ( nRoot == 1) { + if ( nRoot == 1) { dU1 = vdRoots[0] ; nIntType = CC_ONE_INT_TAN ; } @@ -1085,10 +1082,8 @@ LineInfiniteCone( const Point3d& ptPLine, const Vector3d& vtDLine, int nRoot = PolynomialRoots( 2, vdCoef, vdRoots) ; // Studio le soluzioni - int nIntType ; - if ( nRoot == 0) - nIntType = CC_NO_INTERS ; - else if ( nRoot == 1) { + int nIntType = CC_NO_INTERS ; + if ( nRoot == 1) { dU1 = vdRoots[0] ; Point3d ptInt = ptPLine + dU1 * vtDLine ; // Soluzione sul cono negativo @@ -1748,9 +1743,6 @@ LineTorus( const Point3d& ptLine, const Vector3d& vtLine, } else if ( vdPar.size() == 3) { nIntType = T_THREE_ONE_TAN_TWO_SEC ; - Point3d ptInt1 = ptLn + vdPar[0] * vtLn ; - Point3d ptInt2 = ptLn + vdPar[1] * vtLn ; - Point3d ptInt3 = ptLn + vdPar[2] * vtLn ; } else if ( vdPar.size() == 4) { // Prime due soluzioni distinte diff --git a/NgeReader.cpp b/NgeReader.cpp index 365eeda..b76c4d3 100644 --- a/NgeReader.cpp +++ b/NgeReader.cpp @@ -194,7 +194,7 @@ NgeReader::ReadInt( unsigned int& nVal, const char* szSep, bool bEndL) int nTemp ; if ( ! ReadInt( nTemp, szSep, bEndL)) return false ; - nVal = unsigned int( nTemp) ; + nVal = ( unsigned int) ( nTemp) ; return true ; } @@ -320,12 +320,12 @@ NgeReader::ReadString( string& sVal, const char* szSep, bool bEndL) return false ; m_InFile.read( szBuff, nDim) ; if ( ! m_InFile.good()) { - delete szBuff ; + delete[] szBuff ; return false ; } szBuff[nDim] = '\0' ; sVal = szBuff ; - delete szBuff ; + delete[] szBuff ; return true ; } else { diff --git a/OffsetCurve.cpp b/OffsetCurve.cpp index e67f5ac..5030197 100644 --- a/OffsetCurve.cpp +++ b/OffsetCurve.cpp @@ -199,7 +199,7 @@ OffsetCurve::Make( const ICurve* pCrv, double dDist, int nType) } // verifico relazione con la curva precedente e aggiungo eventuali curve intermedie CurveComposite ccTemp ; - bool bOk = VerifyAndAdjustExternalAngle( pCrv1, pCrv2, vAngs[nInd1], dDist, ICurve::OFF_FILLET, ccTemp) ; + VerifyAndAdjustExternalAngle( pCrv1, pCrv2, vAngs[nInd1], dDist, ICurve::OFF_FILLET, ccTemp) ; // metto in lista curva precedente m_CrvLst.push_back( Release( pCrv1)) ; // se aggiunto qualcosa, lo metto in lista @@ -228,7 +228,7 @@ OffsetCurve::Make( const ICurve* pCrv, double dDist, int nType) ICurve* pCrv2 = m_CrvLst.front() ; // verifico relazione con la curva precedente e aggiungo eventuali curve intermedie CurveComposite ccTemp ; - bool bOk = VerifyAndAdjustExternalAngle( pCrv1, pCrv2, vAngs[nInd1], dDist, ICurve::OFF_FILLET, ccTemp) ; + VerifyAndAdjustExternalAngle( pCrv1, pCrv2, vAngs[nInd1], dDist, ICurve::OFF_FILLET, ccTemp) ; // se aggiunto qualcosa, lo metto in lista if ( ccTemp.GetCurveCount() > 0) { PtrOwner pCrv3( ccTemp.RemoveFirstOrLastCurve( false)) ; @@ -575,7 +575,7 @@ OffsetCurve::Make( const ICurve* pCrv, double dDist, int nType) // se fillet lo trasformo in smusso o estensione if ( IsFillet( pCrv, dDist)) { CurveComposite ccTemp ; - bool bOk = ModifyFillet( pCrv, dDist, nType, ccTemp) ; + ModifyFillet( pCrv, dDist, nType, ccTemp) ; // metto in lista le curve risultanti if ( ccTemp.GetCurveCount() > 0) { PtrOwner pCrv2( ccTemp.RemoveFirstOrLastCurve( false)) ; diff --git a/StmFromCurves.cpp b/StmFromCurves.cpp index bd122a3..c676f4a 100644 --- a/StmFromCurves.cpp +++ b/StmFromCurves.cpp @@ -354,7 +354,7 @@ GetSurfTriMeshSwept( const ICurve* pSect, const ICurve* pGuide, bool bCapEnds, d // calcolo la superficie PtrOwner pSTM( CreateSurfTriMesh()) ; if ( IsNull( pSTM)) - return false ; + return nullptr ; // salvo tolleranza lineare usata pSTM->SetLinearTolerance( dLinTol) ; // superficie swept @@ -478,7 +478,7 @@ CalcRegionPolyLines( const CICURVEPVECTOR& vpCurve, double dLinTol, vPLtmp.resize( vpCurve.size()) ; for ( int i = 0 ; i < int( vpCurve.size()) ; ++ i) { if ( ! vpCurve[i]->ApproxWithLines( dLinTol, ANG_TOL_STD_DEG, ICurve::APL_SPECIAL, vPLtmp[i])) - return nullptr ; + return false ; } // ne calcolo l'area e genero un ordine in senso decrescente typedef pair INDAREA ; // coppia indice, area @@ -525,4 +525,4 @@ CalcRegionPolyLines( const CICURVEPVECTOR& vpCurve, double dLinTol, // restituisco la normale positiva alla regione vtN = ( bCCW ? vtN0 : - vtN0) ; return true ; -} \ No newline at end of file +} diff --git a/SurfBezier.cpp b/SurfBezier.cpp index d772fc6..88ef863 100644 --- a/SurfBezier.cpp +++ b/SurfBezier.cpp @@ -1046,7 +1046,7 @@ SurfBezier::GetCurveOnU( double dV) const { // controlli if ( dV < - EPS_PARAM || dV > m_nSpanV + EPS_PARAM) - return false ; + return nullptr ; dV = Clamp( dV, 0., double( m_nSpanV)) ; // determino l'intervallo di span in V e riduco i parametri in essi @@ -1131,7 +1131,7 @@ SurfBezier::GetCurveOnV( double dU) const { // controlli if ( dU < - EPS_PARAM || dU > m_nSpanU + EPS_PARAM) - return false ; + return nullptr ; dU = Clamp( dU, 0., double( m_nSpanU)) ; // determino l'intervallo di span in U e riduco i parametri in essi @@ -1217,7 +1217,7 @@ SurfBezier::GetLoop( int nLoop) const // Se superficie completa, basta concatenare le 4 isoparametriche di bordo if ( ! m_bTrimmed) { // Esiste solo il loop esterno - if ( nLoop |= 0) + if ( nLoop != 0) return nullptr ; // Loop PtrOwner pLoop( CreateBasicCurveComposite()) ; diff --git a/SurfTriMesh.h b/SurfTriMesh.h index bc72487..6bfbf6b 100644 --- a/SurfTriMesh.h +++ b/SurfTriMesh.h @@ -429,14 +429,6 @@ class SurfTriMesh : public ISurfTriMesh, public IGeoObjRW mutable BBox3d m_b3HGrd3d ; // Box3d collegato a Hash Grid 3d } ; -//---------------------------------------------------------------------------- -static bool ChangePolyLineStart( const Point3d& ptNewStart, PolyLine& Loop) ; -// nSegNum 0-based -static bool PointPositionOnPolyLine( const Point3d& ptPoint, /*const*/ PolyLine& Loop, int& nSegNum, double& dParOnSeg) ; -static bool IsPointInsidePolyLine( const Point3d& ptP, /*const*/ PolyLine& plPoly) ; -static bool SplitPolyLineAtPoint( const Point3d& ptPoint, /*const*/ PolyLine& Loop, PolyLine& Loop1, PolyLine& Loop2) ; -static bool AddPolyLineToPolyLine(PolyLine& Poly, PolyLine& PolyToAdd) ; - //----------------------------------------------------------------------------- inline SurfTriMesh* CreateBasicSurfTriMesh( void) { return ( static_cast( CreateGeoObj( SRF_TRIMESH))) ; } diff --git a/SurfTriMeshBooleans.cpp b/SurfTriMeshBooleans.cpp index 94f1e55..0377b79 100644 --- a/SurfTriMeshBooleans.cpp +++ b/SurfTriMeshBooleans.cpp @@ -594,9 +594,6 @@ SurfTriMesh::GeneralizedCut( const ICurve& cvCurve, bool bSaveOnEq) Vector3d vtVecProva = cvOpenChain[nLastOpenLoopN][0].vtOuter ; vtVecProva.Normalize( EPS_ZERO) ; for ( int nLoop = 0 ; nLoop < int( cvBoundClosedLoopVec.size()) ; ++ nLoop) { - // Estremi del loop aperto - Point3d ptOpenLoopStP = cvOpenChain[nLastOpenLoopN][0].ptSt ; - Point3d ptOpenLoopEnP = cvOpenChain[nLastOpenLoopN][0].ptEn ; // Cerco se esistono dei tratti del loop chiuso corrente che sono // toccati dagli estremi del loop aperto corrente int nCvFirst = -1 ; @@ -797,9 +794,6 @@ SurfTriMesh::DecomposeLoop( CHAINVECTOR& cvOpenChain, INTVECTOR& vnDegVec, PNTMA Vector3d vtVecProva = cvOpenChain[nLastOpenLoopN][0].vtOuter ; vtVecProva.Normalize( EPS_ZERO) ; for ( int nLoop = 0 ; nLoop < int( cvBoundClosedLoopVec.size()) ; ++ nLoop) { - // Estremi del loop aperto - Point3d ptOpenLoopStP = cvOpenChain[nLastOpenLoopN][0].ptSt ; - Point3d ptOpenLoopEnP = cvOpenChain[nLastOpenLoopN][0].ptEn ; // Cerco se esistono dei tratti del loop chiuso corrente che sono // toccati dagli estremi del loop aperto corrente int nCvFirst = - 1 ; @@ -1961,7 +1955,6 @@ SurfTriMesh::IntersectTriMeshTriangle( SurfTriMesh& Other) m_vTria[nTA].nTempPart = nInOutNum ; } nVertNum = 0 ; - ptFirstV ; nCurVert = SurfB.GetFirstVertex( ptFirstV) ; nInOutNum = 0 ; while ( nInOutNum == 0 && nCurVert != SVT_NULL) { @@ -3383,7 +3376,6 @@ SurfTriMesh::SplitFacet( const INTERSCHAINMAP& IntersLineMap, PieceMap& NewFacet NewLoop2.IsClosedAndFlat(plLoopPlane2, dArea2); vNewPieces[nPart].vPieceLoop[0].IsClosedAndFlat(plContLoopPlane, dAreaCont); Vector3d vtLoopPlaneNorm1 = plLoopPlane1.GetVersN(); - Vector3d vtLoopPlaneNorm2 = plLoopPlane2.GetVersN(); Vector3d vtContLoopPlaneNorm = plContLoopPlane.GetVersN(); PolyLine NewLoopCCW, NewLoopCW; bool bFirstLoopIsCounter = vtLoopPlaneNorm1 * vtContLoopPlaneNorm > EPS_SMALL; @@ -3569,7 +3561,6 @@ SurfTriMesh::SplitFacet( const INTERSCHAINMAP& IntersLineMap, PieceMap& NewFacet NewLoop2.IsClosedAndFlat( plLoopPlane2, dArea2) ; vNewPieces[nPart].vPieceLoop[0].IsClosedAndFlat( plContLoopPlane, dAreaCont) ; Vector3d vtLoopPlaneNorm1 = plLoopPlane1.GetVersN(); - Vector3d vtLoopPlaneNorm2 = plLoopPlane2.GetVersN(); Vector3d vtContLoopPlaneNorm = plContLoopPlane.GetVersN(); PolyLine NewLoopCCW, NewLoopCW; bool bFirstLoopIsCounter = vtLoopPlaneNorm1 * vtContLoopPlaneNorm > EPS_SMALL; @@ -4078,7 +4069,6 @@ SurfTriMesh::RetriangulateFacetPieces( const PieceMap& NewFacet, for ( int& nT : vFacetTria) RemoveTriangle( nT) ; } - int nIndexPosInVec = 0 ; for ( auto it = NewFacet.begin() ; it != NewFacet.end() ; ++ it) { const vector& PiecesVector = it->second ; // Ciclo sui nuovi pezzi di faccia. @@ -4179,11 +4169,10 @@ SurfTriMesh::RetriangulateFacetPieces( const PieceMap& NewFacet, //---------------------------------------------------------------------------- bool SurfTriMesh::ItersectTriMeshFacets( SurfTriMesh& Other) -{ //////////////////////////////////////////////////////////////////////////////////////////////////////// - static int nTime = 0; - nTime++; - if (nTime == 32) - int mimi = 0; +{ + //////////////////////////////////////////////////////////////////////////////////////////////////////// + static int nTime = 0 ; + nTime ++ ; //////////////////////////////////////////////////////////////////////////////////////////////////////// SurfTriMesh& SurfB = Other ; // Le superfici devono essere valide @@ -4210,7 +4199,6 @@ SurfTriMesh::ItersectTriMeshFacets( SurfTriMesh& Other) } // Ciclo sulle facce delle mesh int nFacetNumA = GetFacetCount() ; - int nFacetNumB = SurfB.GetFacetCount() ; for ( int nFA = 0 ; nFA < nFacetNumA ; ++ nFA) { // Dati della faccia POLYLINEVECTOR LoopVecA ; @@ -4462,7 +4450,7 @@ SurfTriMesh::ItersectTriMeshFacets( SurfTriMesh& Other) } // Se la posizione della superficie A rispetto alla B non è definita e // B è esterna ad A, allora assumiamo che siano reciprocamente esterne. - if ( nInOutNumA == 0 && nInOutNumA == - 1) + if ( nInOutNumA == 0 && nInOutNumB == - 1) nInOutNumA = - 1 ; // Assegno gli indici interni/esterni. for ( int nTA = 0 ; nTA < nTriaNumA ; ++ nTA) { diff --git a/Tool.cpp b/Tool.cpp index 73a24c3..290c262 100644 --- a/Tool.cpp +++ b/Tool.cpp @@ -475,19 +475,19 @@ Tool::SetGenTool( const string& sToolName, const ICurveComposite* pToolOutline, if ( ! pCurve->ApproxWithLines( m_dLinTol, m_dAngTolDeg, ICurve::APL_SPECIAL, plyApprox)) return false ; // Aggiungo i segmenti di retta alla approssimazione - Point3d ptEnd ; + Point3d ptEnd, ptTmp ; plyApprox.GetFirstPoint( ptEnd) ; double dEndU ; pCurve->GetParamAtPoint( ptEnd, dEndU) ; Vector3d vtTanArc, vtExtN ; - pCurve->GetPointTang( dEndU, ICurve::FROM_MINUS, Point3d( 0, 0, 0), vtTanArc) ; + pCurve->GetPointTang( dEndU, ICurve::FROM_MINUS, ptTmp, vtTanArc) ; vtExtN = - vtTanArc ^ Z_AX ; vtExtN.Normalize() ; m_vArcNormals.emplace_back( vtExtN) ; while ( plyApprox.GetNextPoint( ptEnd)) { m_ArcLineApprox.AddLine( ptEnd) ; pCurve->GetParamAtPoint( ptEnd, dEndU) ; - pCurve->GetPointTang( dEndU, ICurve::FROM_MINUS, Point3d(0, 0, 0), vtTanArc) ; + pCurve->GetPointTang( dEndU, ICurve::FROM_MINUS, ptTmp, vtTanArc) ; vtExtN = - vtTanArc ^ Z_AX ; vtExtN.Normalize() ; m_vArcNormals.emplace_back( vtExtN) ; diff --git a/Triangulate.cpp b/Triangulate.cpp index 0d3c665..1b3cd35 100644 --- a/Triangulate.cpp +++ b/Triangulate.cpp @@ -363,7 +363,6 @@ Triangulate::MakeByEC2( const PNTVECTOR& vPt, const INTVECTOR& vPol, INTVECTOR& } // Try with 19 prev int nLimP = min( 19, n / 2) ; - double dSqDist2 = SQ_INFINITO ; for ( int h = 0 ; h < nLimP ; ++ h) { k = vPrev[k] ; if ( vEar[k] == EAS_NULL) diff --git a/VolZmap.cpp b/VolZmap.cpp index 7b7575a..cc0a5bd 100644 --- a/VolZmap.cpp +++ b/VolZmap.cpp @@ -1287,7 +1287,7 @@ VolZmap::ClonePart( int nPart) const // Definisco il numero di blocchi lungo x,y e z if ( ! pVolume->CalcBlockNum()) - return false ; + return nullptr ; // Sistema di riferimento intrinseco del nuovo solido Point3d ptNewO = m_MapFrame.Orig() + Vector3d( dNewOx, dNewOy, dNewOz) ; diff --git a/VolZmapCalculus.cpp b/VolZmapCalculus.cpp index 160029a..2ce0344 100644 --- a/VolZmapCalculus.cpp +++ b/VolZmapCalculus.cpp @@ -983,8 +983,6 @@ VolZmap::AvoidSimpleCylinder( const Frame3d& frCyl, double dR, double dH, bool b // Ciclo sui dexel. for ( int i = nStI ; i <= nEnI ; ++ i) { for ( int j = nStJ ; j <= nEnJ ; ++ j) { - if ( nMap == 2 && j == 75) - int a = 0 ; int nPos = j * m_nNx[nMap] + i ; int nSize = int( m_Values[nMap][nPos].size()) ; if ( nSize == 0) @@ -1519,71 +1517,72 @@ RectPrismoidSegmentCollision( const Frame3d& frPrismoid, double dLenghtBaseX, do // Se c'è collisione con almeno un triangolo delle facce ho finito Triangle3d trFaceTria1, trFaceTria2 ; + Point3d ptInt, ptInt2 ; // Faccia base trFaceTria1.Set( Point3d( - dHalfBaseX, - dHalfBaseY, 0.), Point3d( - dHalfBaseX, dHalfBaseY, 0.), Point3d( dHalfBaseX, dHalfBaseY, 0.)) ; - if ( trFaceTria1.Validate() && IntersLineTria( ptMySt, ptMyEn, trFaceTria1, Point3d(), Point3d()) != ILTT_NO) + if ( trFaceTria1.Validate() && IntersLineTria( ptMySt, ptMyEn, trFaceTria1, ptInt, ptInt2) != ILTT_NO) return true ; trFaceTria2.Set( Point3d( - dHalfBaseX, - dHalfBaseY, 0.), Point3d( dHalfBaseX, dHalfBaseY, 0.), Point3d( dHalfBaseX, - dHalfBaseY, 0.)) ; - if ( trFaceTria2.Validate() && IntersLineTria( ptMySt, ptMyEn, trFaceTria2, Point3d(), Point3d()) != ILTT_NO) + if ( trFaceTria2.Validate() && IntersLineTria( ptMySt, ptMyEn, trFaceTria2, ptInt, ptInt2) != ILTT_NO) return true ; // Faccia top trFaceTria1.Set( Point3d( - dHalfTopX, - dHalfTopY, dHeight), Point3d( dHalfTopX, dHalfTopY, dHeight), Point3d( - dHalfTopX, dHalfTopY, dHeight)) ; - if ( trFaceTria1.Validate() && IntersLineTria( ptMySt, ptMyEn, trFaceTria1, Point3d(), Point3d()) != ILTT_NO) + if ( trFaceTria1.Validate() && IntersLineTria( ptMySt, ptMyEn, trFaceTria1, ptInt, ptInt2) != ILTT_NO) return true ; trFaceTria2.Set( Point3d( - dHalfTopX, - dHalfTopY, dHeight), Point3d( dHalfTopX, - dHalfTopY, dHeight), Point3d( dHalfTopX, dHalfTopY, dHeight)) ; - if ( trFaceTria2.Validate() && IntersLineTria( ptMySt, ptMyEn, trFaceTria2, Point3d(), Point3d()) != ILTT_NO) + if ( trFaceTria2.Validate() && IntersLineTria( ptMySt, ptMyEn, trFaceTria2, ptInt, ptInt2) != ILTT_NO) return true ; // Faccia laterale 1 trFaceTria1.Set( Point3d( - dHalfBaseX, - dHalfBaseY, 0.), Point3d( dHalfTopX , - dHalfTopY , dHeight), Point3d( - dHalfTopX , - dHalfTopY , dHeight)) ; - if ( trFaceTria1.Validate() && IntersLineTria( ptMySt, ptMyEn, trFaceTria1, Point3d(), Point3d()) != ILTT_NO) + if ( trFaceTria1.Validate() && IntersLineTria( ptMySt, ptMyEn, trFaceTria1, ptInt, ptInt2) != ILTT_NO) return true ; trFaceTria2.Set( Point3d( - dHalfBaseX, - dHalfBaseY, 0.), Point3d( dHalfBaseX, - dHalfBaseY, 0.), Point3d( dHalfTopX, - dHalfTopY , dHeight)) ; - if ( trFaceTria2.Validate() && IntersLineTria( ptMySt, ptMyEn, trFaceTria2, Point3d(), Point3d()) != ILTT_NO) + if ( trFaceTria2.Validate() && IntersLineTria( ptMySt, ptMyEn, trFaceTria2, ptInt, ptInt2) != ILTT_NO) return true ; // Faccia laterale 2 trFaceTria1.Set( Point3d( dHalfBaseX, - dHalfBaseY, 0.), Point3d( dHalfTopX , dHalfTopY , dHeight), Point3d( dHalfTopX , - dHalfTopY , dHeight)) ; - if ( trFaceTria1.Validate() && IntersLineTria( ptMySt, ptMyEn, trFaceTria1, Point3d(), Point3d()) != ILTT_NO) + if ( trFaceTria1.Validate() && IntersLineTria( ptMySt, ptMyEn, trFaceTria1, ptInt, ptInt2) != ILTT_NO) return true ; trFaceTria2.Set( Point3d( dHalfBaseX, - dHalfBaseY, 0.), Point3d( dHalfBaseX, dHalfBaseY, 0.), Point3d( dHalfTopX , dHalfTopY , dHeight)) ; - if ( trFaceTria2.Validate() && IntersLineTria( ptMySt, ptMyEn, trFaceTria2, Point3d(), Point3d()) != ILTT_NO) + if ( trFaceTria2.Validate() && IntersLineTria( ptMySt, ptMyEn, trFaceTria2, ptInt, ptInt2) != ILTT_NO) return true ; // Faccia laterale 3 trFaceTria1.Set( Point3d( dHalfBaseX, dHalfBaseY, 0.), Point3d( - dHalfTopX , dHalfTopY , dHeight), Point3d( dHalfTopX , dHalfTopY , dHeight)) ; - if ( trFaceTria1.Validate() && IntersLineTria( ptMySt, ptMyEn, trFaceTria1, Point3d(), Point3d()) != ILTT_NO) + if ( trFaceTria1.Validate() && IntersLineTria( ptMySt, ptMyEn, trFaceTria1, ptInt, ptInt2) != ILTT_NO) return true ; trFaceTria2.Set( Point3d( dHalfBaseX, dHalfBaseY, 0.), Point3d( - dHalfBaseX, dHalfBaseY, 0.), Point3d( - dHalfTopX , dHalfTopY , dHeight)) ; - if ( trFaceTria2.Validate() && IntersLineTria( ptMySt, ptMyEn, trFaceTria2, Point3d(), Point3d()) != ILTT_NO) + if ( trFaceTria2.Validate() && IntersLineTria( ptMySt, ptMyEn, trFaceTria2, ptInt, ptInt2) != ILTT_NO) return true ; // Faccia laterale 4 trFaceTria1.Set( Point3d( - dHalfBaseX, dHalfBaseY, 0.), Point3d( - dHalfTopX , - dHalfTopY , dHeight), Point3d( - dHalfTopX , dHalfTopY , dHeight)) ; - if ( trFaceTria1.Validate() && IntersLineTria( ptMySt, ptMyEn, trFaceTria1, Point3d(), Point3d()) != ILTT_NO) + if ( trFaceTria1.Validate() && IntersLineTria( ptMySt, ptMyEn, trFaceTria1, ptInt, ptInt2) != ILTT_NO) return true ; trFaceTria2.Set( Point3d( - dHalfBaseX, dHalfBaseY, 0.), Point3d( - dHalfBaseX, - dHalfBaseY, 0.), Point3d( - dHalfTopX , - dHalfTopY , dHeight)) ; - if ( trFaceTria2.Validate() && IntersLineTria( ptMySt, ptMyEn, trFaceTria2, Point3d(), Point3d()) != ILTT_NO) + if ( trFaceTria2.Validate() && IntersLineTria( ptMySt, ptMyEn, trFaceTria2, ptInt, ptInt2) != ILTT_NO) return true ; return false ; @@ -2254,7 +2253,8 @@ VolZmap::AvoidSurfTm( const ISurfTriMesh& tmSurf, double dSafeDist, bool bPrecis trNewTria.Translate( dSafeDist * trTria.GetN()) ; } // Intersezione segento triangolo - int nIntersType = IntersLineTria( ptSegSt, vtLineDir, dSegLen, trNewTria, Point3d(), Point3d()) ; + Point3d ptInt, ptInt2 ; + int nIntersType = IntersLineTria( ptSegSt, vtLineDir, dSegLen, trNewTria, ptInt, ptInt2) ; // Collisione if ( nIntersType != IntLineTriaType::ILTT_NO) return false ; @@ -2356,7 +2356,8 @@ VolZmap::AvoidSurfTm( const ISurfTriMesh& tmSurf, double dSafeDist, bool bPrecis trNewTria.Translate( dSafeDist * trTria.GetN()) ; } // Intersezione segento triangolo - int nIntersType = IntersLineTria( ptSegSt, vtLineDir, dSegLen, trNewTria, Point3d(), Point3d()) ; + Point3d ptInt, ptInt2 ; + int nIntersType = IntersLineTria( ptSegSt, vtLineDir, dSegLen, trNewTria, ptInt, ptInt2) ; // Collisione if ( nIntersType != IntLineTriaType::ILTT_NO) return false ; diff --git a/VolZmapGraphics.cpp b/VolZmapGraphics.cpp index a86b07e..90c85fb 100644 --- a/VolZmapGraphics.cpp +++ b/VolZmapGraphics.cpp @@ -35,18 +35,6 @@ typedef Eigen::Matrix SvdVector ; typedef Eigen::JacobiSVD SvdDecomposer ; -// ------------------------- TABELLA BLOCCHI ADIACENTI ---------------------------------------------------------------------------- -static int NeighbourTable[8][4] = { - {0, -1, -1, -1}, - {1, 1, -1, -1}, - {1, 1, 2, -1}, - {2, 1, 2, -1}, - {1, 3, -1, -1}, - {2, 1, 3, -1}, - {2, 2, 3, -1}, - {3, 1, 2, 3} - } ; - // ------------------------- FUNZIONE TEST SULLE NORMALI -------------------------------------------------------------------------- enum FatureType { NO_FEATURE = 0, CORNER = 1, EDGE = 2} ; enum CanonicDir { X_PLUS = 1, X_MINUS = -1, Y_PLUS = 2, Y_MINUS = -2, Z_PLUS = 3, Z_MINUS = -3} ; @@ -2960,8 +2948,6 @@ VolZmap::FlipEdgesII( int nBlock) const vTria1[nTri1].SetGrade( nCol1) ; vTria2[nTri2].SetGrade( nCol2) ; // Setto le normali - Vector3d vtN1 = vTria1[nTri1].GetVertexNorm( 2) ; - Vector3d vtN2 = vTria2[nTri2].GetVertexNorm( 2) ; vTria1[nTri1].SetVertexNorm( 0, V_NULL) ; vTria1[nTri1].SetVertexNorm( 1, V_NULL) ; vTria2[nTri2].SetVertexNorm( 0, V_NULL) ; diff --git a/VolZmapVolume.cpp b/VolZmapVolume.cpp index aa11d6d..4f0c008 100644 --- a/VolZmapVolume.cpp +++ b/VolZmapVolume.cpp @@ -884,7 +884,7 @@ VolZmap::CylBall_ZDrilling( int nGrid, const Point3d & ptS, const Point3d & ptE, double dSqLen = vtC.SqLen() ; // Se il punto si trova dentro il cerchio taglio - if ( dSqLen < dSqRad - 2 * m_Tool.GetRadius() * EPS_SMALL) + if ( dSqLen < dSqRad - 2 * m_Tool.GetRadius() * EPS_SMALL) { // utensile cilindrico if ( m_Tool.GetType() == Tool::CYLMILL) SubtractIntervals( nGrid, i, j, dMinStemZ, dMaxStemZ, Z_AX, - Z_AX) ; @@ -902,6 +902,7 @@ VolZmap::CylBall_ZDrilling( int nGrid, const Point3d & ptS, const Point3d & ptE, SubtractIntervals( nGrid, i, j, dMinStemZ, dMaxStemZ + dH, - vtToolDir, vtNorm) ; } } + } } } return true ; @@ -1070,11 +1071,6 @@ VolZmap::CylBall_ZMilling( int nGrid, const Point3d & ptS, const Point3d & ptE, double dLenXY = vtMoveXY.LenXY() ; vtMove.Normalize() ; - // Parametri per determinare l'ellisse proiettata - double dCos = vtToolDir * vtMove ; - double dSemiAxMin = m_Tool.GetRadius() * dCos ; // x1^2 = a^2 - (a / b)^2 x2^2 ; a = r dCos e b = r; - double dSqSemiAxMin = dSemiAxMin * dSemiAxMin ; // da cui si ottiene x1^2 = a^2 - dCos^2 x2^2 - // Definizione di un sistema di riferimento ad hoc Vector3d vtV1, vtV2 ; @@ -3398,11 +3394,6 @@ VolZmap::CompCyl_ZMilling( int nGrid, const Point3d& ptS, const Point3d& ptE, co double dLenXY = vtMoveXY.LenXY() ; vtMove.Normalize() ; - // Parametri per determinare l'ellisse proiettata - double dCos = vtToolDir * vtMove ; - double dSemiAxMin = dRad * dCos ; // x1^2 = a^2 - (a / b)^2 x2^2 ; a = r dCos e b = r; - double dSqSemiAxMin = dSemiAxMin * dSemiAxMin ; // da cui si ottiene x1^2 = a^2 - dCos^2 x2^2 - double dSafeRad = dRad - EPS_SMALL ; // Definizione di un sistema di riferimento ad hoc @@ -3499,9 +3490,6 @@ VolZmap::CompConus_ZMilling( int nGrid, const Point3d& ptS, const Point3d& ptE, Point3d ptI = ( vtToolDir * ( ptE - ptS) > 0 ? ptS : ptE) ; Point3d ptF = ( vtToolDir * ( ptE - ptS) > 0 ? ptE : ptS) ; - Point3d ptIT = ptI - vtToolDir * dHei ; - Point3d ptFT = ptF - vtToolDir * dHei ; - Point3d ptIxy( ptI.x, ptI.y, 0) ; Point3d ptFxy( ptF.x, ptF.y, 0) ; @@ -4069,7 +4057,6 @@ VolZmap::CompCyl_Milling( int nGrid, const Point3d& ptS, const Point3d& ptE, Point3d ptI = ( vtToolDir * ( ptE - ptS) > 0 ? ptS : ptE) ; Point3d ptF = ( vtToolDir * ( ptE - ptS) > 0 ? ptE : ptS) ; Point3d ptITip = ptI - vtToolDir * dHei ; - Point3d ptFTip = ptF - vtToolDir * dHei ; // Definizione terne vettoriali e sistemi di riferimento intrinseci al movimento Vector3d vtMove = ptF - ptI ; @@ -4154,9 +4141,6 @@ VolZmap::CompConus_Milling( int nGrid, const Point3d& ptS, const Point3d& ptE, c Point3d ptI = ( vtToolDir * ( ptE - ptS) > 0 ? ptS : ptE) ; Point3d ptF = ( vtToolDir * ( ptE - ptS) > 0 ? ptE : ptS) ; - Point3d ptIT = ptI - vtToolDir * dHei ; - Point3d ptFT = ptF - vtToolDir * dHei ; - double dL = ( dMaxRad * dHei) / dDeltaR ; double dl = dL - dHei ;