EgtGeomKernel 2.3g1 :
- versione x64 compilata con Clang-cl/LLVM - modifiche varie per eliminare warning più gravi di questo compilatore.
This commit is contained in:
+1
-1
@@ -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 ;
|
||||
|
||||
@@ -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() ;
|
||||
|
||||
@@ -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) ;
|
||||
}
|
||||
|
||||
|
||||
+4
-2
@@ -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) ;
|
||||
}
|
||||
|
||||
|
||||
+14
-12
@@ -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 ;
|
||||
}
|
||||
|
||||
+2
-2
@@ -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) ;
|
||||
|
||||
+1
-1
@@ -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 ; }
|
||||
|
||||
+1
-1
@@ -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) ;
|
||||
|
||||
+1
-1
@@ -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<CurveComposite> pCC( CreateBasicCurveComposite()) ;
|
||||
if ( ! pCC->FromPolyArc( PA))
|
||||
|
||||
+2
-2
@@ -91,7 +91,7 @@ CurveByInterp::GetCurve( int nMethod, int nType)
|
||||
// creo una curva di Bezier cubica per ogni intervallo
|
||||
PtrOwner<ICurveBezier> 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 ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
+1
-1
@@ -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 ; }
|
||||
|
||||
Binary file not shown.
@@ -37,7 +37,7 @@
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<PlatformToolset>ClangCL</PlatformToolset>
|
||||
<EnableASAN>false</EnableASAN>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
@@ -54,7 +54,7 @@
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<PlatformToolset>ClangCL</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
|
||||
@@ -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 ;
|
||||
|
||||
@@ -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 ;
|
||||
|
||||
@@ -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)) ;
|
||||
|
||||
+3
-3
@@ -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)
|
||||
|
||||
+2
-2
@@ -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 ;
|
||||
|
||||
+1
-1
@@ -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 ;
|
||||
|
||||
+5
-13
@@ -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
|
||||
|
||||
+3
-3
@@ -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 {
|
||||
|
||||
+3
-3
@@ -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<ICurve> 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<ICurve> pCrv2( ccTemp.RemoveFirstOrLastCurve( false)) ;
|
||||
|
||||
+3
-3
@@ -354,7 +354,7 @@ GetSurfTriMeshSwept( const ICurve* pSect, const ICurve* pGuide, bool bCapEnds, d
|
||||
// calcolo la superficie
|
||||
PtrOwner<ISurfTriMesh> 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<int,double> 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 ;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -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<CurveComposite> pLoop( CreateBasicCurveComposite()) ;
|
||||
|
||||
@@ -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<SurfTriMesh*>( CreateGeoObj( SRF_TRIMESH))) ; }
|
||||
|
||||
+5
-17
@@ -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<FacetPiece>& 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) {
|
||||
|
||||
@@ -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) ;
|
||||
|
||||
@@ -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)
|
||||
|
||||
+1
-1
@@ -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) ;
|
||||
|
||||
+17
-16
@@ -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 ;
|
||||
|
||||
@@ -35,18 +35,6 @@ typedef Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor, M
|
||||
typedef Eigen::Matrix<double, Eigen::Dynamic, 1, Eigen::ColMajor, MAX_FAN_BASE_VERTS, 1> SvdVector ;
|
||||
typedef Eigen::JacobiSVD<SvdMatrix, Eigen::QRPreconditioners::ColPivHouseholderQRPreconditioner> 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) ;
|
||||
|
||||
+2
-18
@@ -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 ;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user