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 <noreply@anthropic.com>
(cherry picked from commit e333c1c100)
This commit is contained in:
Petru Conduraru
2026-07-10 15:55:03 +03:00
committed by Dion Moult
parent 57d9c47c6c
commit 634a7add85
@@ -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.index() != 2) {
logger_.error("UNS", 9, "Unsupported directrix");
return false;