diff --git a/src/ifcgeom/Serialization.cpp b/src/ifcgeom/Serialization.cpp index 7a4f346528..8eabd1732b 100644 --- a/src/ifcgeom/Serialization.cpp +++ b/src/ifcgeom/Serialization.cpp @@ -18,6 +18,8 @@ #include "IfcGeom.h" +#include + template int convert_to_ifc(const T& t, U*& u, bool /*advanced*/) { std::vector coords(3); @@ -220,6 +222,15 @@ int convert_to_ifc(const Handle_Geom_Curve& c, IfcSchema::IfcCurve*& curve, bool } } + if (bspline->IsPeriodic() && points->size()) { + points->push(*points->begin()); + weights.push_back(weights[0]); + auto sum = std::accumulate(mults.begin(), mults.end(), 0); + auto d = sum - (bspline->Degree() + (int)points->size() + 1); + (*mults.begin()) -= d / 2; + (*mults.rbegin()) -= d / 2; + } + if (rational) { curve = new IfcSchema::IfcRationalBSplineCurveWithKnots( bspline->Degree(),