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:
@@ -16,6 +16,7 @@
|
||||
#include "CurveArc.h"
|
||||
#include "CurveComposite.h"
|
||||
#include "DistPointArc.h"
|
||||
#include "PolygonPlane.h"
|
||||
#include "GeoConst.h"
|
||||
#include "GeoObjFactory.h"
|
||||
#include "NgeWriter.h"
|
||||
@@ -782,6 +783,28 @@ CurveArc::GetCenterPoint( Point3d& ptCen) const
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
CurveArc::GetCentroid( Point3d& ptCen) const
|
||||
{
|
||||
// verifico lo stato
|
||||
if ( m_nStatus != OK)
|
||||
return false ;
|
||||
// approssimo la curva con una polilinea
|
||||
PolyLine PL ;
|
||||
if ( ! ApproxWithLines( LIN_TOL_STD, ANG_TOL_STD_DEG, PL))
|
||||
return false ;
|
||||
// calcolo il centro mediante PolygonPlane
|
||||
Point3d ptP ;
|
||||
PolygonPlane PolyPlane ;
|
||||
for ( bool bFound = PL.GetFirstPoint( ptP) ; bFound ; bFound = PL.GetNextPoint( ptP))
|
||||
PolyPlane.AddPoint( ptP) ;
|
||||
if ( PolyPlane.GetCentroid( ptCen))
|
||||
return true ;
|
||||
// se non riuscito, uso il punto medio
|
||||
return GetMidPoint( ptCen) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
CurveArc::GetDir( double dU, Vector3d& vtDir) const
|
||||
|
||||
Reference in New Issue
Block a user