For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

Need to speed up your development?
Have a look at our:

Samples & Tools

 

Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

getting points of a intersection curve

Marco's picture
Forums: 

Hello,

I use BRepAlgoAPI_Section to calculate the intersection curve of two solids.

auto endContur = BRepAlgoAPI_Section(tube,cutShape);
endContur.Build();
auto conturShape = endContur.Shape();

The class returns a compound object. I need to get the points of the intersection curve, How can I do this? I looked into the documentation of TopoDS_Compound but there are no usefukl methods?

Best regards

Marco

jelle's picture

topology traversal is implemented with the TopExplorer class, that way you can get the vertices.
use BRep_Tool's Pnt method to get the values of the TopoDS_Vertex instances.

Marco's picture

Hello jelle,

at first thanks for your hint. I used

TopExp_Explorer ex;
for (ex.Init(conturShape,TopAbs_EDGE); ex.More(); ex.Next())
{
ex.Current();
}

to get the edges.
It it possible to get the points of a curve with a self choosen parametrization?
E.g. I have a cutting curve. The curve is not linear, some kind of b spline or something ... . Now it is a difference if I approximate the curve with 10 points or with 100 points.

Best regards

Marco

Attachments: 
Mauro Mariotti's picture

From the edge, you can get the 3d curve by BRep_Tool::Curve.

To get the points with an arc-length parametrization, you can use GCPnts_AbscissaPoint.
I don't know about a user-defined parametrization.

Ciao.
Mauro

Jan Brüninghaus's picture

Have a look at the classes in toolkit "TKGeomBase" package "GCPnts", like i.e. GCPnts_UniformDeflection.