EgtGeomKernel :
- piccola modifica alle funzioni per creare superfici di Bezier.
This commit is contained in:
+19
-20
@@ -85,7 +85,7 @@ GetSurfBezierByRegion( const CICURVEPVECTOR& vpCurve, double dLinTol)
|
||||
//-------------------------------------------------------------------------------
|
||||
ISurfBezier*
|
||||
GetSurfBezierByExtrusion( const ICurve* pCurve, const Vector3d& vtExtr,
|
||||
bool bCapEnds, double dLinTol)
|
||||
bool bCapEnds, double dLinTol)
|
||||
{
|
||||
// verifica parametri
|
||||
if ( pCurve == nullptr || &vtExtr == nullptr)
|
||||
@@ -94,26 +94,25 @@ GetSurfBezierByExtrusion( const ICurve* pCurve, const Vector3d& vtExtr,
|
||||
PolyLine PL ;
|
||||
if ( ! pCurve->ApproxWithLines( dLinTol, ANG_TOL_STD_DEG, ICurve::APL_SPECIAL, PL))
|
||||
return nullptr ;
|
||||
// se richiesta chiusura agli estremi
|
||||
bool bDoCapEnds = false ;
|
||||
if ( bCapEnds) {
|
||||
// verifico che la curva sia chiusa e piatta
|
||||
Plane3d plPlane ;
|
||||
double dArea ;
|
||||
if ( PL.IsClosedAndFlat( plPlane, dArea, 50 * EPS_SMALL)) {
|
||||
// componente dell'estrusione perpendicolare al piano della curva
|
||||
double dOrthoExtr = plPlane.GetVersN() * vtExtr ;
|
||||
if ( ( abs( dOrthoExtr) > EPS_SMALL)) {
|
||||
bDoCapEnds = true ;
|
||||
// se negativa, inverto il senso del contorno
|
||||
if ( dOrthoExtr < 0)
|
||||
PL.Invert() ;
|
||||
}
|
||||
}
|
||||
}
|
||||
//// se richiesta chiusura agli estremi
|
||||
//bool bDoCapEnds = false ;
|
||||
//if ( bCapEnds) {
|
||||
// // verifico che la curva sia chiusa e piatta
|
||||
// Plane3d plPlane ;
|
||||
// double dArea ;
|
||||
// if ( PL.IsClosedAndFlat( plPlane, dArea, 50 * EPS_SMALL)) {
|
||||
// // componente dell'estrusione perpendicolare al piano della curva
|
||||
// double dOrthoExtr = plPlane.GetVersN() * vtExtr ;
|
||||
// if ( ( abs( dOrthoExtr) > EPS_SMALL)) {
|
||||
// bDoCapEnds = true ;
|
||||
// // se negativa, inverto il senso del contorno
|
||||
// if ( dOrthoExtr < 0)
|
||||
// PL.Invert() ;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
//PtrOwner<const ICurve> pBezierForm( CurveToBezierCurve( pCurve)) ;
|
||||
PtrOwner<const ICurve> pBezierForm( pCurve->Clone()) ;
|
||||
PtrOwner<const ICurve> pBezierForm( CurveToBezierCurve( pCurve)) ;
|
||||
// creo e setto la superficie trimesh
|
||||
PtrOwner<SurfBezier> pSbz( CreateBasicSurfBezier()) ;
|
||||
if ( IsNull( pSbz) || ! pSbz->CreateByExtrusion( pBezierForm, vtExtr))
|
||||
|
||||
@@ -3497,6 +3497,9 @@ SurfBezier::CreateByScrewing( const ICurve* pCurve, const Point3d& ptAx, const V
|
||||
for ( int i = 0 ; i < int(icc.GetIntersCount()) ; ++i) {
|
||||
IntCrvCrvInfo iccInfo ;
|
||||
icc.GetIntCrvCrvInfo( i, iccInfo) ;
|
||||
//controllo che sia una vera intersezione in 3D, sennò passo alla successiva
|
||||
if( ! AreSamePointApprox( iccInfo.IciA[0].ptI, iccInfo.IciB[0].ptI))
|
||||
continue ;
|
||||
// se è il punto di inizio o di fine va bene e procedo
|
||||
if ( AreSamePointApprox( ptStart, iccInfo.IciA[0].ptI) || AreSamePointApprox( ptEnd, iccInfo.IciA[0].ptI))
|
||||
continue ;
|
||||
|
||||
Reference in New Issue
Block a user