3232#include < geode/mesh/core/solid_mesh.hpp>
3333#include < geode/mesh/core/surface_mesh.hpp>
3434
35+ #include < geode/model/helpers/component_mesh_polygons.hpp>
3536#include < geode/model/mixin/core/block.hpp>
3637#include < geode/model/mixin/core/line.hpp>
3738#include < geode/model/mixin/core/surface.hpp>
@@ -198,14 +199,21 @@ namespace geode
198199 if ( mesh.nb_edges () == 1
199200 && model ().nb_embedding_surfaces ( line ) > 0 )
200201 {
201- std::string message = absl::StrCat (
202- " Model edge between unique unique vertices " ,
203- mesh.edge_vertices ( 0 )[0 ], " and " ,
204- mesh.edge_vertices ( 0 )[1 ],
205- " is not manifold: it belongs to an internal line with "
206- " only one edge" );
207- issues.add_issue (
208- BRepNonManifoldEdge{ mesh.edge_vertices ( 0 ), {} },
202+ std::array< index_t , 2 > edge_unique_vertices;
203+ for ( const auto edge_vertex : LRange{ 2 } )
204+ {
205+ edge_unique_vertices[edge_vertex] =
206+ model ().unique_vertex ( { line.component_id (),
207+ mesh.edge_vertex ( { 0 , edge_vertex } ) } );
208+ }
209+ std::string message =
210+ absl::StrCat ( " Model edge between unique vertices " ,
211+ edge_unique_vertices[0 ], " and " ,
212+ edge_unique_vertices[1 ],
213+ " is not manifold: it belongs to internal line " ,
214+ line.id ().string (), " with only one edge" );
215+ issues.add_issue ( BRepNonManifoldEdge{ edge_unique_vertices,
216+ { line.id () } },
209217 message );
210218 }
211219 }
@@ -220,19 +228,19 @@ namespace geode
220228 if ( mesh.nb_polygons () == 1
221229 && model ().nb_embedding_blocks ( surface ) > 0 )
222230 {
231+ auto facet_vertices =
232+ polygon_unique_vertices ( model (), surface, 0 );
223233 std::string message =
224- absl::StrCat ( " Model facet between unique vertices " ,
225- mesh.polygon_vertices ( 0 )[0 ], " " ,
226- mesh.polygon_vertices ( 0 )[1 ], " and " ,
227- mesh.polygon_vertices ( 0 )[2 ],
228- " is not manifold: it belongs to an internal "
229- " surface with only one facet" );
230- issues.add_issue (
231- BRepNonManifoldFacet{
232- { mesh.polygon_vertices ( 0 )[0 ],
233- mesh.polygon_vertices ( 0 )[1 ],
234- mesh.polygon_vertices ( 0 )[2 ] },
235- {} },
234+ " Model facet between unique vertices " ;
235+ for ( const auto polygon_vertex : facet_vertices )
236+ {
237+ absl::StrAppend ( &message, polygon_vertex, " " );
238+ }
239+ absl::StrAppend ( &message,
240+ " is not manifold: it belongs to an internal "
241+ " surface with only one facet" );
242+ issues.add_issue ( BRepNonManifoldFacet{ facet_vertices,
243+ { surface.id () } },
236244 message );
237245 }
238246 }
0 commit comments