mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 14:41:25 +00:00
Remove implemented throws, add faces and materials
This commit is contained in:
@@ -6,9 +6,9 @@ void IfcGeom::CgalShape::Triangulate(const IfcGeom::IteratorSettings & settings,
|
|||||||
const cgal_placement_t& trsf = dynamic_cast<const CgalPlacement*>(place)->trsf();
|
const cgal_placement_t& trsf = dynamic_cast<const CgalPlacement*>(place)->trsf();
|
||||||
|
|
||||||
// Apply transformation
|
// Apply transformation
|
||||||
for (auto &vertex: vertices(s)) {
|
// for (auto &vertex: vertices(s)) {
|
||||||
vertex->point() = vertex->point().transform(trsf);
|
// vertex->point() = vertex->point().transform(trsf);
|
||||||
}
|
// }
|
||||||
|
|
||||||
// Triangulate the shape and compute the normals
|
// Triangulate the shape and compute the normals
|
||||||
std::map<cgal_vertex_descriptor_t, Kernel::Vector_3> vertex_normals;
|
std::map<cgal_vertex_descriptor_t, Kernel::Vector_3> vertex_normals;
|
||||||
@@ -36,11 +36,11 @@ void IfcGeom::CgalShape::Triangulate(const IfcGeom::IteratorSettings & settings,
|
|||||||
CGAL::to_double(current_halfedge->vertex()->point().cartesian(1)),
|
CGAL::to_double(current_halfedge->vertex()->point().cartesian(1)),
|
||||||
CGAL::to_double(current_halfedge->vertex()->point().cartesian(2)));
|
CGAL::to_double(current_halfedge->vertex()->point().cartesian(2)));
|
||||||
for (int i = 0; i < 3; ++i) t->normals().push_back(CGAL::to_double(face_normals_map[face].cartesian(i)));
|
for (int i = 0; i < 3; ++i) t->normals().push_back(CGAL::to_double(face_normals_map[face].cartesian(i)));
|
||||||
// t->faces().push_back(num_vertices);
|
t->faces().push_back(num_vertices);
|
||||||
++num_vertices;
|
++num_vertices;
|
||||||
++current_halfedge;
|
++current_halfedge;
|
||||||
} while (current_halfedge != face->facet_begin());
|
} while (current_halfedge != face->facet_begin());
|
||||||
// t->material_ids().push_back(surface_style_id);
|
t->material_ids().push_back(surface_style_id);
|
||||||
++num_faces;
|
++num_faces;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,12 +40,10 @@ namespace IfcGeom {
|
|||||||
virtual void Multiply(const ConversionResultPlacement* other) {
|
virtual void Multiply(const ConversionResultPlacement* other) {
|
||||||
// TODO: Check
|
// TODO: Check
|
||||||
trsf_ = ((CgalPlacement *)other)->trsf_ * trsf_;
|
trsf_ = ((CgalPlacement *)other)->trsf_ * trsf_;
|
||||||
throw std::runtime_error("Not implemented");
|
|
||||||
}
|
}
|
||||||
virtual void PreMultiply(const ConversionResultPlacement* other) {
|
virtual void PreMultiply(const ConversionResultPlacement* other) {
|
||||||
// TODO: Check
|
// TODO: Check
|
||||||
trsf_ = trsf_ * ((CgalPlacement *)other)->trsf_;
|
trsf_ = trsf_ * ((CgalPlacement *)other)->trsf_;
|
||||||
throw std::runtime_error("Not implemented");
|
|
||||||
}
|
}
|
||||||
virtual ConversionResultPlacement* clone() const {
|
virtual ConversionResultPlacement* clone() const {
|
||||||
return new CgalPlacement(trsf_);
|
return new CgalPlacement(trsf_);
|
||||||
|
|||||||
Reference in New Issue
Block a user