EgtGeomKernel :

- piccola modifica alle funzioni per creare superfici di Bezier.
This commit is contained in:
Daniele Bariletti
2024-07-17 09:10:03 +02:00
parent b9138029db
commit 28695f9138
2 changed files with 22 additions and 20 deletions
+19 -20
View File
@@ -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))
+3
View File
@@ -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 ;