From a17c44c076ee31761f32ec8d947e24f3f45d5032 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Sat, 20 Nov 2021 14:05:11 +0100 Subject: [PATCH] #1153 update draw.py with two new options --- src/ifcopenshell-python/ifcopenshell/draw.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ifcopenshell-python/ifcopenshell/draw.py b/src/ifcopenshell-python/ifcopenshell/draw.py index db3dc62a97..0adeb8ab89 100644 --- a/src/ifcopenshell-python/ifcopenshell/draw.py +++ b/src/ifcopenshell-python/ifcopenshell/draw.py @@ -54,6 +54,8 @@ class draw_settings: include_entities: str = "" exclude_entities: str = "IfcOpeningElement" drawing_guid: str = "" + profile_threshold: int = -1 + cells: bool = True def main(settings, files, iterators=None, merge_projection=True, progress_function=DO_NOTHING): @@ -115,6 +117,7 @@ def main(settings, files, iterators=None, merge_projection=True, progress_functi # sane default? sr.setAlwaysProject(True) + sr.setProfileThreshold(settings.profile_threshold) sr.setBoundingRectangle(settings.width, settings.height) sr.setScale(settings.scale) sr.setAutoElevation(settings.auto_elevation) @@ -167,6 +170,9 @@ def main(settings, files, iterators=None, merge_projection=True, progress_functi if not merge_projection: return svg_data_1 + + if not settings.cells: + return svg_data_1.encode("ascii", "xmlcharrefreplace") # Parse SVG into vector of line segments #