broken line

Is there a tool in OCC to handle broken lines as a Curve. Tht's i have a list of connected segments (not TopoDs_Edges, just the geometry), and i want to projects point onto this broken line. Actulally it's a BSpline with a degree of 1, but for efficiency an individual datastruct would be great. (For a simpler use it'd be good to have it as a Geom_Curve and not as a list of segments.)


Francois Lauzon's picture

You might want to have a look at BRepBuilderAPI_MakePolygon to build a wire from you connected segments (if the segment are linear) or just build a wire (BRepBuilderAPI_MakeWire) with your connected segments. Then, with the wire, you could use BRepAdaptor_CompCurve to transform your wire and make it look like a curve. Read the cdl files for details about use and limitations...

Then, a lot of algorithm work with adaptor, like Extrema_ExtPC to project a point on a curve.

Good Luck,