MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / compute_signed_tet_volume

Function compute_signed_tet_volume

src/Attributes/VoxelVolumeAttribute.cpp:14–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12
13namespace VoxelVolumeAttributeHelper {
14 Float compute_signed_tet_volume(
15 const Vector3F& v0, const Vector3F& v1,
16 const Vector3F& v2, const Vector3F& v3) {
17 // Formula: volume = <a x b, c> / 6
18 // where a,b and c are edge vector from a single vertex.
19 // <., .> is inner product.
20 return ((v1 - v0).cross(v2 - v0)).dot(v3 - v0) / 6.0;
21 }
22
23 Float compute_abs_tet_volume(
24 const Vector3F& v0, const Vector3F& v1,

Callers 3

compute_abs_tet_volumeFunction · 0.85
compute_from_meshMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected