EgtGeomKernel :

- aggiunte funzioni per verifica collisione tra Box, Cilindro e Sfera con Superfici triMesh chiuse
- aggiunta costruzione di Polygon3d da triangolo.
This commit is contained in:
Dario Sassi
2020-01-10 09:32:59 +00:00
parent 00c725651f
commit fba63ea82e
10 changed files with 321 additions and 62 deletions
+20 -1
View File
@@ -53,6 +53,25 @@ Polygon3d::FromRectangle( double dDimX, double dDimY)
return true ;
}
//----------------------------------------------------------------------------
bool
Polygon3d::FromTriangle( const Triangle3d& trTria)
{
// annullo il piano del poligono
m_Plane.Reset() ;
// verifico che il triangolo sia valido
if ( ! trTria.IsValid())
return false ;
// assegno il piano
m_Plane.Set( trTria.GetP( 0), trTria.GetN()) ;
// assegno i punti
m_vVert.emplace_back( trTria.GetP( 0)) ;
m_vVert.emplace_back( trTria.GetP( 1)) ;
m_vVert.emplace_back( trTria.GetP( 2)) ;
return true ;
}
//----------------------------------------------------------------------------
bool
Polygon3d::FromPolyLine( const PolyLine& PL)
@@ -152,7 +171,7 @@ Polygon3d::Trim( const Plane3d& plPlane, bool bInVsOut, bool bOnEq)
// determino se normali equiverse
bool bEquivNormal = ( m_Plane.GetVersN() * plPlane.GetVersN() > 0) ;
// se relazione tra normali opposta al desiderato, lo annullo
if ( bOnEq != bEquivNormal)
if ( bOnEq != bEquivNormal)
m_vVert.clear() ;
return true ;
}