Classes | Public Member Functions | Static Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
buoyancy::Polyhedron Class Reference

Submerged volume calculation using polyhedron based on: Exact Buoyancy for Polyhedra by Eric Catto. More...

#include <polyhedron_volume.hh>

Classes

struct  Face
 Store vertex index for a triangular face. More...
 

Public Member Functions

Volume ComputeFullVolume ()
 Compute full volume and center of buoyancy of the polyhedron. More...
 
Volume SubmergedVolume (const ignition::math::Vector3d &x, const ignition::math::Quaterniond &q, Plane &plane)
 Compute submerge volume and center of buoyancy of a polyhedron. More...
 

Static Public Member Functions

static Polyhedron makeCube (double x, double y, double z)
 Generate a cube polyhedron centered at origin. More...
 
static Polyhedron makeCylinder (double r, double l, int n)
 Generate a cylinder polyhedron centered at origin. More...
 

Static Private Member Functions

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...
 

Private Attributes

const double EPSILON = 1e-6
 Values below this are zeroed out. More...
 
std::vector< Facefaces
 Object faces. More...
 
std::vector< ignition::math::Vector3d > vertices
 Object vertices. More...
 

Detailed Description

Submerged volume calculation using polyhedron based on: Exact Buoyancy for Polyhedra by Eric Catto.

Definition at line 58 of file polyhedron_volume.hh.

Member Function Documentation

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
v1point on triangle
v2point on triangle
v3point on triangle
d1distance of point v1 to the splitting plane
d2distance of point v2 to the splitting plane
d3distance 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
xlength of cube
ywidth of cube
zheight 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
rradius of cylinder
llength of cylinder
nnumber 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
xour position
qour orientation (quaternions)
planewater 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
v1point on triangle
v2point on triangle
v3point on triangle
parbitrary point
Returns
Volume object with volume and centroid

Definition at line 128 of file polyhedron_volume.cc.

Member Data Documentation

const double buoyancy::Polyhedron::EPSILON = 1e-6
private

Values below this are zeroed out.

Definition at line 139 of file polyhedron_volume.hh.

std::vector<Face> buoyancy::Polyhedron::faces
private

Object faces.

Definition at line 136 of file polyhedron_volume.hh.

std::vector<ignition::math::Vector3d> buoyancy::Polyhedron::vertices
private

Object vertices.

Definition at line 133 of file polyhedron_volume.hh.


The documentation for this class was generated from the following files:


usv_gazebo_plugins
Author(s): Brian Bingham , Carlos Aguero
autogenerated on Thu May 7 2020 03:54:47