@@ -270,7 +270,7 @@ bitflags::bitflags! {
270270 ///
271271 /// This is achieved by taking into account adjacent triangle normals when computing contact
272272 /// points for a given triangle.
273- const FIX_INTERNAL_EDGES = ( 1 << 7 ) | Self :: ORIENTED . bits ( ) | Self :: MERGE_DUPLICATE_VERTICES . bits( ) ;
273+ const FIX_INTERNAL_EDGES = ( 1 << 7 ) | Self :: MERGE_DUPLICATE_VERTICES . bits( ) ;
274274 }
275275}
276276
@@ -350,7 +350,7 @@ impl TriMesh {
350350 }
351351
352352 #[ cfg( feature = "dim3" ) ]
353- if !flags. contains ( TriMeshFlags :: ORIENTED ) {
353+ if !flags. intersects ( TriMeshFlags :: ORIENTED | TriMeshFlags :: FIX_INTERNAL_EDGES ) {
354354 self . pseudo_normals = None ;
355355 }
356356
@@ -384,7 +384,7 @@ impl TriMesh {
384384 }
385385
386386 #[ cfg( feature = "dim3" ) ]
387- if difference. contains ( TriMeshFlags :: ORIENTED ) {
387+ if difference. intersects ( TriMeshFlags :: ORIENTED | TriMeshFlags :: FIX_INTERNAL_EDGES ) {
388388 self . compute_pseudo_normals ( ) ;
389389 }
390390
@@ -1064,6 +1064,17 @@ impl TriMesh {
10641064 pub fn pseudo_normals ( & self ) -> Option < & TriMeshPseudoNormals > {
10651065 self . pseudo_normals . as_ref ( )
10661066 }
1067+
1068+ /// The pseudo-normals of this triangle mesh, if they have been computed **and** this mesh was
1069+ /// marked as [`TriMeshFlags::ORIENTED`].
1070+ #[ cfg( feature = "dim3" ) ]
1071+ pub fn pseudo_normals_if_oriented ( & self ) -> Option < & TriMeshPseudoNormals > {
1072+ if self . flags . intersects ( TriMeshFlags :: ORIENTED ) {
1073+ self . pseudo_normals . as_ref ( )
1074+ } else {
1075+ None
1076+ }
1077+ }
10671078}
10681079
10691080#[ cfg( feature = "dim3" ) ]
0 commit comments