diff --git a/EXE_GdbCreateSurf.cpp b/EXE_GdbCreateSurf.cpp index 5e6cf74..519ea79 100644 --- a/EXE_GdbCreateSurf.cpp +++ b/EXE_GdbCreateSurf.cpp @@ -443,8 +443,8 @@ MyCreateSidePlaneHull( const PNTVECTOR& vVert, bool bNXp, const BBox3d& b3Box, i } //---------------------------------------------------------------------------- -bool -MyDoSewing( ISurfTriMesh* pStm, const Polygon3d& Polyg) +static bool +MyCreateSewPolygon( ISurfTriMesh* pStm, const Polygon3d& Polyg) { // verifico esistenza superficie if ( pStm == nullptr) @@ -544,8 +544,8 @@ MyCreateSurfTmConvexHullInBBox( int nParentId, int nId, const BBox3d& b3Box, int PtrOwner pChStm( CreateSurfTriMesh()) ; if ( IsNull( pChStm)) return GDB_ID_NULL ; - if ( ! MyDoSewing( pChStm, Polyg1) || - ! MyDoSewing( pChStm, Polyg2)) + if ( ! MyCreateSewPolygon( pChStm, Polyg1) || + ! MyCreateSewPolygon( pChStm, Polyg2)) return GDB_ID_NULL ; pChStm->DoCompacting() ; // recupero il riferimento locale del gruppo destinazione @@ -1280,8 +1280,10 @@ ExeCreateSurfTmByTriangles( int nParentId, const INTVECTOR& vIds, bool bErase) } // valido la superficie e calcolo le adiacenze bOk = bOk && StmFts.End() ; - // inserisco la superficie trimesh nel DB + // chiudo eventuali fessure tra i triangoli PtrOwner pStm( StmFts.GetSurf()) ; + bOk = bOk && pStm->Repair() ; + // inserisco la superficie trimesh nel DB int nNewId = ( bOk ? pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pStm)) : GDB_ID_NULL) ; // se richiesto, cancello le superfici originali if ( nNewId != GDB_ID_NULL && bErase) { @@ -1355,6 +1357,8 @@ ExeCreateSurfTmBySewing( int nParentId, const INTVECTOR& vIds, bool bErase) } // compatto bOk = bOk && pStm->DoCompacting() ; + // chiudo eventuali fessure tra i triangoli + bOk = bOk && pStm->Repair() ; // inserisco la superficie trimesh nel DB int nNewId = ( bOk ? pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pStm)) : GDB_ID_NULL) ; // se richiesto, cancello le superfici originali @@ -1461,8 +1465,10 @@ ExeCreateSurfTmByVolZmap( int nParentId, int nZmapId, int nPart) } // valido la superficie e calcolo le adiacenze bOk = bOk && StmFts.End() ; - // inserisco la superficie trimesh nel DB + // chiudo eventuali fessure tra i triangoli PtrOwner pStm( StmFts.GetSurf()) ; + bOk = bOk && pStm->Repair() ; + // inserisco la superficie trimesh nel DB int nNewId = ( bOk ? pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pStm)) : GDB_ID_NULL) ; ExeSetModified() ; // se richiesto, salvo il comando Lua equivalente diff --git a/EgtExecutor.rc b/EgtExecutor.rc index 3a60cb4..3142e34 100644 Binary files a/EgtExecutor.rc and b/EgtExecutor.rc differ