EgtGeomKernel 1.9l3 :

- modifiche a ApproxWithArcsEx di CurveComposite per eliminare le parti allineate in tolleranza
- migliorate RemoveAlignedPoints di PolyLine e PolyArc
- migliorata GetSurfFlatRegionFromFatCurve.
This commit is contained in:
Dario Sassi
2018-12-19 08:45:59 +00:00
parent 92e3cc70a4
commit a149384fbb
6 changed files with 126 additions and 17 deletions
+12 -5
View File
@@ -18,6 +18,7 @@
#include "CurveComposite.h"
#include "SurfFlatRegion.h"
#include "GeoConst.h"
#include "/EgtDev/Include/EgkBiArcs.h"
#include "/EgtDev/Include/EgkOffsetCurve.h"
#include "/EgtDev/Include/EGkSfrCreate.h"
#include "/EgtDev/Include/EgtPointerOwner.h"
@@ -122,16 +123,22 @@ GetSurfFlatRegionFromFatCurve( ICurve* pCrv, double dRadius, bool bSquareEnds, b
if ( IsNull( pCompo1) || ! pCompo1->AddCurve( Release( pCurve)))
return nullptr ;
// se distanza tra gli estremi minore di due volte il raggio la chiudo, purchè curva abbastanza lunga
double dLen ;
Point3d ptStart, ptEnd ;
Point3d ptStart, ptEnd, ptMid ;
Vector3d vtStart, vtEnd ;
pCompo1->GetStartPoint( ptStart) ;
pCompo1->GetStartDir( vtStart) ;
pCompo1->GetEndPoint( ptEnd) ;
pCompo1->GetEndDir( vtEnd) ;
pCompo1->GetLength( dLen) ;
if ( dLen > 2 * dRadius && Dist( ptStart, ptEnd) <= 2 * dRadius)
pCompo1->Close() ;
pCompo1->GetMidPoint( ptMid) ;
if ( Dist( ptStart, ptEnd) <= 2 * dRadius && Dist( ptStart, ptMid) > 2 * dRadius && Dist( ptEnd, ptMid) > 2 * dRadius) {
double dAngEnd ; vtEnd.ToSpherical( nullptr, nullptr, &dAngEnd) ;
double dAngStart ; vtStart.ToSpherical( nullptr, nullptr, &dAngStart) ;
PtrOwner<ICurve> pClose( GetBiArc( ptEnd, dAngEnd, ptStart, dAngStart, 0.5)) ;
if ( ! IsNull( pClose))
pCompo1->AddCurve( Release( pClose)) ;
else
pCompo1->Close() ;
}
// tipo di offset
int nOffsType = ( bSquareMids ? ICurve::OFF_EXTEND : ICurve::OFF_FILLET) ;
// se curva chiusa