mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-12 06:32:09 +00:00
SVG serialization UnifyInputs option
This commit is contained in:
@@ -81,6 +81,7 @@
|
|||||||
|
|
||||||
#include "../ifcparse/IfcGlobalId.h"
|
#include "../ifcparse/IfcGlobalId.h"
|
||||||
#include "../ifcgeom/kernels/opencascade/base_utils.h"
|
#include "../ifcgeom/kernels/opencascade/base_utils.h"
|
||||||
|
#include "../ifcgeom/kernels/opencascade/boolean_utils.h"
|
||||||
#include "../ifcgeom/kernels/opencascade/OpenCascadeConversionResult.h"
|
#include "../ifcgeom/kernels/opencascade/OpenCascadeConversionResult.h"
|
||||||
|
|
||||||
#include <boost/format.hpp>
|
#include <boost/format.hpp>
|
||||||
@@ -1191,7 +1192,14 @@ void SvgSerializer::write(const geometry_data& data) {
|
|||||||
// Iterate over components of compound to have better chance of matching section edges to closed wires
|
// Iterate over components of compound to have better chance of matching section edges to closed wires
|
||||||
for (; it.More(); it.Next(), ++dash_it) {
|
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;
|
Bnd_Box bb;
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -43,6 +43,7 @@
|
|||||||
#include <BRepTopAdaptor_FClass2d.hxx>
|
#include <BRepTopAdaptor_FClass2d.hxx>
|
||||||
#include <Geom_Plane.hxx>
|
#include <Geom_Plane.hxx>
|
||||||
#include <BRepBndLib.hxx>
|
#include <BRepBndLib.hxx>
|
||||||
|
#include <BRepMesh_IncrementalMesh.hxx>
|
||||||
|
|
||||||
#if OCC_VERSION_HEX >= 0x70300
|
#if OCC_VERSION_HEX >= 0x70300
|
||||||
#include <Bnd_OBB.hxx>
|
#include <Bnd_OBB.hxx>
|
||||||
@@ -517,6 +518,7 @@ protected:
|
|||||||
bool use_namespace_, use_hlr_poly_, use_prefiltering_, always_project_, polygonal_;
|
bool use_namespace_, use_hlr_poly_, use_prefiltering_, always_project_, polygonal_;
|
||||||
bool emit_building_storeys_;
|
bool emit_building_storeys_;
|
||||||
bool no_css_;
|
bool no_css_;
|
||||||
|
bool unify_inputs_;
|
||||||
|
|
||||||
int profile_threshold_;
|
int profile_threshold_;
|
||||||
|
|
||||||
@@ -568,6 +570,7 @@ public:
|
|||||||
, polygonal_(false)
|
, polygonal_(false)
|
||||||
, emit_building_storeys_(true)
|
, emit_building_storeys_(true)
|
||||||
, no_css_(false)
|
, no_css_(false)
|
||||||
|
, unify_inputs_(false)
|
||||||
, profile_threshold_(-1)
|
, profile_threshold_(-1)
|
||||||
, file(0)
|
, file(0)
|
||||||
, storey_(0)
|
, storey_(0)
|
||||||
@@ -664,6 +667,14 @@ public:
|
|||||||
no_css_ = b;
|
no_css_ = b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setUnifyInputs(bool b) {
|
||||||
|
unify_inputs_ = b;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool getUnifyInputs() const {
|
||||||
|
return unify_inputs_;
|
||||||
|
}
|
||||||
|
|
||||||
void setScale(double s) { scale_ = s; }
|
void setScale(double s) { scale_ = s; }
|
||||||
void setDrawingCenter(double x, double y) {
|
void setDrawingCenter(double x, double y) {
|
||||||
center_x_ = x; center_y_ = y;
|
center_x_ = x; center_y_ = y;
|
||||||
|
|||||||
Reference in New Issue
Block a user