# Dividing an edge using length

Hi, is it possible to find middle point of an edge considering its total length instead of parameters?
Thanks

I don't know the best way, but I do have a couple of suggestions you could try:
- You could try using GCPnts_UniformAbscissa to either generate 3 points or use an abscissa of 1/2 the arc length.
- You could compute 1/2 the arc length and compute the parameter of the midpoint using a weighted binary search like algorithm

In case you are not aware, you can use BRepGProp::LinearProperties to compute the length of an edge.

An exception raises with the code below:

Handle(Geom_Curve) aCurve = BRep_Tool::Curve(edge,u,v);
GCPoints_UniformAbscissa abscissa(adaptor, nbPoints); // exception here

Where is my mistake here, do I get the adaptor wrong?
Thanks again

I don't understand the second line of the source well.
Simply, the following will work.

About the length of Edge, I needed it the other day, so I examined a little.

a) How to calclate the length of curve
Handle(Geom_Curve) aCurve = ...;
len = GCPnts_AbscissaPoint::Length( c );

b) How to calculate the parameter at specified distance from the position ts,
GCPnts_AbscissaPoint calc( c, dist, ts );
if ( calc.IsDone() ) {
ti = calc.Parameter();
}

c) if you specify the second parameter of BRepAdaptor_CompCurve true, parameter is measured as distance.