diff --git a/EXE_GdbGetSurf.cpp b/EXE_GdbGetSurf.cpp index ea2bb9f..463529d 100644 --- a/EXE_GdbGetSurf.cpp +++ b/EXE_GdbGetSurf.cpp @@ -261,6 +261,25 @@ ExeSurfFrChunkSimpleClassify( int nId1, int nChunk1, int nId2, int nChunk2, doub return nRes ; } +//---------------------------------------------------------------------------- +bool +ExeSurfFrChunkCenter( int nId, int nChunk, int nRefId, Point3d& ptCen, Vector3d& vtN) +{ + IGeomDB* pGeomDB = GetCurrGeomDB() ; + VERIFY_GEOMDB( pGeomDB, false) + // recupero la superficie FlatRegion + ISurfFlatRegion* pSfr = GetSurfFlatRegion( pGeomDB->GetGeoObj( nId)) ; + if ( pSfr == nullptr) + return false ; + // recupero il centro della parte + if ( ! pSfr->GetChunkCentroid( nChunk, ptCen)) + return false ; + // recupero la normale della regione + vtN = pSfr->GetNormVersor() ; + // gestione trasformazioni ( eventuali) + return TransformPoint( pGeomDB, nId, nRefId, ptCen) && TransformVector( pGeomDB, nId, nRefId, vtN) ; +} + //---------------------------------------------------------------------------- int ExeExtractSurfFrChunkLoops( int nId, int nChunk, int nDestGrpId, int* pnCount) diff --git a/EgtExecutor.rc b/EgtExecutor.rc index d07d2b7..b24ba1d 100644 Binary files a/EgtExecutor.rc and b/EgtExecutor.rc differ