AGX Dynamics 2.42.1.1
Loading...
Searching...
No Matches
agxModel::DeformableObject Class Reference

Deformable object containing a tetrahedron mesh and a set of algorithms. More...

#include <DeformableObject.h>

+ Inheritance diagram for agxModel::DeformableObject:

Classes

struct  BoxType
 Six tetrahedron mesh box type overload. More...
 
struct  CapsuleType
 Capsule tetrahedron mesh type overload. More...
 
struct  ConeType
 Cone tetrahedron mesh type overload. More...
 
struct  ConvexMeshType
 Generic convex mesh type overload. More...
 
struct  CylinderType
 Cylindrical tetrahedron mesh type overload. More...
 
struct  RectangularBeamType
 Rectangular beam model type overload. More...
 
struct  SphereType
 Spherical tetrahedron mesh type overload. More...
 
struct  SurfaceType
 Surface model type overload. More...
 
struct  TetGenType
 TetGen mesh type overload. More...
 
struct  TetrahedronType
 Single tetrahedron type overload. More...
 

Public Types

using SingleTetrahedronPositions = std::array< agx::Vec3, 4u >
 
- Public Types inherited from agxSDK::Assembly
enum  Type { ASSEMBLY , COLLECTION }
 Specifies the type an assembly is. More...
 

Public Member Functions

 DeformableObject (BeamModelProperties *properties=nullptr, agx::Real vertexMergeDistance=DefaultVertexMergeDistance)
 Construct given properties.
 
bool add (IDeformableAlgorithm *algorithm)
 Associate a deformable algorithm to this deformable object.
 
virtual void addGroup (agx::UInt32 id)
 Add group id to this deformable object.
 
virtual void addGroup (const agx::Name &name)
 Add group name to this deformable object.
 
virtual agx::Vec2Vector calculateSurfaceTextureCoordinates2D () const
 Calculates the texture coordinates u, v <-> [0, 1] for each surface vertex using object space box/planar mapping.
 
virtual agx::Vec3Vector calculateSurfaceTextureCoordinates3D () const
 Calculates the texture coordinates u, v, w <-> [0, 1] for each surface vertex.
 
DVertexElement findClosestSurfaceVertex (const agx::Vec3 &worldPoint, bool viaEdge=false) const
 Linear search through all surface vertices of this deformable object to find the closest surface vertex to the given world point.
 
DVertexElement findClosestVertex (const agx::Vec3 &worldPoint, bool viaEdge=false) const
 Linear search through all vertices of this deformable object to find the closest vertex to the given world point.
 
template<typename T >
T * getAlgorithm () const
 
IDeformableAlgorithmgetAlgorithm (const agx::Name &name) const
 Finds the algorithm by its name.
 
agx::Vec3 getCmPosition () const
 Calculates, and returns the current center of mass of this deformable.
 
agx::Real getCurrentVolume () const
 
virtual agx::UInt32 getDisabledCollisionGroupId () const
 
virtual bool getEnableCollisions (const agx::RigidBody *rb) const
 
virtual bool getEnableCollisions (const agxCollide::Geometry *geometry) const
 
agx::Real getMass () const
 
virtual agx::MaterialgetMaterial () const
 
DTetrahedronMeshgetMesh ()
 
const DTetrahedronMeshgetMesh () const
 
BeamModelPropertiesgetProperties () const
 
DeformableObjectReferenceDataRef getReferenceData () const
 Objects (e.g., bodies, geometries) of this deformable should be associated to this instance via this data.
 
agx::Real getRestVolume () const
 
virtual agx::UInt32 getUniqueId () const
 
virtual bool hasGroup (agx::UInt32 id) const
 
virtual bool hasGroup (const agx::Name &name) const
 
virtual bool initialize ()
 Initialize all elements of this deformable object given the mesh is valid.
 
bool isInitialized () const
 
bool remove (IDeformableAlgorithm *algorithm)
 Remove a deformable algorithm from this deformable object.
 
virtual void removeGroup (agx::UInt32 id)
 Remove group id from this deformable object.
 
virtual void removeGroup (const agx::Name &name)
 Remove group name from this deformable object.
 
virtual void setEnableCollisions (agx::RigidBody *rb, bool enable)
 Enable/disable collisions between the rigid body and this deformable object.
 
virtual void setEnableCollisions (agxCollide::Geometry *geometry, bool enable)
 Enable/disable collisions between the geometry and this deformable object.
 
virtual void setMaterial (agx::Material *material)
 Assign new material to this deformable object.
 
void setRigidVelocity (const agx::Vec3 &linearVelocity, const agx::Vec3 &angularVelocity)
 Calculates individual vertex velocities given input rigid linear- and angular velocity.
 
- Public Member Functions inherited from agxSDK::DeformableObjectInstance
 AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE (agxSDK::DeformableObjectInstance)
 
virtual void onLastStep ()=0
 On last step event.
 
virtual void onPostStep ()=0
 On post step event, before user event.
 
virtual void onPreCollideStep ()=0
 On pre-collide step event, after user event, before collision detection.
 
virtual void onPreStep ()=0
 On pre step event, after user event, before solver.
 
- Public Member Functions inherited from agxSDK::Assembly
 Assembly ()
 Default constructor.
 
bool add (agx::Constraint *constraint)
 Add a constraint to the assembly.
 
bool add (agx::ContactMaterial *contactMaterial)
 Add a contact material to this assembly.
 
bool add (agx::Emitter *emitter)
 Add an emitter to this assembly.
 
bool add (agx::Interaction *interaction)
 Add an interaction to this assembly.
 
bool add (agx::MergedBody *mergedBody)
 Add a MergedBody to this assembly.
 
bool add (agx::ObserverFrame *observerFrame)
 Add an ObserverFrame to this assembly.
 
bool add (agx::RigidBody *body)
 Add a rigid body to the assembly.
 
bool add (agxCollide::Geometry *geometry)
 Add a geometry to the assembly.
 
bool add (agxSDK::EventListener *listener)
 Add a listener to the assembly.
 
bool add (agxSDK::TerrainInstance *terrainInstance)
 Add a TerrainInstance to this assembly.
 
bool add (agxSDK::TerrainToolInstance *toolInstance)
 Add a TerrainToolInstance to this assembly.
 
bool add (agxStream::Serializable *object)
 Add an object of type serialized.
 
bool add (Assembly *assembly)
 Add another assembly as child to this assembly.
 
virtual void addNotification (agxSDK::Simulation *)
 Called when this assembly is added to a simulation (given that it not already is in the simulation).
 
