From b7a4f0bff3e686f02169e80ac2476a87dc05a887 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Fri, 28 Mar 2025 20:17:50 +0100 Subject: [PATCH] EgtGeomKernel : - a SurfTriMesh aggiunto metodo CreateByPolygonWithHoles. --- SfrCreate.cpp | 6 ++---- SurfTriMesh.cpp | 11 +++++++++++ SurfTriMesh.h | 5 +++-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/SfrCreate.cpp b/SfrCreate.cpp index 4d576d8..cc18437 100644 --- a/SfrCreate.cpp +++ b/SfrCreate.cpp @@ -577,10 +577,8 @@ SurfFlatRegionByContours::GetUnusedCurveTempProps( INTVECTOR& vId) bool CalcRegionPolyLines( const POLYLINEVECTOR& vPL, Vector3d& vtN, INTMATRIX& vnPLIndMat, BOOLVECTOR& vbInvert) { - // matrice di interi : ogni riga corrisponde ad un chunk, dove in posizione 0 c'è il loop esterno e nelle - // successive i loop interni - //INTMATRIX vnPLIndMat ; - // vettore di bool : riferito al vettore originale delle polyline, riporta true se la polyline è stata invertita + // vnPLIndMat : ogni riga corrisponde ad un chunk, in posizione 0 c'è il loop esterno e nelle successive i loop interni + // vbInvert : riferito al vettore delle polyline, riporta true se la polyline è stata invertita // ricavo versore normale Plane3d plPlane ; double dArea ; diff --git a/SurfTriMesh.cpp b/SurfTriMesh.cpp index 3b22004..87e5ffb 100644 --- a/SurfTriMesh.cpp +++ b/SurfTriMesh.cpp @@ -2091,6 +2091,17 @@ SurfTriMesh::CreateByFlatContour( const PolyLine& PL) return AdjustTopology() ; } +//---------------------------------------------------------------------------- +bool +SurfTriMesh::CreateByPolygonWithHoles( const POLYLINEVECTOR& vPL) +{ + INTMATRIX vnPLIndMat ; + vnPLIndMat.push_back( { 0}) ; + for ( int i = 1 ; i < int( vPL.size()) ; ++ i) + vnPLIndMat[0].push_back( i) ; + return CreateByRegion( vPL, vnPLIndMat) ; +} + //---------------------------------------------------------------------------- bool SurfTriMesh::CreateByRegion( const POLYLINEVECTOR& vPL, const INTMATRIX& vnPLIndMat) diff --git a/SurfTriMesh.h b/SurfTriMesh.h index 135ea7e..96bdd43 100644 --- a/SurfTriMesh.h +++ b/SurfTriMesh.h @@ -1,7 +1,7 @@ //---------------------------------------------------------------------------- -// EgalTech 2014-2023 +// EgalTech 2014-2025 //---------------------------------------------------------------------------- -// File : SurfTriMesh.h Data : 09.12.23 Versione : 2.5l2 +// File : SurfTriMesh.h Data : 28.03.25 Versione : 2.7c4 // Contenuto : Dichiarazione della classe Superficie TriMesh. // // @@ -251,6 +251,7 @@ class SurfTriMesh : public ISurfTriMesh, public IGeoObjRW bool RemoveTriangle( int nId) override ; bool AdjustTopology( void) override ; bool CreateByFlatContour( const PolyLine& PL) override ; + bool CreateByPolygonWithHoles( const POLYLINEVECTOR& vPL) override ; bool CreateByExtrusion( const PolyLine& PL, const Vector3d& vtExtr) override ; bool CreateByPointCurve( const Point3d& ptP, const PolyLine& PL) override ; bool CreateByTwoCurves( const PolyLine& PL1, const PolyLine& PL2, int nRuledType) override ;