Fix for UVs in python binding #5592

This commit is contained in:
Thomas Krijnen
2024-10-18 10:37:44 +02:00
parent 5837a143da
commit ecba1c3e7b
3 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -133,8 +133,8 @@ namespace IfcGeom {
const std::vector<std::vector<std::vector<int>>>& polyhedral_faces_with_holes() const { return polyhedral_faces_with_holes_; }
const std::vector<int>& edges() const { return edges_; }
const std::vector<double>& normals() const { return normals_; }
std::vector<double>& uvs() { return uvs_; }
const std::vector<double>& uvs() const { return uvs_; }
std::vector<double>& uvs_ref() { return uvs_; }
const std::vector<int>& material_ids() const { return material_ids_; }
const std::vector<ifcopenshell::geometry::taxonomy::style::ptr>& materials() const { return materials_; }
const std::vector<int>& item_ids() const { return item_ids_; }
@@ -218,7 +218,7 @@ void ifcopenshell::geometry::OpenCascadeShape::Triangulate(ifcopenshell::geometr
}
if (!t->normals().empty() && settings.get<settings::GenerateUvs>().get()) {
t->uvs() = IfcGeom::Representation::Triangulation::box_project_uvs(t->verts(), t->normals());
t->uvs_ref() = IfcGeom::Representation::Triangulation::box_project_uvs(t->verts(), t->normals());
}
if (num_faces == 0) {
+1
View File
@@ -703,6 +703,7 @@ struct ShapeRTTI : public boost::static_visitor<PyObject*>
verts = property(verts)
normals = property(normals)
item_ids = property(item_ids)
uvs = property(uvs)
faces_buffer = property(faces_buffer)
edges_buffer = property(edges_buffer)