EgtExecutor 2.4a2 :

- aggiunto Repair a ExeCreateSurfTmByTriangles, ExeCreateSurfTmBySewing e ExeCreateSurfTmByVolZmap.
This commit is contained in:
DarioS
2022-01-07 09:55:01 +01:00
parent be6ea01c00
commit bf600bb9d1
2 changed files with 12 additions and 6 deletions
+12 -6
View File
@@ -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<ISurfTriMesh> 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<ISurfTriMesh> 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<ISurfTriMesh> 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