From ecba1c3e7b5a3480974c31454787775b4c858a3b Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Fri, 18 Oct 2024 10:37:44 +0200 Subject: [PATCH] Fix for UVs in python binding #5592 --- src/ifcgeom/IfcGeomRepresentation.h | 2 +- src/ifcgeom/kernels/opencascade/OpenCascadeConversionResult.cpp | 2 +- src/ifcwrap/IfcGeomWrapper.i | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ifcgeom/IfcGeomRepresentation.h b/src/ifcgeom/IfcGeomRepresentation.h index 23c3398c96..8f95547de2 100644 --- a/src/ifcgeom/IfcGeomRepresentation.h +++ b/src/ifcgeom/IfcGeomRepresentation.h @@ -133,8 +133,8 @@ namespace IfcGeom { const std::vector>>& polyhedral_faces_with_holes() const { return polyhedral_faces_with_holes_; } const std::vector& edges() const { return edges_; } const std::vector& normals() const { return normals_; } - std::vector& uvs() { return uvs_; } const std::vector& uvs() const { return uvs_; } + std::vector& uvs_ref() { return uvs_; } const std::vector& material_ids() const { return material_ids_; } const std::vector& materials() const { return materials_; } const std::vector& item_ids() const { return item_ids_; } diff --git a/src/ifcgeom/kernels/opencascade/OpenCascadeConversionResult.cpp b/src/ifcgeom/kernels/opencascade/OpenCascadeConversionResult.cpp index 1ad19f529c..32f90904a1 100644 --- a/src/ifcgeom/kernels/opencascade/OpenCascadeConversionResult.cpp +++ b/src/ifcgeom/kernels/opencascade/OpenCascadeConversionResult.cpp @@ -218,7 +218,7 @@ void ifcopenshell::geometry::OpenCascadeShape::Triangulate(ifcopenshell::geometr } if (!t->normals().empty() && settings.get().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) { diff --git a/src/ifcwrap/IfcGeomWrapper.i b/src/ifcwrap/IfcGeomWrapper.i index 9ef6bc5ae4..93c8344e7c 100644 --- a/src/ifcwrap/IfcGeomWrapper.i +++ b/src/ifcwrap/IfcGeomWrapper.i @@ -703,6 +703,7 @@ struct ShapeRTTI : public boost::static_visitor verts = property(verts) normals = property(normals) item_ids = property(item_ids) + uvs = property(uvs) faces_buffer = property(faces_buffer) edges_buffer = property(edges_buffer)