From d53d4a96c9aaf681a0bcd7492a08e9f62e1b9562 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Granskogen=20Bj=C3=B8rnstad?= Date: Thu, 23 Nov 2017 10:28:28 +0100 Subject: [PATCH] SvgSerializer: Add closed circle warning Only refactoring, adding a warning. --- src/ifcconvert/SvgSerializer.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/ifcconvert/SvgSerializer.cpp b/src/ifcconvert/SvgSerializer.cpp index e6bf1b1d70..7e46036597 100644 --- a/src/ifcconvert/SvgSerializer.cpp +++ b/src/ifcconvert/SvgSerializer.cpp @@ -66,14 +66,23 @@ void SvgSerializer::write(path_object& p, const TopoDS_Wire& wire) { bool first = true; util::string_buffer path; - path.add(" DynamicType(); + bool conical = (ty == STANDARD_TYPE(Geom_Circle) || ty == STANDARD_TYPE(Geom_Ellipse)); + bool closed = ALMOST_THE_SAME(u1 + PI2, u2); + if (conical && closed) { + std::stringstream ss; + ss << "Full circles and ellipses currently not supported (id " + << p.first << ")"; + Logger::Warning(ss.str()); + } + + const bool reversed = edge.Orientation() == TopAbs_REVERSED; gp_Pnt p1, p2; curve->D0(u1, p1); @@ -84,6 +93,7 @@ void SvgSerializer::write(path_object& p, const TopoDS_Wire& wire) { } if (first) { + path.add(" DynamicType(); if (ty == STANDARD_TYPE(Geom_Circle) || ty == STANDARD_TYPE(Geom_Ellipse)) { Handle(Geom_Conic) conic = Handle(Geom_Conic)::DownCast(curve);