Several more classes, needs testing

This commit is contained in:
Ken Arroyo Ohori
2017-03-02 17:11:58 -06:00
parent 2cb53a860d
commit c9633273a6
6 changed files with 91 additions and 1 deletions
+19 -1
View File
@@ -18,7 +18,7 @@ bool IfcGeom::CgalKernel::convert(const IfcSchema::IfcPolyLoop* l, cgal_wire_t&
return false;
}
// TODO: Remove repeated points (and points that are too close to one another?)
// TODO: Remove repeated points and points that are too close to one another
// remove_duplicate_points_from_loop(polygon, true);
std::size_t count = polygon.size();
@@ -41,3 +41,21 @@ bool IfcGeom::CgalKernel::convert(const IfcSchema::IfcPolyLoop* l, cgal_wire_t&
return true;
}
bool IfcGeom::CgalKernel::convert(const IfcSchema::IfcPolyline* l, cgal_wire_t& result) {
IfcSchema::IfcCartesianPoint::list::ptr points = l->Points();
// Parse and store the points in a sequence
cgal_wire_t polygon = std::vector<Kernel::Point_3>();
for(IfcSchema::IfcCartesianPoint::list::it it = points->begin(); it != points->end(); ++ it) {
cgal_point_t pnt;
IfcGeom::CgalKernel::convert(*it, pnt);
polygon.push_back(pnt);
}
// TODO: Remove points that are too close to one another
// remove_duplicate_points_from_loop(polygon, false);
result = polygon;
return true;
}