Skip to content

Commit 014e793

Browse files
committed
adding elements check to is_meshed
1 parent 437c194 commit 014e793

File tree

5 files changed

+12
-5
lines changed

5 files changed

+12
-5
lines changed

src/geode/inspector/topology/brep_blocks_topology.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,8 @@ namespace geode
182182

183183
bool BRepBlocksTopology::block_is_meshed( const Block3D& block ) const
184184
{
185-
return block.mesh().nb_vertices() != 0;
185+
const auto& block_mesh = block.mesh();
186+
return block_mesh.nb_vertices() != 0 && block_mesh.nb_polyhedra() != 0;
186187
}
187188

188189
bool BRepBlocksTopology::block_vertices_are_associated_to_unique_vertices(

src/geode/inspector/topology/brep_lines_topology.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ namespace geode
141141

142142
bool BRepLinesTopology::line_is_meshed( const Line3D& line ) const
143143
{
144-
return line.mesh().nb_vertices() != 0;
144+
const auto& line_mesh = line.mesh();
145+
return line_mesh.nb_vertices() != 0 && line_mesh.nb_edges() != 0;
145146
}
146147

147148
bool BRepLinesTopology::line_vertices_are_associated_to_unique_vertices(

src/geode/inspector/topology/brep_surfaces_topology.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,9 @@ namespace geode
186186
bool BRepSurfacesTopology::surface_is_meshed(
187187
const Surface3D& surface ) const
188188
{
189-
return surface.mesh().nb_vertices() != 0;
189+
const auto& surface_mesh = surface.mesh();
190+
return surface_mesh.nb_vertices() != 0
191+
&& surface_mesh.nb_polygons() != 0;
190192
}
191193

192194
bool BRepSurfacesTopology::

src/geode/inspector/topology/section_lines_topology.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ namespace geode
142142

143143
bool SectionLinesTopology::line_is_meshed( const Line2D& line ) const
144144
{
145-
return line.mesh().nb_vertices() != 0;
145+
const auto& line_mesh = line.mesh();
146+
return line_mesh.nb_vertices() != 0 && line_mesh.nb_edges() != 0;
146147
}
147148

148149
bool SectionLinesTopology::line_vertices_are_associated_to_unique_vertices(

src/geode/inspector/topology/section_surfaces_topology.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@ namespace geode
120120
bool SectionSurfacesTopology::surface_is_meshed(
121121
const Surface2D& surface ) const
122122
{
123-
return surface.mesh().nb_vertices() != 0;
123+
const auto& surface_mesh = surface.mesh();
124+
return surface_mesh.nb_vertices() != 0
125+
&& surface_mesh.nb_polygons() != 0;
124126
}
125127

126128
bool SectionSurfacesTopology::

0 commit comments

Comments
 (0)