From e333c1c1000314147fe7da68565506c7c92721ae Mon Sep 17 00:00:00 2001 From: Petru Conduraru Date: Fri, 10 Jul 2026 15:55:03 +0300 Subject: [PATCH] ifcgeom: build the swept-area directrix from the offset curve far from origin (#4848) IfcSurfaceCurveSweptAreaSolid regressed in 0.8 for geometry far from the origin (for example parapets on a georeferenced building), which went missing or glitched. The kernel offsets the directrix toward the origin when it is far away (mean.norm() > 1e2), storing the offset copy in a local curve variable and setting applied_temporary_offset so the finished solid is translated back by +mean. But the wire was still built from scs->curve, the un-offset original, so the offset never took effect and the result was translated by +mean from its correct location. Build the wire from curve instead. When no offset is applied curve aliases scs->curve, so near-origin geometry is unchanged. Co-Authored-By: Claude Opus 4.8 --- src/ifcgeom/kernels/opencascade/sweep_along_curve.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ifcgeom/kernels/opencascade/sweep_along_curve.cpp b/src/ifcgeom/kernels/opencascade/sweep_along_curve.cpp index a5169864fb..20328963f4 100644 --- a/src/ifcgeom/kernels/opencascade/sweep_along_curve.cpp +++ b/src/ifcgeom/kernels/opencascade/sweep_along_curve.cpp @@ -128,7 +128,12 @@ bool OpenCascadeKernel::convert(const taxonomy::sweep_along_curve::ptr scs, Topo } } - auto w = convert_curve(scs->curve); + // Build the wire from curve, which is the directrix offset toward the origin + // when applied_temporary_offset is set. Using scs->curve here left the wire + // far from the origin yet still translated the result back by +mean, which + // misplaced sweeps far from the origin (#4848). When no offset is applied + // curve aliases scs->curve, so near-origin geometry is unaffected. + auto w = convert_curve(curve); if (w.which() != 2) { Logger::Root().Error("UNS", 9, "Unsupported directrix"); return false;