EgtExecutor :

- aggiunte funzioni Exe e Lua SurfTmFacetAdjacencies e SurfTmFacetsContact.
This commit is contained in:
Dario Sassi
2017-08-22 08:08:30 +00:00
parent fe8e148d7f
commit cfbe224372
2 changed files with 90 additions and 0 deletions
+34
View File
@@ -993,6 +993,20 @@ ExeSurfTmFacetFromTria( int nId, int nT)
return pStm->GetFacetFromTria( nT) ;
}
//----------------------------------------------------------------------------
bool
ExeSurfTmFacetAdjacencies( int nId, int nFacet, INTMATRIX& vAdj)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
// recupero la superficie TriMesh
const ISurfTriMesh* pStm = GetSurfTriMesh( pGeomDB->GetGeoObj( nId)) ;
bool bOk = ( pStm != nullptr) ;
// recupero le adiacenze
bOk = bOk && pStm->GetFacetAdjacencies( nFacet, vAdj) ;
return bOk ;
}
//----------------------------------------------------------------------------
bool
ExeSurfTmFacetNearestEndPoint( int nId, int nFacet, const Point3d& ptNear, int nRefId,
@@ -1071,6 +1085,26 @@ ExeSurfTmFacetNormVersor( int nId, int nFacet, int nRefId, Vector3d& vtNorm)
return TrasformVector( pGeomDB, nId, nRefId, vtNorm) ;
}
//----------------------------------------------------------------------------
bool
ExeSurfTmFacetsContact( int nId, int nF1, int nF2, int nRefId, bool& bAdjac, Point3d& ptP1, Point3d& ptP2, double& dAng)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
// recupero la superficie trimesh
const ISurfTriMesh* pStm = GetSurfTriMesh( pGeomDB->GetGeoObj( nId)) ;
if ( pStm == nullptr)
return false ;
// recupero i dati di contatto tra le due facce
if ( ! pStm->GetFacetsContact( nF1, nF2, bAdjac, ptP1, ptP2, dAng))
return false ;
// gestione trasformazione ( eventuale)
if ( bAdjac)
return TrasformPoint( pGeomDB, nId, nRefId, ptP1) && TrasformPoint( pGeomDB, nId, nRefId, ptP2) ;
else
return true ;
}
//----------------------------------------------------------------------------
bool
ExeTextNormVersor( int nId, int nRefId, Vector3d& vtNorm)