This commit is contained in:
2018-04-04 09:45:49 +02:00
25 changed files with 620 additions and 93 deletions

View File

@@ -631,14 +631,11 @@ namespace NM {
Floorplan::Polygon2 res;
std::vector<Point2> src;
Ray3D::Obstacle3D obs = Ray3D::OBJPool::get().getObject(obj->file).rotated_deg(obj->rot).translated(obj->pos);
for (const Triangle3& tria : obs.triangles) {
src.push_back(tria.p1.xy());
src.push_back(tria.p2.xy());
src.push_back(tria.p3.xy());
}
res.points = ConvexHull2::get(src);
// fetch object from pool
const Ray3D::Obstacle3D obs = Ray3D::OBJPool::get().getObject(obj->file).rotated_deg(obj->rot).translated(obj->pos);
// construct 2D convex hull
res.points = ConvexHull2::get(obs.getPoints2D());
return res;
}