SOFA API  1a4bb3e7
Open source framework for multi-physics simuation
sofa::geometry::Tetrahedron Struct Reference

#include <Tetrahedron.h>

Static Public Attributes

static constexpr sofa::Size NumberOfNodes = 4
 

Public Member Functions

 Tetrahedron ()=delete
 

Static Public Member Functions

template<typename Node , typename T = std::decay_t<decltype(*std::begin(std::declval<Node>()))>, typename = std::enable_if_t<std::is_scalar_v<T>>>
static constexpr auto volume (const Node &n0, const Node &n1, const Node &n2, const Node &n3)
 Compute the volume of a tetrahedron. More...
 

Attribute details

◆ NumberOfNodes

constexpr sofa::Size sofa::geometry::Tetrahedron::NumberOfNodes = 4
staticconstexpr

Constructor details

◆ Tetrahedron()

sofa::geometry::Tetrahedron::Tetrahedron ( )
delete

Function details

◆ volume()

template<typename Node , typename T = std::decay_t<decltype(*std::begin(std::declval<Node>()))>, typename = std::enable_if_t<std::is_scalar_v<T>>>
static constexpr auto sofa::geometry::Tetrahedron::volume ( const Node &  n0,
const Node &  n1,
const Node &  n2,
const Node &  n3 
)
inlinestaticconstexpr

Compute the volume of a tetrahedron.

Remarks
This function is not generic
Template Parameters
Nodea container of the type sofa::type::Vec3 (needed for cross(), dot(), operator-)
Tscalar
Parameters
n0,n1,n2,n3,n4nodes of the tetrahedron
Returns
Volume of the hexahedron (a T scalar)