Skip to content

Commit edad3ea

Browse files
committed
fix(TetrahedralSolid): adding function to get polyhedron facet triangle (with geometrical points).
1 parent 718a4af commit edad3ea

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

include/geode/mesh/core/tetrahedral_solid.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ namespace geode
7373
[[nodiscard]] PolyhedronFacetsVertices polyhedron_facets_vertices(
7474
index_t polyhedron ) const final;
7575

76+
[[nodiscard]] Triangle< dimension > polyhedron_facet_triangle(
77+
const PolyhedronFacet facet ) const;
78+
7679
[[nodiscard]] typename SolidMesh< dimension >::VerticesAroundVertex
7780
vertices_around_vertex( index_t vertex_id ) const final;
7881

src/geode/mesh/core/tetrahedral_solid.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,16 @@ namespace geode
449449
return result;
450450
}
451451

452+
template < index_t dimension >
453+
Triangle< dimension >
454+
TetrahedralSolid< dimension >::polyhedron_facet_triangle(
455+
const PolyhedronFacet facet ) const
456+
{
457+
const auto vertices = this->polyhedron_facet_vertices( facet );
458+
return { this->point( vertices[0] ), this->point( vertices[1] ),
459+
this->point( vertices[2] ) };
460+
}
461+
452462
template < index_t dimension >
453463
std::optional< PolyhedronFacet >
454464
TetrahedralSolid< dimension >::polyhedron_adjacent_facet(

0 commit comments

Comments
 (0)