virtual void addNotification (Assembly *)
 Called when this assembly is added to another assembly.
 
 AGXSTREAM_DECLARE_SERIALIZABLE_BASE (agxSDK::Assembly)
 
size_t collect (agx::ConstraintRefVector &result, bool recursive=true)
 
size_t collect (agx::EmitterRefVector &result, bool recursive=true)
 
size_t collect (agx::InteractionRefVector &result, bool recursive=true)
 
size_t collect (agx::MergedBodyRefVector &result, bool recursive=true)
 
size_t collect (agx::ObserverFrameRefVector &result, bool recursive=true)
 
size_t collect (agx::ParticleSystemRefVector &result, bool recursive=true)
 
size_t collect (agx::RigidBodyRefVector &result, bool recursive=true)
 
size_t collect (agxCollide::GeometryRefVector &result, bool recursive=true)
 
size_t collect (agxSDK::AssemblyRefVector &result, bool recursive=true)
 
size_t collect (agxSDK::EventListenerRefVector &result, bool recursive=true)
 
size_t collect (agxSDK::TerrainInstanceRefVector &result, bool recursive=true)
 
size_t collect (agxSDK::TerrainToolInstanceRefVector &result, bool recursive=true)
 
bool empty () const
 
const AssemblyRefSetVectorgetAssemblies () const
 
agxSDK::AssemblygetAssembly (const agx::Name &name, bool recursive=true)
 Find (linear search) and return named Assembly.
 
const agxSDK::AssemblygetAssembly (const agx::Name &name, bool recursive=true) const
 Find (linear search) and return named Assembly.
 
agxSDK::AssemblygetAssembly (const agx::Uuid &uuid, bool recursive=true)
 Find (linear search) and return an Assembly matching the given uuid.
 
const agxSDK::AssemblygetAssembly (const agx::Uuid &uuid, bool recursive=true) const
 Find (linear search) and return an Assembly matching the given uuid.
 
agx::ConstraintgetConstraint (const agx::Name &name, bool recursive=true)
 Find (linear search) and return named Constraint.
 
template<typename T >
T * getConstraint (const agx::Name &name, bool recursive=true)
 Find and return named Constraint of a template type, for example Hinge:
 
const agx::ConstraintgetConstraint (const agx::Name &name, bool recursive=true) const
 Find (linear search) and return named Constraint.
 
template<typename T >
const T * getConstraint (const agx::Name &name, bool recursive=true) const
 Find and return named Constraint of a template type, for example Hinge:
 
agx::ConstraintgetConstraint (const agx::Uuid &uuid, bool recursive=true)
 Find and return a pointer to a Constraint with the given uuid.
 
const agx::ConstraintgetConstraint (const agx::Uuid &uuid, bool recursive=true) const
 Find (linear search) and return a pointer to a Constraint with the given uuid.
 
agx::Constraint1DOFgetConstraint1DOF (const agx::Name &name, bool recursive=true)
 
agx::Constraint2DOFgetConstraint2DOF (const agx::Name &name, bool recursive=true)
 
const agx::ConstraintRefSetVectorgetConstraints () const
 
const agx::EmitterRefSetVectorgetEmitters () const
 
const EventListenerRefSetVectorgetEventListeners () const
 
virtual agx::FramegetFrame ()
 Return a reference to the frame containing transformation and velocity information for this assembly.
 
virtual const agx::FramegetFrame () const
 
const agxCollide::GeometryRefSetVectorgetGeometries () const
 
agxCollide::GeometrygetGeometry (const agx::Name &name, bool recursive=true)
 Find (linear search) and return named collision Geometry.
 
const agxCollide::GeometrygetGeometry (const agx::Name &name, bool recursive=true) const
 Find (linear search) and return named collision Geometry.
 
agxCollide::GeometrygetGeometry (const agx::Uuid &uuid, bool recursive=true)
 Find (linear search) and return a Geometry matching the given uuid.
 
const agxCollide::GeometrygetGeometry (const agx::Uuid &uuid, bool recursive=true) const
 Find (linear search) and return a Geometry matching the given uuid.
 
const agx::InteractionRefSetVectorgetInteractions () const
 
agx::Vec3 getLocalPosition () const
 
agx::Quat getLocalRotation () const
 
const agx::AffineMatrix4x4getLocalTransform () const
 
const agx::MergedBodyRefSetVectorgetMergedBodies () const
 
agx::MergedBodygetMergedBody (const agx::Uuid &uuid, bool recursive=true)
 Find (linear search) and return an MergedBody matching the given uuid.
 
const agx::MergedBodygetMergedBody (const agx::Uuid &uuid, bool recursive=true) const
 Find (linear search) and return an MergedBody matching the given uuid.
 
agx::Name getName () const
 
agx::ObserverFramegetObserverFrame (const agx::Name &name, bool recursive=true)
 Find (linear search) and return an ObserverFrame matching the given uuid.
 
const agx::ObserverFramegetObserverFrame (const agx::Name &name, bool recursive=true) const
 Find (linear search) and return an ObserverFrame matching the given uuid.
 
agx::ObserverFramegetObserverFrame (const agx::Uuid &uuid, bool recursive=true)
 Find (linear search) and return an ObserverFrame matching the given uuid.
 
const agx::ObserverFramegetObserverFrame (const agx::Uuid &uuid, bool recursive=true) const
 Find (linear search) and return an ObserverFrame matching the given uuid.
 
const agx::ObserverFrameRefSetVectorgetObserverFrames () const
 
AssemblygetParent ()
 
const AssemblygetParent () const
 
agx::FramegetParentFrame ()
 
const agx::FramegetParentFrame () const
 
const agx::ParticleSystemRefSetVectorgetParticleSystems () const
 
const agx::RigidBodyRefSetVectorgetRigidBodies () const
 
agx::RigidBodygetRigidBody (const agx::Name &name, bool recursive=true)
 Find (linear search) and return named RigidBody.
 
const agx::RigidBodygetRigidBody (const agx::Name &name, bool recursive=true) const
 Find (linear search) and return named RigidBody.
 
agx::RigidBodygetRigidBody (const agx::Uuid &uuid, bool recursive=true)
 Find (linear search) and return a pointer to a RigidBody with the given uuid.
 
const agx::RigidBodygetRigidBody (const agx::Uuid &uuid, bool recursive=true) const
 Find (linear search) and return a pointer to a RigidBody with the given uuid.
 
agxSDK::SimulationgetSimulation ()
 
const agxSDK::SimulationgetSimulation () const
 
agxSDK::TerrainInstancegetTerrainInstance (const agx::Uuid &uuid, bool recursive=true)
 Find (linear search) and return an TerrainInstance matching the given uuid.
 
const agxSDK::TerrainInstancegetTerrainInstance (const agx::Uuid &uuid, bool recursive=true) const
 Find (linear search) and return an TerrainInstance matching the given uuid.
 
const agxSDK::TerrainInstanceRefSetVectorgetTerrainInstances () const
 
agxSDK::TerrainToolInstancegetTerrainToolInstance (const agx::Uuid &uuid, bool recursive=true)
 Find (linear search) and return an TerrainToolInstance matching the given uuid.
 
const agxSDK::TerrainToolInstancegetTerrainToolInstance (const agx::Uuid &uuid, bool recursive=true) const
 Find (linear search) and return an TerrainToolInstance matching the given uuid.
 
const agxSDK::TerrainToolInstanceRefSetVectorgetTerrainToolInstances () const
 
Type getType () const
 
bool remove (agx::Constraint *constraint)
 Remove a constraint from this assembly (does not recurse down in tree).
 
bool remove (agx::ContactMaterial *contactMaterial)
 Remove a contact material from this assembly.
 
bool remove (agx::Emitter *emitter)
 Remove an emitter from this assembly.
 
bool remove (agx::Interaction *interaction)
 Remove an interaction from this assembly.
 
bool remove (agx::MergedBody *mergedBody)
 Remove a MergedBody from this assembly.
 
bool remove (agx::ObserverFrame *observerFrame, bool resetParentFrame=true)
 Remove an ObserverFrame from this assembly.
 
bool remove (agx::RigidBody *body, bool removeAssociatedGeometries=false, bool resetParentFrame=true)
 Remove a rigid body from this assembly (does not recurse down in tree).
 
bool remove (agxCollide::Geometry *geometry, bool resetParentFrame=true)
 Remove a geometry from this assembly (does not recurse down in tree).
 
bool remove (agxSDK::TerrainInstance *terrainInstance)
 Remove a TerrainInstance from this assembly.
 
bool remove (agxSDK::TerrainToolInstance *toolInstance)
 Remove a TerrainToolInstance from this assembly.
 
bool remove (Assembly *assembly, bool resetParentFrame=true)
 Remove a child assembly from a parent.
 
bool remove (EventListener *listener)
 Remove an EventListener from the assembly.
 
virtual void removeNotification (agxSDK::Simulation *)
 Called when this assembly is removed from a simulation.
 
virtual void removeNotification (Assembly *)
 Called when this assembly is removed from another assembly.
 
bool reset (bool resetParentFrame=true)
 If this assembly is not added to a simulation it will clear all added bodies etc.
 
virtual void setAngularVelocity (const agx::Vec3 &velocity)
 Set the angular velocity (in world frame) recursively for all rigid bodies stored in assembly.
 
void setLocalPosition (agx::Real x, agx::Real y, agx::Real z)
 Set the position of the assembly relative to its frame's parent frame.
 
void setLocalPosition (const agx::Vec3 &p)
 Set the position of the assembly relative to its frame's parent frame.
 
void setLocalRotation (const agx::EulerAngles &e)
 Set the rotation of the assembly relative to its frame's parent frame.
 
void setLocalRotation (const agx::Quat &q)
 Set the rotation of the assembly relative to its frame's parent frame.
 
void setLocalTransform (const agx::AffineMatrix4x4 &matrix)
 Assign the local transformation matrix for this assembly, ignoring any eventual parent transformation.
 
void setName (const agx::Name &name)
 Set the name of this Assembly.
 
bool setParentFrame (agx::Frame *frame)
 Set the parent frame of this assembly's frame.
 
void setPosition (agx::Real x, agx::Real y, agx::Real z)
 Set the position of the frame in world coordinates.
 
void setPosition (const agx::Vec3 &p)
 Set the position of the frame in world coordinates.
 
void setRotation (const agx::EulerAngles &e)
 Set the rotation of the assembly relative to world frame.
 
void setRotation (const agx::OrthoMatrix3x3 &m)
 Set the rotation of the assembly relative to world frame.
 
void setRotation (const agx::Quat &q)
 Set the rotation of the assembly relative to world frame.
 
void setTransform (const agx::AffineMatrix4x4 &matrix)
 Set the transform of the assembly.
 
virtual void setVelocity (const agx::Vec3 &velocity)
 Set the linear velocity (in world frame) recursively for all rigid bodies stored in assembly.
 
bool transfer (agxSDK::Assembly *target)
 Transfer all the content from this assembly to the target, including name and transformation.
 
virtual void traverse (AssemblyVisitor *visitor)
 Traverse the assembly tree recursively using a visitor.
 
virtual void traverse (const AssemblyVisitor *visitor) const
 
- Public Member Functions inherited from agx::Referenced
 Referenced ()
 Default constructor.
 
 Referenced (const Referenced &)
 
template<typename T >
T * as ()
 Subclass casting.
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match.
 
template<typename T >
const T * asSafe () const
 
int getReferenceCount () const
 
template<typename T >
bool is () const
 Subclass test.
 
Referencedoperator= (const Referenced &)
 Assignment operator. Will increment the number of references to the referenced object.
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
- Public Member Functions inherited from agxStream::Serializable
virtual ~Serializable ()
 Destructor for normal C++ use but hidden from SWIG bindings.
 
virtual const char * getClassName () const
 
bool getEnableSerialization () const
 
bool getEnableUuidGeneration ()
 
agx::UInt32 getIndex () const
 This index is given at creation of this object.
 
virtual StorageAgent * getStorageAgent () const =0
 
agx::Uuid getUuid () const
 
bool isFinished () const
 
void setEnableSerialization (bool flag)
 Set to false to disable serialization of this object.
 
void setFinished ()
 Tells this class that it is restored correctly and should not be deleted during destruction of an Archive.
 
void setUuid (const agx::Uuid &uuid)
 Explicitly set a Uuid on a serializable object.
 

Static Public Member Functions

static DeformableObjectRef create (BoxType tag, agx::Vec3 halfExtents, BeamModelProperties *properties=nullptr, agx::Real vertexMergeDistance=DefaultVertexMergeDistance)
 Create deformable box given half extents.
 
static DeformableObjectRef create (CapsuleType tag, agx::Real radius, agx::Real length, agx::Real resolution, BeamModelProperties *properties=nullptr, agx::Real vertexMergeDistance=DefaultVertexMergeDistance)
 Create deformable capsule of given radius, length and resolution.
 
static DeformableObjectRef create (ConeType tag, agx::Real topRadius, agx::Real bottomRadius, agx::Real height, agx::Real resolution, BeamModelProperties *properties=nullptr, agx::Real vertexMergeDistance=DefaultVertexMergeDistance)
 Create deformable cone of given top- and bottom radius, height and resolution.
 
static DeformableObjectRef create (ConvexMeshType tag, agx::String filename, agx::Vec3 scale=agx::Vec3(1.0, 1.0, 1.0), BeamModelProperties *properties=nullptr, agx::Real vertexMergeDistance=DefaultVertexMergeDistance)
 Create given supported mesh file format (note that tetgen has its own overload).
 
static DeformableObjectRef create (ConvexMeshType tag, agxCollide::Mesh *mesh, BeamModelProperties *properties=nullptr, agx::Real vertexMergeDistance=DefaultVertexMergeDistance)
 Create given mesh instance.
 
static DeformableObjectRef create (ConvexMeshType tag, const agx::Vec3Vector &convexVertices, const agx::UInt32Vector &convexTriangles, BeamModelProperties *properties=nullptr, agx::Real vertexMergeDistance=DefaultVertexMergeDistance)
 Create given convex mesh vertices and triangles.
 
static DeformableObjectRef create (CylinderType tag, agx::Real radius, agx::Real length, agx::Real resolution, BeamModelProperties *properties=nullptr, agx::Real vertexMergeDistance=DefaultVertexMergeDistance)
 Create deformable cylinder of given radius, length and resolution.
 
static DeformableObjectRef create (RectangularBeamType tag, agx::Vec3 startPosition, agx::Vec3 endPosition, agx::Real width, agx::Real height, size_t numSegments, BeamModelProperties *properties=nullptr, agx::Vec3 worldUpAxis=agx::Vec3::Z_AXIS())
 Reflects the function agxModel::Beam::create to create a beam with resolution segments, but constrained to be a rectangular model.
 
static DeformableObjectRef create (SphereType tag, agx::Real radius, agx::Real resolution, BeamModelProperties *properties=nullptr, agx::Real vertexMergeDistance=DefaultVertexMergeDistance)
 Create deformable sphere given radius and resolution.
 
static DeformableObjectRef create (SurfaceType tag, const agxCollide::HeightField *heightfield, agx::Real baseThickness, BeamModelProperties *properties=nullptr, agx::Real vertexMergeDistance=DefaultVertexMergeDistance)
 Create given heightfield instance and additional thickness.
 
static DeformableObjectRef create (TetGenType tag, agx::String filename, agx::Vec3 scale=agx::Vec3(1.0, 1.0, 1.0), BeamModelProperties *properties=nullptr, agx::Real vertexMergeDistance=DefaultVertexMergeDistance)
 Create given TetGen files.
 
static DeformableObjectRef create (TetrahedronType tag, SingleTetrahedronPositions positions, BeamModelProperties *properties=nullptr, agx::Real vertexMergeDistance=DefaultVertexMergeDistance)
 Creates a single deformable tetrahedron given four initial node positions.
 
static DeformableObjectfind (const agxSDK::Simulation *simulation, const agx::Name &name)
 Find deformable instance given simulation and name.
 
static DeformableObjectfind (const agxSDK::Simulation *simulation, const agx::Uuid &uuid)
 Find deformable instance given simulation and unique id.
 
static agxModel::DeformableObjectPtrVector findAll (const agxSDK::Simulation *simulation)
 Finds all agxModel::DeformableObject instances in the given simulation.
 
static agxModel::DeformableObjectPtrVector findAll (const agxSDK::Simulation *simulation, const agx::Name &name)
 Finds all deformable instances given simulation and name.
 
static DeformableObjectget (agx::RigidBody *rb)
 
static DeformableObjectget (agxCollide::Geometry *geometry)
 
static const DeformableObjectget (const agx::RigidBody *rb)
 
static const DeformableObjectget (const agxCollide::Geometry *geometry)
 
- Static Public Member Functions inherited from agxSDK::Assembly
static AssemblyasAssembly (agxStream::Serializable *obj)
 
static agxStream::Serializablecreate (agxStream::InputArchive &)
 
- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 
- Static Public Member Functions inherited from agxStream::Serializable
static void setEnableUuidGeneration (bool flag)
 Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled.
 

Static Public Attributes

static constexpr BoxType Box {}
 Deformable box with six tetrahedrons: auto deformable = agxModel::DeformableObject::create( agxModel::DeformableObject::Box, { 0.5, 0.5, 0.5 } );.
 
