Skip to content

Commit cef0933

Browse files
committed
Merge branch 'next' of https://github.com/Geode-solutions/OpenGeode into fix/changing_triangle_flip_check_when_swaping_edge
2 parents 085cd89 + 74fb01f commit cef0933

File tree

3 files changed

+18
-19
lines changed

3 files changed

+18
-19
lines changed

include/geode/mesh/core/solid_mesh.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,8 @@ namespace geode
452452
const PolyhedronFacet& polyhedron_facet ) const;
453453

454454
/*!
455-
* Return the normal of a given PolyhedronFacet.
455+
* Return the normal of a given PolyhedronFacet (in the geode
456+
* convention, it is oriented towards the inside of the polyhedron).
456457
* @param[in] polyhedron_facet Local index of facet in polyhedron.
457458
*/
458459
[[nodiscard]] std::optional< Vector3D > polyhedron_facet_normal(

src/geode/model/helpers/ray_tracing.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ namespace geode
167167
}
168168
throw OpenGeodeException{
169169
"Cannot determine the point is inside the block or not "
170-
"(ambigous intersection with rays)."
170+
"(ambiguous intersection with rays)."
171171
};
172172
}
173173

@@ -185,8 +185,8 @@ namespace geode
185185
}
186186
}
187187
throw OpenGeodeException{
188-
"Cannot determine the point is inside the block or not "
189-
"(ambigous intersection with rays)."
188+
"Cannot determine the point is inside the closed surface 3D or not "
189+
"(ambiguous intersection with rays)."
190190
};
191191
}
192192

@@ -228,8 +228,8 @@ namespace geode
228228
}
229229
}
230230
throw OpenGeodeException{
231-
"Cannot determine the point is inside the surface or not "
232-
"(ambigous intersection with rays)."
231+
"Cannot determine the point is inside the surface 2D or not "
232+
"(ambiguous intersection with rays)."
233233
};
234234
}
235235

src/geode/model/representation/core/brep.cpp

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -891,35 +891,33 @@ namespace geode
891891
BoundingBox3D BRep::bounding_box() const
892892
{
893893
geode::BoundingBox3D bbox;
894+
bool bbox_computed{ false };
894895
if( const auto box = internal::meshes_bounding_box< 3 >( surfaces() ) )
895896
{
896897
bbox.add_box( box.value() );
898+
bbox_computed = true;
897899
}
898900
if( const auto box = internal::meshes_bounding_box< 3 >( lines() ) )
899901
{
900902
bbox.add_box( box.value() );
903+
bbox_computed = true;
901904
}
902905
if( const auto box = internal::meshes_bounding_box< 3 >( corners() ) )
903906
{
904907
bbox.add_box( box.value() );
908+
bbox_computed = true;
905909
}
906-
try
910+
for( const auto& block : blocks() )
907911
{
908-
if( const auto box =
909-
internal::meshes_bounding_box< 3 >( blocks() ) )
912+
const auto& block_mesh = block.mesh();
913+
if( block_mesh.nb_vertices() == 0 )
910914
{
911-
bbox.add_box( box.value() );
915+
continue;
912916
}
917+
bbox.add_box( block_mesh.bounding_box() );
918+
bbox_computed = true;
913919
}
914-
catch( const OpenGeodeException& )
915-
{
916-
OPENGEODE_EXCEPTION(
917-
nb_corners() > 0 || nb_lines() > 0 || nb_surfaces() > 0,
918-
"[BRep::bounding_box] Cannot return the bounding_box of a BRep "
919-
"with not meshes Blocks and no Corners, no Lines and no "
920-
"Surfaces." );
921-
}
922-
OPENGEODE_EXCEPTION( bbox.min() <= bbox.max(),
920+
OPENGEODE_EXCEPTION( bbox_computed && bbox.min() <= bbox.max(),
923921
"[BRep::bounding_box] Cannot return the "
924922
"bounding_box of an empty BRep." );
925923
return bbox;

0 commit comments

Comments
 (0)