@@ -85,30 +85,18 @@ namespace geode
8585 template < typename PointType >
8686 bool GenericTetrahedron< PointType >::is_degenerated() const
8787 {
88- for ( const auto [vertex0, vertex1, vertex2] : tetrahedron_facet_vertex )
88+ const Point3D& point0 = vertices_.at ( 0 );
89+ const Point3D& point1 = vertices_.at ( 1 );
90+ const Point3D& point2 = vertices_.at ( 2 );
91+ const Triangle3D triangle{ point0, point1, point2 };
92+ if ( triangle.is_degenerated () )
8993 {
90- const Point3D& point0 = vertices_.at ( vertex0 );
91- const Point3D& point1 = vertices_.at ( vertex1 );
92- const Point3D& point2 = vertices_.at ( vertex2 );
93- const Triangle3D triangle{ point0, point1, point2 };
94- if ( triangle.is_degenerated () )
95- {
96- return true ;
97- }
98- for ( const auto vertex3 : LRange{ 4 } )
99- {
100- if ( vertex3 == vertex0 || vertex3 == vertex1
101- || vertex3 == vertex2 )
102- {
103- continue ;
104- }
105- const Point3D& point3 = vertices_.at ( vertex3 );
106- return std::get< 0 >(
107- point_plane_distance ( point3, Plane{ triangle } ) )
108- <= GLOBAL_EPSILON;
109- }
94+ return true ;
11095 }
111- return true ;
96+ const Point3D& point3 = vertices_.at ( 3 );
97+ return std::get< 0 >(
98+ point_plane_distance ( point3, Plane{ triangle } ) )
99+ <= GLOBAL_EPSILON;
112100 }
113101
114102 OwnerTetrahedron::OwnerTetrahedron ( Point3D point0,
0 commit comments