From a433f56337684e00b4050df4a74c1949f7652547 Mon Sep 17 00:00:00 2001 From: Tiago Azevedo <129018227+tiagoazvdo@users.noreply.github.com> Date: Fri, 29 May 2026 01:45:27 -0300 Subject: [PATCH] Fix sign of temporary offset restore in sweep_along_curve MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The temporary-offset workaround (#7408, commit bd57cc8735) subtracts the directrix centroid (`mean`) from the curve points before building the sweep near the origin, then must add it back to restore the original location. The restore negated the sign — `Move(-mean)` instead of `Move(+mean)` — placing the swept solid at -mean (mirrored through the origin) rather than its true position. Only triggers for polyline directrixes (`is_polyhedron()`) whose centroid is more than 100 m from the origin (`mean.norm() > 1e2`), so models centered near the origin are unaffected. Models that keep absolute site coordinates (e.g. many Revit/ODA IFC exports) render affected swept solids — reinforcing bars, pipes — at a mirrored phantom location far from the rest of the model. --- src/ifcgeom/kernels/opencascade/sweep_along_curve.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ifcgeom/kernels/opencascade/sweep_along_curve.cpp b/src/ifcgeom/kernels/opencascade/sweep_along_curve.cpp index 510c8f182d..f5262662ea 100644 --- a/src/ifcgeom/kernels/opencascade/sweep_along_curve.cpp +++ b/src/ifcgeom/kernels/opencascade/sweep_along_curve.cpp @@ -300,7 +300,11 @@ bool OpenCascadeKernel::convert(const taxonomy::sweep_along_curve::ptr scs, Topo if (applied_temporary_offset) { gp_Trsf trsf; - trsf.SetTranslation(gp_Vec(-mean.x(), -mean.y(), -mean.z())); + // Restore original position: add back the mean subtracted from the + // directrix points above. Previously negated, which placed the swept + // solid at -mean instead of its original location for geometry far + // from the origin. + trsf.SetTranslation(gp_Vec(mean.x(), mean.y(), mean.z())); result.Move(trsf); }