From 478da8f658c1e8a40ac6cce66571debb14b1b3f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Granskogen=20Bj=C3=B8rnstad?= Date: Tue, 10 Oct 2017 20:42:38 +0200 Subject: [PATCH] IfcConvert: Add section-height argument for SVG Enabling user specified overriding the default (zmin + 1 meter) value. --- src/ifcconvert/IfcConvert.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ifcconvert/IfcConvert.cpp b/src/ifcconvert/IfcConvert.cpp index bc2322ba9e..31708c6a9c 100644 --- a/src/ifcconvert/IfcConvert.cpp +++ b/src/ifcconvert/IfcConvert.cpp @@ -262,7 +262,7 @@ int main(int argc, char** argv) std::string unicode_mode; #endif short precision; - + double section_height; po::options_description serializer_options("Serialization options"); serializer_options.add_options() #ifdef HAVE_ICU @@ -273,6 +273,8 @@ int main(int argc, char** argv) ("bounds", po::value(&bounds), "Specifies the bounding rectangle, for example 512x512, to which the " "output will be scaled. Only used when converting to SVG.") + ("section-height", po::value(§ion_height), + "Specifies the cut section height for SVG 2D geometry.") ("use-element-names", "Use entity names instead of unique IDs for naming elements upon serialization. " "Applicable for OBJ, DAE, and SVG output.") @@ -532,6 +534,10 @@ int main(int argc, char** argv) } else if (output_extension == ".svg") { settings.set(IfcGeom::IteratorSettings::DISABLE_TRIANGULATION, true); serializer = new SvgSerializer(output_temp_filename, settings); + if (vmap.count("section-height") != 0) { + Logger::Notice("Overriding section height"); + static_cast(serializer)->setSectionHeight(section_height); + } if (bounding_width.is_initialized() && bounding_height.is_initialized()) { static_cast(serializer)->setBoundingRectangle(bounding_width.get(), bounding_height.get()); }