diff --git a/src/serializers/SvgSerializer.cpp b/src/serializers/SvgSerializer.cpp index 4ec57b5a67..43e2c8b941 100644 --- a/src/serializers/SvgSerializer.cpp +++ b/src/serializers/SvgSerializer.cpp @@ -79,6 +79,7 @@ #include "../ifcparse/IfcGlobalId.h" #include "../ifcgeom_schema_agnostic/base_utils.h" +#include "../ifcgeom_schema_agnostic/boolean_utils.h" #include #include @@ -1179,7 +1180,14 @@ 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 = it.Value(); + 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; + } Bnd_Box bb; try { diff --git a/src/serializers/SvgSerializer.h b/src/serializers/SvgSerializer.h index 721c409926..1424c1420e 100644 --- a/src/serializers/SvgSerializer.h +++ b/src/serializers/SvgSerializer.h @@ -515,6 +515,7 @@ protected: bool use_namespace_, use_hlr_poly_, use_prefiltering_, always_project_, polygonal_; bool emit_building_storeys_; bool no_css_; + bool unify_inputs_; int profile_threshold_; @@ -566,6 +567,7 @@ public: , polygonal_(false) , emit_building_storeys_(true) , no_css_(false) + , unify_inputs_(false) , profile_threshold_(-1) , file(0) , storey_(0) @@ -662,6 +664,14 @@ public: no_css_ = b; } + void setUnifyInputs(bool b) { + unify_inputs_ = b; + } + + bool getUnifyInputs() const { + return unify_inputs_; + } + void setScale(double s) { scale_ = s; } void setDrawingCenter(double x, double y) { center_x_ = x; center_y_ = y;