diff --git a/src/ifcconvert/SvgSerializer.cpp b/src/ifcconvert/SvgSerializer.cpp index a2998d05b1..c11e1592ce 100644 --- a/src/ifcconvert/SvgSerializer.cpp +++ b/src/ifcconvert/SvgSerializer.cpp @@ -39,6 +39,9 @@ #include #include +#include +#include + #include #include #include @@ -217,6 +220,19 @@ void SvgSerializer::write(path_object& p, const TopoDS_Wire& wire) { xcoords.push_back(path.add(p2.X())); path.add(","); ycoords.push_back(path.add(p2.Y())); + } else if (ty != STANDARD_TYPE(Geom_Line)) { + BRepAdaptor_Curve crv(edge); + GCPnts_QuasiUniformDeflection tessellater(crv, settings().deflection_tolerance()); + // NB: Start at 2: 1-based and skip the first point, assume it coincides with p1. + for (int i = 2; i <= tessellater.NbPoints(); ++i) { + gp_Pnt p = tessellater.Value(i); + path.add(" L"); + xcoords.push_back(path.add(p.X())); + path.add(","); + ycoords.push_back(path.add(p.Y())); + + growBoundingBox(p.X(), p.Y()); + } } else { // Either a Geom_Line or something unimplemented, // drawn as a straight line segment. diff --git a/test/input/cylinders.ifc b/test/input/cylinders.ifc index 2c096de217..f8547ed262 100644 --- a/test/input/cylinders.ifc +++ b/test/input/cylinders.ifc @@ -60,7 +60,7 @@ DATA; #53=IFCCARTESIANPOINT((0.,0.)); #54=IFCDIRECTION((1.,0.)); #55=IFCAXIS2PLACEMENT2D(#53,#54); -#56=IFCCIRCLEPROFILEDEF(.AREA.,'Circle',#55,0.5); +#56=IFCCIRCLEHOLLOWPROFILEDEF(.AREA.,'Circle',#55,0.5,0.1); #57=IFCCARTESIANPOINT((0.,2.,0.)); #58=IFCAXIS2PLACEMENT3D(#57,$,$); #59=IFCDIRECTION((0.,0.,1.)); @@ -76,7 +76,7 @@ DATA; #69=IFCCARTESIANPOINT((0.,0.)); #70=IFCDIRECTION((1.,0.)); #71=IFCAXIS2PLACEMENT2D(#69,#70); -#72=IFCCIRCLEPROFILEDEF(.AREA.,'Circle',#71,0.5); +#72=IFCCIRCLEHOLLOWPROFILEDEF(.AREA.,'Circle',#71,0.5,0.1); #73=IFCCARTESIANPOINT((2.,0.,0.)); #74=IFCAXIS2PLACEMENT3D(#73,$,$); #75=IFCDIRECTION((0.,0.,1.));