From a835bca046f4ddb78438f7f67b779e68e8851284 Mon Sep 17 00:00:00 2001 From: Pierre Anquez Date: Mon, 2 Mar 2026 11:09:51 +0100 Subject: [PATCH] fix(Mesh): ensure CachedPolygons and CachedPolyhedra are not transferrable --- src/geode/mesh/core/solid_mesh.cpp | 10 +++------- src/geode/mesh/core/surface_mesh.cpp | 14 ++++++-------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/geode/mesh/core/solid_mesh.cpp b/src/geode/mesh/core/solid_mesh.cpp index 851902799..7e7c68bc1 100644 --- a/src/geode/mesh/core/solid_mesh.cpp +++ b/src/geode/mesh/core/solid_mesh.cpp @@ -428,13 +428,9 @@ namespace geode .template find_or_create_attribute< VariableAttribute, PolyhedronVertex >( "polyhedron_around_vertex", PolyhedronVertex{}, - { false, false, false } ) ), - polyhedra_around_vertex_( solid.vertex_attribute_manager() - .template find_or_create_attribute< VariableAttribute, - CachedPolyhedra >( POLYHEDRA_AROUND_VERTEX_NAME, - CachedPolyhedra{}, { false, false, false } ) ) { + initialize_polyhedra_around_vertex( solid ); } VerticesAroundVertex vertices_around_vertex( @@ -663,8 +659,8 @@ namespace geode polyhedra_around_vertex_ = solid.vertex_attribute_manager() .template find_or_create_attribute< VariableAttribute, - CachedPolyhedra >( - POLYHEDRA_AROUND_VERTEX_NAME, CachedPolyhedra{} ); + CachedPolyhedra >( POLYHEDRA_AROUND_VERTEX_NAME, + CachedPolyhedra{}, { false, false, false } ); } const internal::PolyhedraAroundVertexImpl& diff --git a/src/geode/mesh/core/surface_mesh.cpp b/src/geode/mesh/core/surface_mesh.cpp index 37f82455f..9c73b953d 100644 --- a/src/geode/mesh/core/surface_mesh.cpp +++ b/src/geode/mesh/core/surface_mesh.cpp @@ -129,7 +129,9 @@ namespace OPENGEODE_ASSERT( mesh.polygon_vertex( cur_polygon_vertex.value() ) == vertex_id, "[SurfaceMesh::polygons_around_vertex] Wrong polygon " - "around vertex" ); + "around vertex ", + vertex_id, " / ", cur_polygon_vertex->string(), " ", + mesh.polygon_vertex( cur_polygon_vertex.value() ) ); result.polygons.push_back( cur_polygon_vertex.value() ); const auto prev_vertex = mesh.previous_polygon_vertex( cur_polygon_vertex.value() ); @@ -255,13 +257,9 @@ namespace geode .template find_or_create_attribute< VariableAttribute, PolygonVertex >( "polygon_around_vertex", PolygonVertex{}, - { false, false, false } ) ), - polygons_around_vertex_( surface.vertex_attribute_manager() - .template find_or_create_attribute< VariableAttribute, - CachedPolygons >( POLYGONS_AROUND_VERTEX_NAME, - CachedPolygons{}, { false, false, false } ) ) { + initialize_polygons_around_vertex( surface ); } VerticesAroundVertex vertices_around_vertex( @@ -403,8 +401,8 @@ namespace geode polygons_around_vertex_ = surface.vertex_attribute_manager() .template find_or_create_attribute< VariableAttribute, - CachedPolygons >( - POLYGONS_AROUND_VERTEX_NAME, CachedPolygons{} ); + CachedPolygons >( POLYGONS_AROUND_VERTEX_NAME, + CachedPolygons{}, { false, false, false } ); } private: