EgtGeomKernel :

- gestiti più chunk per la triangolaziome ( MakeAdvanced)
- piccole modifiche a Intersezione e creazione di Stm da curve.
This commit is contained in:
Riccardo Elitropi
2023-12-07 13:13:28 +01:00
parent c2b36208e7
commit 15ed754512
5 changed files with 167 additions and 59 deletions
+16 -12
View File
@@ -35,6 +35,7 @@
#include "/EgtDev/Include/EGkPolygon3d.h"
#include "/EgtDev/Include/EgtPerfCounter.h"
#include "/EgtDev/Include/EGnStringUtils.h"
#include "/EgtDev/Include/EGkGeoObjSave.h"
#include <algorithm>
using namespace std ;
@@ -731,14 +732,14 @@ SurfTriMesh::RetriangulationForBooleanOperation( CHAINMAP& LoopLines, TRIA3DVECT
}
Polygon3d pgPol ;
pgPol.FromPolyLine(vPolygons[1]) ;
pgPol.FromPolyLine( vPolygons[1]) ;
bool bCodirectedNormals = trTria.GetN() * pgPol.GetVersN() > 0. ;
if ( bCodirectedNormals) {
for ( int nL = 1 ; nL < int( vPolygons.size()) ; ++ nL) {
vPolygons[nL].Invert() ;
}
}
//if ( bCodirectedNormals) {
// for ( int nL = 1 ; nL < int( vPolygons.size()) ; ++ nL) {
// vPolygons[nL].Invert() ;
// }
//} pizza
// Aggiungo al loop esterno i punti dei loop interni che si trovano su di esso
PNTULIST& ExternLoopList = vPolygons[0].GetUPointList() ;
@@ -788,12 +789,12 @@ SurfTriMesh::RetriangulationForBooleanOperation( CHAINMAP& LoopLines, TRIA3DVECT
// Aggiungo i punti al loop esterno
for ( int nPi = 0 ; nPi < int( vPointWithOrder.size()) ; ++ nPi) {
itSt = ExternLoopList.emplace( itEn, vPointWithOrder[nPi]) ;
}
}
}
PNTVECTOR vPt ;
INTVECTOR vTr ;
if ( Triangulate().Make( vPolygons, vPt, vTr)) {
if ( Triangulate().MakeAdvanced( vPolygons, vPt, vTr)) {
// Inserisco i nuovi triangoli
for ( int n = 0 ; n < int( vTr.size()) - 2 ; n += 3) {
int nNewTriaVertId[3] = { vTr[n], vTr[n + 1], vTr[n + 2]} ;
@@ -928,9 +929,11 @@ SurfTriMesh::RetriangulationForBooleanOperation( CHAINMAP& LoopLines, TRIA3DVECT
}
}
}
for ( int nL = 1 ; nL < int( vPolygons.size()) ; ++ nL) {
vPolygons[nL].Invert() ;
if ( Triangulate().Make( vPolygons[nL], vPt, vTr)) {
// pizza
//for ( int nL = 1 ; nL < int( vPolygons.size()) ; ++ nL) {
// vPolygons[nL].Invert() ;
vPolygons.erase( vPolygons.begin()) ;
if ( Triangulate().MakeAdvanced( vPolygons, vPt, vTr)) {
// Inserisco i nuovi triangoli
for (int n = 0 ; n < int( vTr.size()) - 2 ; n += 3) {
int nNewTriaVertId[3] = { vTr[n], vTr[n + 1], vTr[n + 2]} ;
@@ -950,7 +953,7 @@ SurfTriMesh::RetriangulationForBooleanOperation( CHAINMAP& LoopLines, TRIA3DVECT
}
}
}
}
//}
}
vInnerLoop.resize( 0) ;
}
@@ -1359,6 +1362,7 @@ SurfTriMesh::IntersectTriMeshTriangle( SurfTriMesh& Other)
// Se avvenuta modifica, aggiorno tutto
if ( bModif)
bContinue = ( AdjustVertices() && DoCompacting() && SurfB.AdjustVertices() && SurfB.DoCompacting()) ;
SaveGeoObj( this, "C:\\Users\\riccardo.elitropi\\Desktop\\PocketingVolumi\\a.nge") ;
// Triangoli sovrapposti
if ( bContinue) {
int nTriaNum2A = GetTriangleSize() ;