EgtGeomKernel 1.6b7 :
- aggiunto calcolo baricentro di Curve - migliorata gestione richiesta nuovo Id - aggiunta intersezione linea-piano e linea-triangolo - corretto errore in PointGrid3d con 1 solo punto (non faceva alcunchè) - aggiunte funzioni di accesso a dati di SurfTM.
This commit is contained in:
+7
-27
@@ -15,13 +15,13 @@
|
||||
#include "stdafx.h"
|
||||
#include <algorithm>
|
||||
#include "Triangulate.h"
|
||||
#include "ProjPlane.h"
|
||||
#include "\EgtDev\Include\EGkPolyLine.h"
|
||||
#include "\EgtDev\Include\EGkPlane3d.h"
|
||||
|
||||
using namespace std ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
static enum PlaneType { PL_XY = 1, PL_YZ = 2, PL_ZX = 3} ;
|
||||
static enum EarStatus{ EAS_NULL = -1, EAS_NO = 0, EAS_OK = 1} ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
@@ -40,20 +40,10 @@ Triangulate::Make( const PolyLine& PL, PNTVECTOR& vPt, INTVECTOR& vTr)
|
||||
Plane3d plPlane ;
|
||||
if ( ! PL.IsClosedAndFlat( plPlane, dArea, 50 * EPS_SMALL))
|
||||
return false ;
|
||||
// determino il piano ottimale di proiezione e il relativo senso di rotazione
|
||||
bool bCCW ;
|
||||
if ( fabs( plPlane.vtN.z) >= fabs( plPlane.vtN.x) &&
|
||||
fabs( plPlane.vtN.z) >= fabs( plPlane.vtN.y)) {
|
||||
m_nPlane = PL_XY ;
|
||||
bCCW = ( plPlane.vtN.z > 0) ;
|
||||
}
|
||||
else if ( fabs( plPlane.vtN.x) >= fabs( plPlane.vtN.y)) {
|
||||
m_nPlane = PL_YZ ;
|
||||
bCCW = ( plPlane.vtN.x > 0) ;
|
||||
}
|
||||
else {
|
||||
m_nPlane = PL_ZX ;
|
||||
bCCW = ( plPlane.vtN.y > 0) ;
|
||||
}
|
||||
if ( ! CalcProjPlane( plPlane.vtN, m_nPlane, bCCW))
|
||||
return false ;
|
||||
// riempio il vettore con i vertici del poligono da triangolare
|
||||
vPt.clear() ;
|
||||
vPt.reserve( PL.GetPointNbr() - 1) ;
|
||||
@@ -107,20 +97,10 @@ Triangulate::Make( const POLYLINEVECTOR& vPL, PNTVECTOR& vPt, INTVECTOR& vTr)
|
||||
Plane3d plExtPlane ;
|
||||
if ( ! vPL[0].IsClosedAndFlat( plExtPlane, dArea, 50 * EPS_SMALL))
|
||||
return false ;
|
||||
// determino il piano ottimale di proiezione e il relativo senso di rotazione
|
||||
bool bCCW ;
|
||||
if ( fabs( plExtPlane.vtN.z) >= fabs( plExtPlane.vtN.x) &&
|
||||
fabs( plExtPlane.vtN.z) >= fabs( plExtPlane.vtN.y)) {
|
||||
m_nPlane = PL_XY ;
|
||||
bCCW = ( plExtPlane.vtN.z > 0) ;
|
||||
}
|
||||
else if ( fabs( plExtPlane.vtN.x) >= fabs( plExtPlane.vtN.y)) {
|
||||
m_nPlane = PL_YZ ;
|
||||
bCCW = ( plExtPlane.vtN.x > 0) ;
|
||||
}
|
||||
else {
|
||||
m_nPlane = PL_ZX ;
|
||||
bCCW = ( plExtPlane.vtN.y > 0) ;
|
||||
}
|
||||
if ( ! CalcProjPlane( plExtPlane.vtN, m_nPlane, bCCW))
|
||||
return false ;
|
||||
// verifico le altre polilinee
|
||||
for ( int i = 1 ; i < int( vPL.size()) ; ++i) {
|
||||
// deve essere chiusa, giacere nello stesso piano ed essere orientata al contrario della esterna
|
||||
|
||||
Reference in New Issue
Block a user