Skip to content

Commit

Permalink
Merge pull request #1049 from Geode-solutions/feat_adding_poly_facet_…
Browse files Browse the repository at this point in the history
…edges_getter

feat(TetrahedralSolid): adding polyhedron_edges() function, to return 6 polyhedron facet edges
  • Loading branch information
MelchiorSchuh authored Nov 25, 2024
2 parents 9008f31 + c955702 commit ec958e3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/geode/mesh/core/tetrahedral_solid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ namespace geode
[[nodiscard]] PolyhedronEdgesVertices polyhedron_edges_vertices(
index_t polyhedron ) const final;

[[nodiscard]] std::array< PolyhedronFacetEdge, 6 > polyhedron_edges(
index_t polyhedron ) const;

[[nodiscard]] PolyhedronFacetsVertices polyhedron_facets_vertices(
index_t polyhedron ) const final;

Expand Down
13 changes: 13 additions & 0 deletions src/geode/mesh/core/tetrahedral_solid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,19 @@ namespace geode
return result;
}

template < index_t dimension >
std::array< PolyhedronFacetEdge, 6 >
TetrahedralSolid< dimension >::polyhedron_edges(
index_t polyhedron ) const
{
return { PolyhedronFacetEdge{ { polyhedron, 0 }, 0 },
PolyhedronFacetEdge{ { polyhedron, 0 }, 1 },
PolyhedronFacetEdge{ { polyhedron, 0 }, 2 },
PolyhedronFacetEdge{ { polyhedron, 1 }, 0 },
PolyhedronFacetEdge{ { polyhedron, 1 }, 2 },
PolyhedronFacetEdge{ { polyhedron, 2 }, 1 } };
}

template < index_t dimension >
PolyhedronFacets TetrahedralSolid< dimension >::polyhedron_vertex_facets(
const PolyhedronVertex& polyhedron_vertex ) const
Expand Down

0 comments on commit ec958e3

Please sign in to comment.