From 585821d763b507fd1aee014ecb9cf7625cc12919 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Wed, 6 Nov 2024 09:15:59 +0100 Subject: [PATCH] Update wrapper for svgfill::arrange_polygons() --- src/ifcwrap/IfcGeomWrapper.i | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/ifcwrap/IfcGeomWrapper.i b/src/ifcwrap/IfcGeomWrapper.i index 93c8344e7c..d80bfd33ef 100644 --- a/src/ifcwrap/IfcGeomWrapper.i +++ b/src/ifcwrap/IfcGeomWrapper.i @@ -1121,6 +1121,8 @@ ifcopenshell::geometry::taxonomy::item::ptr try_upcast(PyObject* obj0, swig_type %ignore prefiltered_hlr; %ignore svgfill::svg_to_line_segments; %ignore svgfill::line_segments_to_polygons; +%ignore svgfill::svg_to_polygons; +%ignore svgfill::arrange_polygons; %template(svg_line_segments) std::vector>; %template(svg_groups_of_line_segments) std::vector>>; @@ -1228,8 +1230,26 @@ ifcopenshell::geometry::taxonomy::item::ptr try_upcast(PyObject* obj0, swig_type std::vector> r; if (svgfill::line_segments_to_polygons(s, eps, segments, r)) { return r; + } else { + throw std::runtime_error("Failed process line segments"); + } + } + + std::vector svg_to_polygons(const std::string& data, const boost::optional& class_name) { + std::vector r; + if (svgfill::svg_to_polygons(data, class_name, r)) { + return r; } else { throw std::runtime_error("Failed to read SVG"); + } + } + + std::vector arrange_polygons(const std::vector& polygons) { + std::vector r; + if (svgfill::arrange_polygons(polygons, r)) { + return r; + } else { + throw std::runtime_error("Failed to arrange polygons"); } } %}