length of Geom_Curve

how i can determinate the length of Geom_Curve?
and i'have a Curve in 2d space how to convert this curve in 3d space with a tolerance (of convert).

thank you for your help

Marco Matt's picture

I think you can get only the length of a topological curve, not a geometric curve (which should be infinite)

const Standard_Real MyAlgo::getLength(const TopoDS_Shape & shape)
{
Q_ASSERT( shape.ShapeType() == TopAbs_WIRE || shape.ShapeType() == TopAbs_EDGE );
GProp_GProps system;
BRepGProp::LinearProperties(shape, system);
return system.Mass();
}