diff --git a/src/ifcgeom/mapping/IfcCurveSegment.cpp b/src/ifcgeom/mapping/IfcCurveSegment.cpp index ce4eb990c8..29c339cdf8 100644 --- a/src/ifcgeom/mapping/IfcCurveSegment.cpp +++ b/src/ifcgeom/mapping/IfcCurveSegment.cpp @@ -47,12 +47,12 @@ static const double PI = boost::math::constants::pi(); double translate_to_length_measure(const IfcSchema::IfcCurve* crv, double param_value) { if (std::abs(param_value) < 1.e-7) { return param_value; - } else if (crv->as()) { - // @todo we should actually check magnitude of the vector - return param_value; - } else if (crv->as()) { - // @todo this is wrong. - return param_value; + } else if (auto line = crv->as()) { + return line->Dir()->Magnitude() * param_value; + } else if (auto clothoid = crv->as()) { + // param_value = 1.0, corresponds to tangent direction = PI/2 + // param_value = (arc length)/fabs(A*PI) + return fabs(clothoid->ClothoidConstant()*sqrt(PI))*param_value; } else if (auto circ = crv->as()) { return circ->Radius() * param_value; } else {