diff --git a/src/ifcgeom/IfcGeomRepresentation.h b/src/ifcgeom/IfcGeomRepresentation.h index f231444996..44a72a1a5e 100644 --- a/src/ifcgeom/IfcGeomRepresentation.h +++ b/src/ifcgeom/IfcGeomRepresentation.h @@ -285,6 +285,8 @@ namespace IfcGeom { GCPnts_QuasiUniformDeflection tessellater(crv, settings().deflection_tolerance()); int n = tessellater.NbPoints(); int start = (int)_verts.size() / 3; + int previous = -1; + for (int i = 1; i <= n; ++i) { gp_XYZ p = tessellater.Value(i).XYZ(); @@ -325,17 +327,18 @@ namespace IfcGeom { _material_ids.push_back(surface_style_id); - _verts.push_back(static_cast

(p.X())); - _verts.push_back(static_cast

(p.Y())); - _verts.push_back(static_cast

(p.Z())); + int current = addVertex(surface_style_id, p); if (i > 1) { - _edges.push_back(start + i - 2); - _edges.push_back(start + i - 1); + _edges.push_back(previous); + _edges.push_back(current); + // _edges.push_back(start + 3 * (i - 2) + 2); // _edges.push_back(start + 3 * (i - 1) + 2); } + previous = current; + // _edges.push_back(start + 3 * (i - 1) + 0); // _edges.push_back(start + 3 * (i - 1) + 2); // _edges.push_back(start + 3 * (i - 1) + 1);