From dadcbe61ea432ffde3c46a943e9cac2476f39e69 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Fri, 25 Aug 2023 12:48:45 +0200 Subject: [PATCH] #3158 Fix unify inputs --- src/serializers/SvgSerializer.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/serializers/SvgSerializer.cpp b/src/serializers/SvgSerializer.cpp index f1962e6570..b11db7287c 100644 --- a/src/serializers/SvgSerializer.cpp +++ b/src/serializers/SvgSerializer.cpp @@ -699,6 +699,11 @@ void SvgSerializer::write(const IfcGeom::BRepElement* brep_obj) { IfcUtil::IfcBaseEntity* storey = p ? p->first : nullptr; double elev = p ? p->second : std::numeric_limits::quiet_NaN(); // @todo is it correct to call nameElement() here with a single storey (what if this element spans multiple?) + + if (unify_inputs_) { + compound_local = IfcGeom::util::unify(compound_local, 1.e-6); + } + geometry_data data{ compound_local, dash_arrays, trsf, brep_obj->product(), storey, elev, brep_obj->name(), nameElement(storey, brep_obj) }; if (auto_section_ || auto_elevation_ || section_ref_ || elevation_ref_ || elevation_ref_guid_ || deferred_section_data_) { @@ -1187,14 +1192,7 @@ void SvgSerializer::write(const geometry_data& data) { // Iterate over components of compound to have better chance of matching section edges to closed wires for (; it.More(); it.Next(), ++dash_it) { - const TopoDS_Shape& subshape_before_unification = it.Value(); - TopoDS_Shape subshape; - - if (unify_inputs_) { - subshape = IfcGeom::util::unify(subshape_before_unification, 1. - 6); - } else { - subshape = subshape_before_unification; - } + const TopoDS_Shape& subshape = it.Value(); Bnd_Box bb; try {