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

### Our Solutions

Need professional assistance?
Consider our:

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

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

# Vertex on Edge?

Forums:

How can we create a vertex in the middle of an edge and recuperate its coordinates?

### Re: Vertex on

You need to get the Geometry attached to your edge.

Standard_Real First, Last; TopoDS_Edge edge; Handle(Geom_Curve) curve; curve = BRep_Tool::Curve(edge, First, Last);

Then, you can use the method Geom_Curve::Value() to get the point (gp_Pnt) on your curve.

Regards, Thomas

### Re: Re: Vertex on

We wrote

Standard_Real First=1, Last=3;

gp_Pnt P1(0, 0, 0), P2(10, 0, 0);

TopoDS_Edge edge;

edge=BRepBuilderAPI_MakeEdge(P1,P2);

Handle(Geom_Curve) curve;

curve = BRep_Tool::Curve(edge, First, Last);

gp_Pnt Milieu = curve.Value(2);

OS

We obtain the following error during the compilation: no matching function for call to `Handle_Geom_Curve::Value (double)'.

Do you have a solution?

### Re: Re: Vertex on

The class Geom_Curve is manipulate by Handle (pointer). So, you have to use: curve->Value(double).

For your example, you can define First and Last but it will be changed by the method Value(). The method Value() will give you the right values to use for First and Last. So, just use: Value((First+Last)/2.0);

Regards, Thomas