Submerged volume calculation using polyhedron based on: Exact Buoyancy for Polyhedra by Eric Catto.
More...
#include <polyhedron_volume.hh>
|
struct | Face |
| Store vertex index for a triangular face. More...
|
|
|
static Volume | clipTriangle (const ignition::math::Vector3d &v1, const ignition::math::Vector3d &v2, const ignition::math::Vector3d &v3, double d1, double d2, double d3, const ignition::math::Vector3d &p=ignition::math::Vector3d({0., 0., 0.})) |
| Clips a partially submerged triangle. More...
|
|
static Volume | tetrahedronVolume (const ignition::math::Vector3d &v1, const ignition::math::Vector3d &v2, const ignition::math::Vector3d &v3, const ignition::math::Vector3d &p=ignition::math::Vector3d({0., 0., 0.})) |
| Computes volume and centroid of tetrahedron tetrahedron formed by triangle + arbitrary point. More...
|
|
Submerged volume calculation using polyhedron based on: Exact Buoyancy for Polyhedra by Eric Catto.
Definition at line 58 of file polyhedron_volume.hh.
Volume Polyhedron::clipTriangle |
( |
const ignition::math::Vector3d & |
v1, |
|
|
const ignition::math::Vector3d & |
v2, |
|
|
const ignition::math::Vector3d & |
v3, |
|
|
double |
d1, |
|
|
double |
d2, |
|
|
double |
d3, |
|
|
const ignition::math::Vector3d & |
p = ignition::math::Vector3d({0., 0., 0.}) |
|
) |
| |
|
staticprivate |
Clips a partially submerged triangle.
- Parameters
-
v1 | point on triangle |
v2 | point on triangle |
v3 | point on triangle |
d1 | distance of point v1 to the splitting plane |
d2 | distance of point v2 to the splitting plane |
d3 | distance of point v3 to the splitting plane |
- Returns
- Volume object for clipped tetrahedron
Definition at line 158 of file polyhedron_volume.cc.
Volume Polyhedron::ComputeFullVolume |
( |
| ) |
|
Compute full volume and center of buoyancy of the polyhedron.
- Returns
- Volume object with volume and centroid
Definition at line 143 of file polyhedron_volume.cc.
Polyhedron Polyhedron::makeCube |
( |
double |
x, |
|
|
double |
y, |
|
|
double |
z |
|
) |
| |
|
static |
Generate a cube polyhedron centered at origin.
- Parameters
-
x | length of cube |
y | width of cube |
z | height of cube |
- Returns
- Polyhedron object
Definition at line 50 of file polyhedron_volume.cc.
Polyhedron Polyhedron::makeCylinder |
( |
double |
r, |
|
|
double |
l, |
|
|
int |
n |
|
) |
| |
|
static |
Generate a cylinder polyhedron centered at origin.
- Parameters
-
r | radius of cylinder |
l | length of cylinder |
n | number of segments |
- Returns
- Polyhedron object
Definition at line 84 of file polyhedron_volume.cc.
Volume Polyhedron::SubmergedVolume |
( |
const ignition::math::Vector3d & |
x, |
|
|
const ignition::math::Quaterniond & |
q, |
|
|
Plane & |
plane |
|
) |
| |
Compute submerge volume and center of buoyancy of a polyhedron.
- Parameters
-
x | our position |
q | our orientation (quaternions) |
plane | water surface defined as a plane |
- Returns
- Volume object with volume and centroid (relative to world)
Definition at line 206 of file polyhedron_volume.cc.
Volume Polyhedron::tetrahedronVolume |
( |
const ignition::math::Vector3d & |
v1, |
|
|
const ignition::math::Vector3d & |
v2, |
|
|
const ignition::math::Vector3d & |
v3, |
|
|
const ignition::math::Vector3d & |
p = ignition::math::Vector3d({0., 0., 0.}) |
|
) |
| |
|
staticprivate |
Computes volume and centroid of tetrahedron tetrahedron formed by triangle + arbitrary point.
- Parameters
-
v1 | point on triangle |
v2 | point on triangle |
v3 | point on triangle |
p | arbitrary point |
- Returns
- Volume object with volume and centroid
Definition at line 128 of file polyhedron_volume.cc.
const double buoyancy::Polyhedron::EPSILON = 1e-6 |
|
private |
std::vector<Face> buoyancy::Polyhedron::faces |
|
private |
std::vector<ignition::math::Vector3d> buoyancy::Polyhedron::vertices |
|
private |
The documentation for this class was generated from the following files: