SOFA plugin: SofaDistanceGrid  master
Open source framework for multi-physics simuation
sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube Class Reference

#include <DistanceGridCollisionModel.h>

Classes

struct  Point
 

Public Attributes

std::shared_ptr< DistanceGridgrid
 
int elem
 Index of the corresponding element in the topology. More...
 
std::set< int > neighbors
 Index of the neighbors (used for self-collisions) More...
 
type::vector< Pointpoints
 barycentric coordinates of included points More...
 
type::vector< GCoordnormals
 normals in barycentric coordinates of included points More...
 
GCoord initP0
 
GCoord initDP
 
GCoord invDP
 Initial corners position. More...
 
GCoord corners [8]
 Current corners position. More...
 
Plane faces [6]
 planes corresponding to the six faces (FX0,FX1,FY0,FY1,FZ0,FZ1) More...
 
GCoord center
 current center; More...
 
GSReal radius
 radius of enclosing sphere More...
 
type::vector< GCoorddeformedPoints
 deformed points More...
 
type::vector< GCoorddeformedNormals
 deformed normals More...
 
bool pointsUpdated
 true the deformedPoints vector has been updated with the latest positions More...
 
bool facesUpdated
 true the faces plane vector has been updated with the latest positions More...
 
Precomputed deformation factors

We have : deform(b) = C000(1-b[0])(1-b[1])(1-b[2]) + C100(b[0])(1-b[1])(1-b[2]) + C010(1-b[0])(b[1])(1-b[2]) + C110(b[0])(b[1])(1-b[2])

  • C001(1-b[0])(1-b[1])( b[2]) + C101(b[0])(1-b[1])( b[2]) + C011(1-b[0])(b[1])( b[2]) + C111(b[0])(b[1])( b[2]) = C000 + Dx b[0] + Dy b[1] + Dz b[2] + Dxy b[0]b[1] + Dxz b[0]b[2] + dyz b[1]b[2] + dxyz b[0]b[1]b[2]
GCoord Dx
 Dx = -C000+C100. More...
 
GCoord Dy
 Dy = -C000+C010. More...
 
GCoord Dz
 Dx = -C000+C001. More...
 
GCoord Dxy
 Dxy = C000-C100-C010+C110 = C110-C010-Dx. More...
 
GCoord Dxz
 Dxz = C000-C100-C001+C101 = C101-C001-Dx. More...
 
GCoord Dyz
 Dyz = C000-C010-C001+C011 = C011-C001-Dy. More...
 
GCoord Dxyz
 Dxyz = - C000 + C100 + C010 - C110 + C001 - C101 - C011 + C111 = C001 - C101 - C011 + C111 - Dxy. More...
 

Public Member Functions

 DeformedCube ()
 
void updateDeform ()
 Update the deformation precomputed values. More...
 
void updatePoints ()
 Update the deformedPoints position if not done yet (i.e. if pointsUpdated==false) More...
 
void updateFaces ()
 Update the face planes position if not done yet (i.e. if facesUpdated==false) More...
 
DistanceGrid::Coord baryCoords (const GCoord &c) const
 Compute the barycentric coordinates of a point from its initial position. More...
 
GCoord initpos (const GCoord &b) const
 Compute the initial position of a point from its barycentric coordinates. More...
 
GCoord deform (const GCoord &b) const
 Compute the deformed position of a point from its barycentric coordinates. More...
 
GCoord deformDir (const GCoord &b, const GCoord &dir) const
 deform a direction relative to a point in barycentric coordinates More...
 
type::Mat< 3, 3, double > Jdeform (const GCoord &b) const
 Get the local jacobian matrix of the deformation. More...
 
GCoord undeform0 (const GCoord &p) const
 Compute an initial estimate to the barycentric coordinate of a point given its deformed position. More...
 
GCoord undeformDir (const GCoord &b, const GCoord &dir) const
 Undeform a direction relative to a point in barycentric coordinates. More...
 
Plane computePlane (int c00, int c10, int c01, int c11)
 Compute a plane equation given 4 corners. More...
 

Static Public Member Functions

static GSReal interp (GSReal coef, GSReal a, GSReal b)
 

Attribute details

◆ center

GCoord sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::center

current center;

◆ corners

GCoord sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::corners[8]

Current corners position.

◆ deformedNormals

type::vector<GCoord> sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::deformedNormals

deformed normals

◆ deformedPoints

type::vector<GCoord> sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::deformedPoints

deformed points

◆ Dx

GCoord sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::Dx

Dx = -C000+C100.

◆ Dxy

GCoord sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::Dxy

Dxy = C000-C100-C010+C110 = C110-C010-Dx.

◆ Dxyz

GCoord sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::Dxyz

Dxyz = - C000 + C100 + C010 - C110 + C001 - C101 - C011 + C111 = C001 - C101 - C011 + C111 - Dxy.

◆ Dxz

GCoord sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::Dxz

Dxz = C000-C100-C001+C101 = C101-C001-Dx.

◆ Dy

GCoord sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::Dy

Dy = -C000+C010.

◆ Dyz

GCoord sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::Dyz

Dyz = C000-C010-C001+C011 = C011-C001-Dy.

◆ Dz

GCoord sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::Dz

Dx = -C000+C001.

◆ elem

int sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::elem

Index of the corresponding element in the topology.

◆ faces

Plane sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::faces[6]

planes corresponding to the six faces (FX0,FX1,FY0,FY1,FZ0,FZ1)

◆ facesUpdated

bool sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::facesUpdated

true the faces plane vector has been updated with the latest positions

◆ grid

std::shared_ptr<DistanceGrid> sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::grid

◆ initDP

GCoord sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::initDP

◆ initP0

GCoord sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::initP0

◆ invDP

GCoord sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::invDP

Initial corners position.

◆ neighbors

std::set<int> sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::neighbors

Index of the neighbors (used for self-collisions)

◆ normals

type::vector<GCoord> sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::normals

normals in barycentric coordinates of included points

◆ points

type::vector<Point> sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::points

barycentric coordinates of included points

◆ pointsUpdated

bool sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::pointsUpdated

true the deformedPoints vector has been updated with the latest positions

◆ radius

GSReal sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::radius

radius of enclosing sphere

Constructor details

◆ DeformedCube()

sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::DeformedCube ( )
inline

Function details

◆ baryCoords()

DistanceGrid::Coord sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::baryCoords ( const GCoord c) const
inline

Compute the barycentric coordinates of a point from its initial position.

◆ computePlane()

FFDDistanceGridCollisionModel::DeformedCube::Plane sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::computePlane ( int  c00,
int  c10,
int  c01,
int  c11 
)

Compute a plane equation given 4 corners.

◆ deform()

GCoord sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::deform ( const GCoord b) const
inline

Compute the deformed position of a point from its barycentric coordinates.

◆ deformDir()

GCoord sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::deformDir ( const GCoord b,
const GCoord dir 
) const
inline

deform a direction relative to a point in barycentric coordinates

◆ initpos()

GCoord sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::initpos ( const GCoord b) const
inline

Compute the initial position of a point from its barycentric coordinates.

◆ interp()

static GSReal sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::interp ( GSReal  coef,
GSReal  a,
GSReal  b 
)
inlinestatic

◆ Jdeform()

type::Mat<3,3,double> sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::Jdeform ( const GCoord b) const
inline

Get the local jacobian matrix of the deformation.

◆ undeform0()

GCoord sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::undeform0 ( const GCoord p) const
inline

Compute an initial estimate to the barycentric coordinate of a point given its deformed position.

◆ undeformDir()

GCoord sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::undeformDir ( const GCoord b,
const GCoord dir 
) const
inline

Undeform a direction relative to a point in barycentric coordinates.

◆ updateDeform()

void sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::updateDeform ( )

Update the deformation precomputed values.

Update the deformation precomputed values

◆ updateFaces()

void sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::updateFaces ( )

Update the face planes position if not done yet (i.e. if facesUpdated==false)

Update the face planes if not done yet (i.e. if facesUpdated==false)

◆ updatePoints()

void sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::updatePoints ( )

Update the deformedPoints position if not done yet (i.e. if pointsUpdated==false)

Enum details

◆ anonymous enum

anonymous enum
Enumerator
C000 
C100 
C010 
C110 
C001 
C101 
C011 
C111 

◆ anonymous enum

anonymous enum
Enumerator
FX0 
FX1 
FY0 
FY1 
FZ0 
FZ1