EgtGeomKernel 3.1h4 :

- resa pubblica la funzione per cambiare lo start di una polyline
- resa pubblica la MakeByFist della Triangulate
- aggiunta di due parametri per l'interpolazione delle linee di sync per il trimming.
This commit is contained in:
Daniele Bariletti
2026-08-26 09:21:43 +02:00
parent c64f9f482b
commit 07aee03006
6 changed files with 124 additions and 42 deletions
+17 -7
View File
@@ -33,7 +33,7 @@ enum TrgType { TRG_STD = 0, TRG_CAP = 1, TRG_NEEDLE = 2} ;
//----------------------------------------------------------------------------
static bool ChangeStartPntVector( int nNewStart, PNTVECTOR& vPi) ;
static bool MakeByFist( const POLYLINEVECTOR& vPL, PNTVECTOR& vPt, INTVECTOR& vTr) ;
bool MakeWithFist( const POLYLINEVECTOR& vPL, PNTVECTOR& vPt, INTVECTOR& vTr, bool bTop = false, bool bRandom = false, bool bSorted = true, bool bFancy = true) ;
static bool RemoveFistInvalidTrg( PNTVECTOR& vPt, INTVECTOR& vTr) ;
static int CalcTriangleType( const PNTVECTOR& vPt, const INTVECTOR& vTr, int nTrg) ;
static bool FindAdjacentOnLongerEdge( PNTVECTOR& vPt, INTVECTOR& vTr, int nTrgA, int&nEdgeA, int& nTrgB, int& nEdgeB) ;
@@ -61,7 +61,7 @@ Triangulate::Make( const PolyLine& PL, PNTVECTOR& vPt, INTVECTOR& vTr)
// se fist ( e geometria più complessa di un quadrilatero)
if ( FORCE_FIST && PL.GetPointNbr() > 5)
return MakeByFist( {PL}, vPt, vTr) ;
return MakeWithFist( {PL}, vPt, vTr) ;
// verifico che la polilinea sia chiusa e piana e calcolo il piano medio del poligono
double dArea ;
@@ -1585,15 +1585,25 @@ RemoveFistInvalidTrg( PNTVECTOR& vPt, INTVECTOR& vTr)
//----------------------------------------------------------------------------
bool
MakeByFist( const POLYLINEVECTOR& vPL, PNTVECTOR& vPt, INTVECTOR& vTr)
Triangulate::MakeByFist( const POLYLINEVECTOR& vPL, PNTVECTOR& vPt, INTVECTOR& vTr, bool bTop, bool bRandom, bool bSorted, bool bFancy)
{
// pulisco i vettori di ritorno
vPt.clear() ;
vTr.clear() ;
return MakeWithFist( vPL, vPt, vTr, bTop, bRandom, bSorted, bFancy) ;
}
//----------------------------------------------------------------------------
bool
MakeWithFist( const POLYLINEVECTOR& vPL, PNTVECTOR& vPt, INTVECTOR& vTr, bool bTop, bool bRandom, bool bSorted, bool bFancy)
{
// opzioni di triangolazione
rt_options rt_opt ;
InitDefaults( &rt_opt) ;
rt_opt.ears_top = false ;
rt_opt.ears_random = false ;
rt_opt.ears_sorted = true ;
rt_opt.ears_fancy = true ;
rt_opt.ears_top = bTop ;
rt_opt.ears_random = bRandom ;
rt_opt.ears_sorted = bSorted ;
rt_opt.ears_fancy = bFancy ;
// creo oggetto di fist per triangolazione
global_struct fist ;