Extract controlpoints of a wire/edge

Sorry for asking...
but whats the best way to extract the controlpoints of an wire. I havn´t found an example or something similar!?!?!?
Thanks in advance.

Paul Jimenez's picture

Control points? Do you mean the Vertices? If so, use TopExp_Explorer.

jelle's picture


This works in pythonOCC:

crv = BRep_Tools.Curve(yourCurve) # get the underlying curve
crv.Poles( someIndex ) # find one of its control points

StefanKunze's picture

hmm yeah... could have been my idea!! Sorry

StefanKunze's picture

Ok I tried your "tips" but it´s more complex then I thought.

I want to create a surface limited by two wires. The wires contain different kind of edges (lines, arcs etc.) and have a limited number of elements. Whats the best way to create it???

My idea was do create a curve from the wire??
Handle (Geom_Curve) lCurveOne = BRep_Tool::Curve(pFirstWire,0,0); -> not supported in current version
Handle (Geom_Curve) lCurveTwo = BRep_Tool::Curve(pSecondWire,0,0);

get the controlpoints of the wires and put them in a 2 dimensional array...
and afterwards building the surface using the array -> GeomAPI_PointsToBSplineSurface???

Is there a better - working - strategy???
Thanks in advance - Stefan

Pawel's picture

Hi Stefan,

if you want to create a face and you know the wires are connected maybe you can use the BRepTools_WireExplorer to traverse through both wires in order to extract their edges and use BRepBuilderAPI_MakeWire::Add so that you get one single wire out of the two you have. Then use BRepBuilderAPI_MakeFace. This should work as long as you want to get a planar face...


StefanKunze's picture

Hi Pawel,
thats exactly the problem. There are some cases where I have a wire which doesn´t lie in a plane/level. My idea was know to discretise the wire with GCPnts_UniformAbscissa and use the controlpoints for building a surface with GeomAPI_PointsToBSpline. Is there a more accurate way doing this???