Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/geode/geometry/bounding_box.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ namespace geode
[[nodiscard]] std::tuple< local_index_t, double >
largest_length() const;

[[nodiscard]] double n_volume() const;

[[nodiscard]] std::string string() const;

private:
Expand Down
12 changes: 12 additions & 0 deletions src/geode/geometry/bounding_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,18 @@ namespace geode
return -inner_distance;
}

template < index_t dimension >
double BoundingBox< dimension >::n_volume() const
{
double volume{ 1.0 };
const auto box_extent = diagonal();
for( const auto c : geode::LRange{ dimension } )
{
volume *= ( box_extent.value( c ) );
}
return volume;
}

template < index_t dimension >
std::string BoundingBox< dimension >::string() const
{
Expand Down