static constexpr CapsuleType Capsule {}
 Deformable capsule: auto deformable = agxModel::DeformableObject::create( agxModel::DeformableObject::Capsule, 0.5, // radius 1.5, // length 0.5, // resolution properties );.
 
static constexpr ConeType Cone {}
 Deformable cone: auto deformable = agxModel::DeformableObject::create( agxModel::DeformableObject::Cone, 0.0, // topRadius 0.3, // bottomRadius 0.7, // height 0.5, // resolution properties );.
 
static constexpr ConvexMeshType ConvexMesh {}
 Generic convex surface mesh where each surface face is connected to a centroid vertex.
 
static constexpr CylinderType Cylinder {}
 Deformable cylinder: auto deformable = agxModel::DeformableObject::create( agxModel::DeformableObject::Cylinder, 0.5, // radius 1.5, // length 0.5, // resolution properties );.
 
static constexpr agx::Real DefaultVertexMergeDistance = DTetrahedronMesh::DefaultVertexMergeDistance
 Default minimum distance between two vertices before they are considered identical: 1.0E-6.
 
static constexpr RectangularBeamType RectangularBeam {}
 Segmented, deformable, rectangular beam: auto deformable = agxModel::DeformableObject::create( agxModel::DeformableObject::RectangularBeam, { 0, 0, 0 }, // startPosition { 4, 0, 0 }, // endPosition, 0.4, // width 0.6, // height, 8, // numSegments > 0 properties );.
 
static constexpr SphereType Sphere {}
 Deformable sphere: auto deformable = agxModel::DeformableObject::create( agxModel::DeformableObject::Sphere, 0.5, // radius 0.5, // resolution properties );.
 
static constexpr SurfaceType Surface {}
 Volumetric surface model where the surface is extended below the lowest point to form a volume describing the deformable object: auto deformable = agxModel::DeformableObject::create( agxModel::DeformableObject::Surface, heightfield, 0.15, // baseThickness >= 0.0 properties );.
 
static constexpr TetGenType TetGen {}
 TetGen mesh stored in .node and .ele files: const auto tetGenFiles = "Path/To/TetGen/file"; // Expecting file.node and file.ele.
 
static constexpr TetrahedronType Tetrahedron {}
 Deformable tetrahedron: auto deformable = agxModel::DeformableObject::create( agxModel::DeformableObject::Tetrahedron, { agx::Vec3{ -0.5, 0.0, 0.0 }, agx::Vec3{ 0.0, 0.5, 0.0 }, agx::Vec3{ 0.0, -0.5, 0.0 }, agx::Vec3{ 0.0, 0.0, 0.5 } } );.
 

Additional Inherited Members

- Protected Member Functions inherited from agxSDK::DeformableObjectInstance
virtual ~DeformableObjectInstance ()=default
 
- Protected Member Functions inherited from agxSDK::Assembly
 Assembly (Type type)
 
virtual ~Assembly ()
 Destructor.
 
bool addParticleSystem (agx::ParticleSystem *particleSystem)
 Add a particle system to this assembly.
 
void addToSimulation (Simulation *simulation)
 
void removeFromSimulation (Simulation *simulation)
 
bool removeParticleSystem (agx::ParticleSystem *particleSystem)
 Remove a particle system from this assembly.
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor.
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 
- Protected Member Functions inherited from agxStream::Serializable
 Serializable ()
 Default constructor.
 
 Serializable (const Serializable &other)
 Copy constructor.
 
void generateUuid ()
 
- Static Protected Member Functions inherited from agx::Referenced
static DeleteHandlergetDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Detailed Description

Deformable object containing a tetrahedron mesh and a set of algorithms.

Definition at line 37 of file DeformableObject.h.

Member Typedef Documentation

◆ SingleTetrahedronPositions

Definition at line 40 of file DeformableObject.h.

Constructor & Destructor Documentation

◆ DeformableObject()

agxModel::DeformableObject::DeformableObject ( BeamModelProperties properties = nullptr,
agx::Real  vertexMergeDistance = DefaultVertexMergeDistance 
)

Construct given properties.

Parameters
properties- model properties
vertexMergeDistance- minimum distance between two vertices before they are considered identical

Member Function Documentation

◆ add()

bool agxModel::DeformableObject::add ( IDeformableAlgorithm algorithm)

Associate a deformable algorithm to this deformable object.

Parameters
algorithm- deformable algorithm instance to add
Returns
true if added, false if nullptr or already part of this deformable object

◆ addGroup() [1/2]

virtual void agxModel::DeformableObject::addGroup ( agx::UInt32  id)
virtual

Add group id to this deformable object.

Parameters
id- id to add

◆ addGroup() [2/2]

virtual void agxModel::DeformableObject::addGroup ( const agx::Name name)
virtual

Add group name to this deformable object.

Parameters
name- name to add

◆ calculateSurfaceTextureCoordinates2D()

virtual agx::Vec2Vector agxModel::DeformableObject::calculateSurfaceTextureCoordinates2D ( ) const
virtual

Calculates the texture coordinates u, v <-> [0, 1] for each surface vertex using object space box/planar mapping.

Note that the mesh has to be finalized before calling this method.

Returns
vector of surface vertex texture coordinates

◆ calculateSurfaceTextureCoordinates3D()

virtual agx::Vec3Vector agxModel::DeformableObject::calculateSurfaceTextureCoordinates3D ( ) const
virtual

Calculates the texture coordinates u, v, w <-> [0, 1] for each surface vertex.

Note that the mesh has to be finalized before calling this method.

Returns
vector of surface vertex texture coordinates (in 3D)

◆ create() [1/12]

static DeformableObjectRef agxModel::DeformableObject::create ( BoxType  tag,
agx::Vec3  halfExtents,
BeamModelProperties properties = nullptr,
agx::Real  vertexMergeDistance = DefaultVertexMergeDistance 
)
static

Create deformable box given half extents.

Parameters
tag- pass agxModel::DeformableObject::Box to select this overload
halfExtents- half extents of the deformable box
properties- properties of the model
vertexMergeDistance- minimum distance between two vertices before they are considered identical
Returns
deformable object if valid, otherwise nullptr

◆ create() [2/12]

static DeformableObjectRef agxModel::DeformableObject::create ( CapsuleType  tag,
agx::Real  radius,
agx::Real  length,
agx::Real  resolution,
BeamModelProperties properties = nullptr,
agx::Real  vertexMergeDistance = DefaultVertexMergeDistance 
)
static

Create deformable capsule of given radius, length and resolution.

The created capsule is centered at the origin with the capsule axis along the y axis.

With higher resolution, the more vertices (and tetrahedrons) are created. Resolution 1.0 is "very" high and 0.2 is low.

Parameters
tag- pass agxModel::DeformableObject::Capsule to select this overload
radius- radius of the capsule
length- length of the capsule
resolution- resolution of the mesh (> 0 where 1.0 is high resolution and 0.2 is low)
properties- properties of the model
vertexMergeDistance- minimum distance between two vertices before they are considered identical
Returns
deformable object if valid, otherwise nullptr

◆ create() [3/12]

static DeformableObjectRef agxModel::DeformableObject::create ( ConeType  tag,
agx::Real  topRadius,
agx::Real  bottomRadius,
agx::Real  height,
agx::Real  resolution,
BeamModelProperties properties = nullptr,
agx::Real  vertexMergeDistance = DefaultVertexMergeDistance 
)
static

Create deformable cone of given top- and bottom radius, height and resolution.

The created cone is centered at bottom and is aligned with the y axis.

With higher resolution, the more vertices (and tetrahedrons) are created. Resolution 1.0 is "very" high and 0.2 is low.

Parameters
tag- pass agxModel::DeformableObject::Cone to select this overload
topRadius- radius at the top of the cone, >= 0.0
bottomRadius- radius at the bottom of the cone, > 0.0
height- height of the cone, > 0.0
resolution- resolution of the mesh (> 0 where 1.0 is high resolution and 0.2 is low)
properties- properties of the model
vertexMergeDistance- minimum distance between two vertices before they are considered identical
Returns
deformable object if valid, otherwise nullptr

◆ create() [4/12]

static DeformableObjectRef agxModel::DeformableObject::create ( ConvexMeshType  tag,
agx::String  filename,
agx::Vec3  scale = agx::Vec3(1.0, 1.0, 1.0),
BeamModelProperties properties = nullptr,
agx::Real  vertexMergeDistance = DefaultVertexMergeDistance 
)
static

Create given supported mesh file format (note that tetgen has its own overload).

The loaded mesh is assumed to be convex, and if it isn't, the mesh boundary is likely to be violated.

Parameters
tag- pass agxModel::DeformableObject::ConvexMesh to select this overload.
filename- filename including path
scale- scale of the read mesh
properties- properties of the model
vertexMergeDistance- minimum distance between two vertices before they are considered identical
Returns
deformable object if valid, otherwise nullptr

◆ create() [5/12]

static DeformableObjectRef agxModel::DeformableObject::create ( ConvexMeshType  tag,
agxCollide::Mesh mesh,
BeamModelProperties properties = nullptr,
agx::Real  vertexMergeDistance = DefaultVertexMergeDistance 
)
static

Create given mesh instance.

The mesh is assumed to be convex, and if it isn't, the mesh boundary is likely to be violated.

Parameters
tag- pass agxModel::DeformableObject::ConvexMesh to select this overload.
mesh- mesh instance
properties- properties of the model
vertexMergeDistance- minimum distance between two vertices before they are considered identical
Returns
deformable object if valid, otherwise nullptr

◆ create() [6/12]

static DeformableObjectRef agxModel::DeformableObject::create ( ConvexMeshType  tag,
const agx::Vec3Vector convexVertices,
const agx::UInt32Vector convexTriangles,
BeamModelProperties properties = nullptr,
agx::Real  vertexMergeDistance = DefaultVertexMergeDistance 
)
static

Create given convex mesh vertices and triangles.

The mesh is assumed to be convex, and if it isn't, the mesh boundary is likely to be violated.

Parameters
tag- pass agxModel::DeformableObject::ConvexMesh to select this overload.
convexVertices- mesh vertices
convexTriangles- mesh triangles
properties- properties of the model
vertexMergeDistance- minimum distance between two vertices before they are considered identical
Returns
deformable object if valid, otherwise nullptr

◆ create() [7/12]

static DeformableObjectRef agxModel::DeformableObject::create ( CylinderType  tag,
agx::Real  radius,
agx::Real  length,
agx::Real  resolution,
BeamModelProperties properties = nullptr,
agx::Real  vertexMergeDistance = DefaultVertexMergeDistance 
)
static

Create deformable cylinder of given radius, length and resolution.

The created cylinder is centered at the origin with the cylinder axis along the y axis.

With higher resolution, the more vertices (and tetrahedrons) are created. Resolution 1.0 is "very" high and 0.2 is low.

Parameters
tag- pass agxModel::DeformableObject::Cylinder to select this overload
radius- radius of the cylinder
length- length of the cylinder
resolution- resolution of the mesh (> 0 where 1.0 is high resolution and 0.2 is low)
properties- properties of the model
vertexMergeDistance- minimum distance between two vertices before they are considered identical
Returns
deformable object if valid, otherwise nullptr

◆ create() [8/12]

static DeformableObjectRef agxModel::DeformableObject::create ( RectangularBeamType  tag,
agx::Vec3  startPosition,
agx::Vec3  endPosition,
agx::Real  width,
agx::Real  height,
size_t  numSegments,
BeamModelProperties properties = nullptr,
agx::Vec3  worldUpAxis = agx::Vec3::Z_AXIS() 
)
static

Reflects the function agxModel::Beam::create to create a beam with resolution segments, but constrained to be a rectangular model.

Parameters
tag- pass agxModel::DeformableObject::RectangularBeam to select this overload.
startPosition- start position of the beam
endPosition- end position of the beam
width- width of the rectangular beam
height- height of the rectangular beam
numSegments- number of segments along the beam
properties- properties of the model
worldUpAxis- world up axis the beam should align with
Returns
deformable object if valid, otherwise nullptr

◆ create() [9/12]

static DeformableObjectRef agxModel::DeformableObject::create ( SphereType  tag,
agx::Real  radius,
agx::Real  resolution,
BeamModelProperties properties = nullptr,
agx::Real  vertexMergeDistance = DefaultVertexMergeDistance 
)
static

Create deformable sphere given radius and resolution.

With higher resolution, the more vertices (and tetrahedrons) are created. Resolution 1.0 is "very" high and 0.2 is low.

Parameters
tag- pass agxModel::DeformableObject::Sphere to select this overload
radius- radius of the sphere
resolution- resolution of the mesh (> 0 where 1.0 is high resolution and 0.2 is low)
properties- properties of the model
vertexMergeDistance- minimum distance between two vertices before they are considered identical
Returns
deformable object if valid, otherwise nullptr

◆ create() [10/12]

static DeformableObjectRef agxModel::DeformableObject::create ( SurfaceType  tag,
const agxCollide::HeightField heightfield,
agx::Real  baseThickness,
BeamModelProperties properties = nullptr,
agx::Real  vertexMergeDistance = DefaultVertexMergeDistance 
)
static

Create given heightfield instance and additional thickness.

Parameters
tag- pass agxModel::DeformableObject::Surface to select this overload.
heightfield- heightfield instance with surface data (not referenced, the data is copied)
baseThickness- additional "thickness" >= 0.0 below the lowest height in the heightfield
properties- properties of the model
vertexMergeDistance- minimum distance between two vertices before they are considered identical
Returns
deformable object if valid, otherwise nullptr

◆ create() [11/12]

static DeformableObjectRef agxModel::DeformableObject::create ( TetGenType  tag,
agx::String  filename,
agx::Vec3  scale = agx::Vec3(1.0, 1.0, 1.0),
BeamModelProperties properties = nullptr,
agx::Real  vertexMergeDistance = DefaultVertexMergeDistance 
)
static

Create given TetGen files.

The required files are ".node" (for initial vertex positions) and ".ele" (with the tetrahedron mesh definition).

Parameters
tag- pass agxModel::DeformableObject::TetGen to select this overload.
filename- filename including path
scale- scale of the read model
properties- properties of the model
vertexMergeDistance- minimum distance between two vertices before they are considered identical
Returns
deformable object if valid, otherwise nullptr

◆ create() [12/12]

static DeformableObjectRef agxModel::DeformableObject::create ( TetrahedronType  tag,
SingleTetrahedronPositions  positions,
BeamModelProperties properties = nullptr,
agx::Real  vertexMergeDistance = DefaultVertexMergeDistance 
)
static

Creates a single deformable tetrahedron given four initial node positions.

Parameters
tag- pass agxModel::DeformableObject::Tetrahedron to select this overload
positions- vertex array, size 4
properties- properties of the model
vertexMergeDistance- minimum distance between two vertices before they are considered identical
Returns
deformable object if valid, otherwise nullptr

◆ find() [1/2]

static DeformableObject * agxModel::DeformableObject::find ( const agxSDK::Simulation simulation,
const agx::Name name 
)
static

Find deformable instance given simulation and name.

Parameters
simulation- simulation
name- name of the deformable instance to find
Returns
deformable instance with given name if found - otherwise nullptr

◆ find() [2/2]

static DeformableObject * agxModel::DeformableObject::find ( const agxSDK::Simulation simulation,
const agx::Uuid uuid 
)
static

Find deformable instance given simulation and unique id.

Parameters
simulation- simulation
uuid- UUID of the deformable instance to find
Returns
deformable instance with given UUID if found - otherwise nullptr

◆ findAll() [1/2]

static agxModel::DeformableObjectPtrVector agxModel::DeformableObject::findAll ( const agxSDK::Simulation simulation)
static

Finds all agxModel::DeformableObject instances in the given simulation.

Parameters
simulation- simulation
Returns
deformable instances found in the given simulation

◆ findAll() [2/2]

static agxModel::DeformableObjectPtrVector agxModel::DeformableObject::findAll ( const agxSDK::Simulation simulation,
const agx::Name name 
)
static

Finds all deformable instances given simulation and name.

Parameters
simulation- simulation
name- name of deformable instances to find
Returns
deformable instances with given name

◆ findClosestSurfaceVertex()

DVertexElement agxModel::DeformableObject::findClosestSurfaceVertex ( const agx::Vec3 worldPoint,
bool  viaEdge = false 
) const

Linear search through all surface vertices of this deformable object to find the closest surface vertex to the given world point.

Parameters
worldPoint- any point in world
viaEdge- true to find the closest vertex by first finding the closest edge to worldPoint and then the closest vertex to worldPoint on that edge, false (default) to just check against the three vertices of this face.
Returns
the closest vertex element to worldPoint

◆ findClosestVertex()

DVertexElement agxModel::DeformableObject::findClosestVertex ( const agx::Vec3 worldPoint,
bool  viaEdge = false 
) const

Linear search through all vertices of this deformable object to find the closest vertex to the given world point.

Parameters
worldPoint- any point in world
viaEdge- true to find the closest vertex by first finding the closest edge to worldPoint and then the closest vertex to worldPoint on that edge, false (default) to just check against the three vertices of this face.
Returns
the closest vertex element to worldPoint

◆ get() [1/4]

static DeformableObject * agxModel::DeformableObject::get ( agx::RigidBody rb)
static
Returns
the deformable object of the given rigid body if the rigid body is part of one

◆ get() [2/4]

static DeformableObject * agxModel::DeformableObject::get ( agxCollide::Geometry geometry)
static
Returns
the deformable object of the given geometry if the geometry is part of one

◆ get() [3/4]

static const DeformableObject * agxModel::DeformableObject::get ( const agx::RigidBody rb)
static
Returns
the deformable object of the given rigid body if the rigid body is part of one

◆ get() [4/4]

static const DeformableObject * agxModel::DeformableObject::get ( const agxCollide::Geometry geometry)
static
Returns
the deformable object of the given geometry if the geometry is part of one

◆ getAlgorithm() [1/2]

template<typename T >
T * agxModel::DeformableObject::getAlgorithm
Returns
the deformable algorithm of the given type, nullptr if not present

Definition at line 790 of file DeformableObject.h.

◆ getAlgorithm() [2/2]

IDeformableAlgorithm * agxModel::DeformableObject::getAlgorithm ( const agx::Name name) const

Finds the algorithm by its name.

The names are by default the class name without namespace.

Parameters
name- name of the algorithm to find
Returns
algorithm of given name if found, otherwise nullptr

◆ getCmPosition()

agx::Vec3 agxModel::DeformableObject::getCmPosition ( ) const

Calculates, and returns the current center of mass of this deformable.

Returns
the current center of mass of this deformable

◆ getCurrentVolume()

agx::Real agxModel::DeformableObject::getCurrentVolume ( ) const
Returns
the current volume of this deformable, if initialized - otherwise 0.0

◆ getDisabledCollisionGroupId()

virtual agx::UInt32 agxModel::DeformableObject::getDisabledCollisionGroupId ( ) const
virtual
Returns
the collision id of this deformable object

◆ getEnableCollisions() [1/2]

virtual bool agxModel::DeformableObject::getEnableCollisions ( const agx::RigidBody rb) const
virtual
Returns
true if collisions are enabled - otherwise false

◆ getEnableCollisions() [2/2]

virtual bool agxModel::DeformableObject::getEnableCollisions ( const agxCollide::Geometry geometry) const
virtual
Returns
true if collisions are enabled - otherwise false

◆ getMass()

agx::Real agxModel::DeformableObject::getMass ( ) const
Returns
the total mass of this deformable, if initialized - otherwise 0.0

◆ getMaterial()

virtual agx::Material * agxModel::DeformableObject::getMaterial ( ) const
virtual
Returns
the material of this deformable object

◆ getMesh() [1/2]

DTetrahedronMesh & agxModel::DeformableObject::getMesh ( )
Returns
the mesh of this deformable object

◆ getMesh() [2/2]

const DTetrahedronMesh & agxModel::DeformableObject::getMesh ( ) const
Returns
the mesh of this deformable object

◆ getProperties()

BeamModelProperties * agxModel::DeformableObject::getProperties ( ) const
Returns
the bulk properties of this deformable object

◆ getReferenceData()

DeformableObjectReferenceDataRef agxModel::DeformableObject::getReferenceData ( ) const

Objects (e.g., bodies, geometries) of this deformable should be associated to this instance via this data.

Returns
reference (to this deformable instance) data

◆ getRestVolume()

agx::Real agxModel::DeformableObject::getRestVolume ( ) const
Returns
the initial/rest volume of this deformable, if initialized - otherwise 0.0

◆ getUniqueId()

virtual agx::UInt32 agxModel::DeformableObject::getUniqueId ( ) const
virtual
Returns
the unique id of this deformable object

◆ hasGroup() [1/2]

virtual bool agxModel::DeformableObject::hasGroup ( agx::UInt32  id) const
virtual
Returns
true if the id has been added to this deformable object - otherwise false

◆ hasGroup() [2/2]

virtual bool agxModel::DeformableObject::hasGroup ( const agx::Name name) const
virtual
Returns
true if the name has been added to this deformable object - otherwise false

◆ initialize()

virtual bool agxModel::DeformableObject::initialize ( )
virtual

Initialize all elements of this deformable object given the mesh is valid.

Initialization happens when this object is added to a simulation, i.e., calling this method is optional.

Returns
true if successfully initialized, otherwise false

◆ isInitialized()

bool agxModel::DeformableObject::isInitialized ( ) const
Returns
true if this deformable object has been initialized (has valid mesh), otherwise false

◆ remove()

bool agxModel::DeformableObject::remove ( IDeformableAlgorithm algorithm)

Remove a deformable algorithm from this deformable object.

Parameters
algorithm- deformable algorithm instance to remove
Returns
true if removed, false if nullptr or not part of this deformable object

◆ removeGroup() [1/2]

virtual void agxModel::DeformableObject::removeGroup ( agx::UInt32  id)
virtual

Remove group id from this deformable object.

Parameters
id- id to remove

◆ removeGroup() [2/2]

virtual void agxModel::DeformableObject::removeGroup ( const agx::Name name)
virtual

Remove group name from this deformable object.

Parameters
name- name to remove

◆ setEnableCollisions() [1/2]

virtual void agxModel::DeformableObject::setEnableCollisions ( agx::RigidBody rb,
bool  enable 
)
virtual

Enable/disable collisions between the rigid body and this deformable object.

Parameters
rb- rigid body to enable/disable collisions with
enable- true to enable, false to disable

◆ setEnableCollisions() [2/2]

virtual void agxModel::DeformableObject::setEnableCollisions ( agxCollide::Geometry geometry,
bool  enable 
)
virtual

Enable/disable collisions between the geometry and this deformable object.

Parameters
geometry- geometry to enable/disable collisions with
enable- true to enable, false to disable

◆ setMaterial()

virtual void agxModel::DeformableObject::setMaterial ( agx::Material material)
virtual

Assign new material to this deformable object.

Parameters
material- new material

◆ setRigidVelocity()

void agxModel::DeformableObject::setRigidVelocity ( const agx::Vec3 linearVelocity,
const agx::Vec3 angularVelocity 
)

Calculates individual vertex velocities given input rigid linear- and angular velocity.

The current center of mass is used as center, and the vertex velocities becomes: v(x) = linearVelocity + angularVelocity x (v.getWorldPosition() - getCmPosition())

Parameters
linearVelocity- linear velocity of the center of this deformable
angularVelocity- angular velocity about the center of this deformable

Member Data Documentation

◆ Box

constexpr BoxType agxModel::DeformableObject::Box {}
staticconstexpr

Deformable box with six tetrahedrons: auto deformable = agxModel::DeformableObject::create( agxModel::DeformableObject::Box, { 0.5, 0.5, 0.5 } );.

Definition at line 117 of file DeformableObject.h.

◆ Capsule

constexpr CapsuleType agxModel::DeformableObject::Capsule {}
staticconstexpr

Deformable capsule: auto deformable = agxModel::DeformableObject::create( agxModel::DeformableObject::Capsule, 0.5, // radius 1.5, // length 0.5, // resolution properties );.

Definition at line 146 of file DeformableObject.h.

◆ Cone

constexpr ConeType agxModel::DeformableObject::Cone {}
staticconstexpr

Deformable cone: auto deformable = agxModel::DeformableObject::create( agxModel::DeformableObject::Cone, 0.0, // topRadius 0.3, // bottomRadius 0.7, // height 0.5, // resolution properties );.

Definition at line 157 of file DeformableObject.h.

◆ ConvexMesh

constexpr ConvexMeshType agxModel::DeformableObject::ConvexMesh {}
staticconstexpr

Generic convex surface mesh where each surface face is connected to a centroid vertex.

auto deformable1 = agxModel::DeformableObject::create( agxModel::DeformableObject::ConvexMesh, filename, properties ); auto deformable2 = agxModel::DeformableObject::create( agxModel::DeformableObject::ConvexMesh, mesh, properties );

Definition at line 200 of file DeformableObject.h.

◆ Cylinder

constexpr CylinderType agxModel::DeformableObject::Cylinder {}
staticconstexpr

Deformable cylinder: auto deformable = agxModel::DeformableObject::create( agxModel::DeformableObject::Cylinder, 0.5, // radius 1.5, // length 0.5, // resolution properties );.

Definition at line 136 of file DeformableObject.h.

◆ DefaultVertexMergeDistance

constexpr agx::Real agxModel::DeformableObject::DefaultVertexMergeDistance = DTetrahedronMesh::DefaultVertexMergeDistance
staticconstexpr

Default minimum distance between two vertices before they are considered identical: 1.0E-6.

Definition at line 47 of file DeformableObject.h.

◆ RectangularBeam

constexpr RectangularBeamType agxModel::DeformableObject::RectangularBeam {}
staticconstexpr

Segmented, deformable, rectangular beam: auto deformable = agxModel::DeformableObject::create( agxModel::DeformableObject::RectangularBeam, { 0, 0, 0 }, // startPosition { 4, 0, 0 }, // endPosition, 0.4, // width 0.6, // height, 8, // numSegments > 0 properties );.

Definition at line 179 of file DeformableObject.h.

◆ Sphere

constexpr SphereType agxModel::DeformableObject::Sphere {}
staticconstexpr

Deformable sphere: auto deformable = agxModel::DeformableObject::create( agxModel::DeformableObject::Sphere, 0.5, // radius 0.5, // resolution properties );.

Definition at line 126 of file DeformableObject.h.

◆ Surface

constexpr SurfaceType agxModel::DeformableObject::Surface {}
staticconstexpr

Volumetric surface model where the surface is extended below the lowest point to form a volume describing the deformable object: auto deformable = agxModel::DeformableObject::create( agxModel::DeformableObject::Surface, heightfield, 0.15, // baseThickness >= 0.0 properties );.

Definition at line 189 of file DeformableObject.h.

◆ TetGen

constexpr TetGenType agxModel::DeformableObject::TetGen {}
staticconstexpr

TetGen mesh stored in .node and .ele files: const auto tetGenFiles = "Path/To/TetGen/file"; // Expecting file.node and file.ele.

auto deformable = agxModel::DeformableObject::create( agxModel::DeformableObject::TetGen, tetGenFiles, { 1.0, 1.0, 1.0 }, // scale properties );

Definition at line 167 of file DeformableObject.h.

◆ Tetrahedron

constexpr TetrahedronType agxModel::DeformableObject::Tetrahedron {}
staticconstexpr

Deformable tetrahedron: auto deformable = agxModel::DeformableObject::create( agxModel::DeformableObject::Tetrahedron, { agx::Vec3{ -0.5, 0.0, 0.0 }, agx::Vec3{ 0.0, 0.5, 0.0 }, agx::Vec3{ 0.0, -0.5, 0.0 }, agx::Vec3{ 0.0, 0.0, 0.5 } } );.

Definition at line 110 of file DeformableObject.h.


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