iMSTK
Interactive Medical Simulation Toolkit
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
imstk::ConnectiveStrandGenerator Class Reference

This filter takes in two surface meshes and generates a LineMesh that connectes the faces of the two meshes. Internally the strands are generated such that only faces with normals pointing in opposite direction are used. This cuts down on penetration. This is expected to be used to generate connective tissue with the ProximitySurfaceSelectoror any other method to select a subset of a surface mesh to connect. More...

#include <imstkConnectiveStrandGenerator.h>

Inheritance diagram for imstk::ConnectiveStrandGenerator:
Inheritance graph
[legend]
Collaboration diagram for imstk::ConnectiveStrandGenerator:
Collaboration graph
[legend]

Public Member Functions

void setInputMeshes (std::shared_ptr< SurfaceMesh > inputMeshA, std::shared_ptr< SurfaceMesh > inputMeshB)
 
std::shared_ptr< LineMeshgetOutputMesh () const
 
void setAllowedAngleDeviation (double angle)
 
double getAllowedAgnleDeviation () const
 
void setSegmentsPerStrand (int numSegs)
 Get/Set the number of segments each connective strand is made of. Defaults to 3.
 
int getSegmentsPerStrand ()
 
void setStrandsPerFace (double density)
 Get/Set the number of of connective strands attached to each face Defaults to 1.
 
double getStrandsPerFace ()
 
- Public Member Functions inherited from imstk::GeometryAlgorithm
std::shared_ptr< GeometrygetInput (size_t port=0) const
 Returns input geometry given port, returns nullptr if doesn't exist.
 
std::shared_ptr< GeometrygetOutput (size_t port=0) const
 Returns output geometry given port, returns nullptr if doesn't exist.
 
void setInput (std::shared_ptr< Geometry > inputGeometry, size_t port=0)
 Set the input at the port.
 
void update ()
 Do the actual algorithm.
 

Protected Member Functions

void requestUpdate () override
 Users can implement this for the logic to be run.
 
std::vector< int > filterCells (SurfaceMesh *meshA, SurfaceMesh *meshB) const
 Filter faces on meshA to remove those facing away from meshB Checks nearest faces, if nearest face normal points in same general direction then ignore.
 
std::shared_ptr< LineMeshcreateStrands (SurfaceMesh *meshA, const std::vector< int > &faces, SurfaceMesh *meshB) const
 Creates a line mesh by connecting points of the given faces of meshA with with random points on random faces on meshB with strands. More...
 
const Vec3d generateRandomPointOnFace (SurfaceMesh *mesh, int face) const
 
- Protected Member Functions inherited from imstk::GeometryAlgorithm
void setOutput (std::shared_ptr< Geometry > inputGeometry, const size_t port=0)
 Set the output at the port.
 
template<typename T >
void setRequiredInputType (const size_t port)
 Declares the type for the port with the given number, also defines that the give port is required for the filter to run correctly.
 
template<typename T >
void setOptionalInputType (const size_t port)
 Declares the type for the port with the given number, the data for this port is optional and may be omitted.
 
virtual bool areInputsValid ()
 Check inputs are correct. More...
 
void setNumInputPorts (const size_t numPorts)
 Get/Set the amount of input ports.
 
 imstkGetMacro (NumInputPorts, size_t)
 
void setNumOutputPorts (const size_t numPorts)
 Get/Set the amount of output ports.
 
 imstkGetMacro (NumOutputPorts, size_t)
 

Protected Attributes

int m_segmentsPerStrand = 3
 
double m_strandsPerFace = 1
 
double m_allowedAngleDeviation = PI
 
- Protected Attributes inherited from imstk::GeometryAlgorithm
TypeCheckContainer m_requiredTypeChecks
 
TypeCheckContainer m_optionalTypeChecks
 

Additional Inherited Members

- Protected Types inherited from imstk::GeometryAlgorithm
using GeometryCheck = std::function< bool(Geometry *)>
 
using TypeCheckContainer = std::unordered_map< size_t, GeometryCheck >
 

Detailed Description

This filter takes in two surface meshes and generates a LineMesh that connectes the faces of the two meshes. Internally the strands are generated such that only faces with normals pointing in opposite direction are used. This cuts down on penetration. This is expected to be used to generate connective tissue with the ProximitySurfaceSelectoror any other method to select a subset of a surface mesh to connect.

Definition at line 30 of file imstkConnectiveStrandGenerator.h.

Member Function Documentation

◆ createStrands()

std::shared_ptr< LineMesh > imstk::ConnectiveStrandGenerator::createStrands ( SurfaceMesh meshA,
const std::vector< int > &  faces,
SurfaceMesh meshB 
) const
protected

Creates a line mesh by connecting points of the given faces of meshA with with random points on random faces on meshB with strands.

Parameters
meshAmesh on one side of the connective tissue
faceslist of faces on meshA that will have strands on them
meshBmesh on the other side of the connective tissue
Returns
the generate mesh

Definition at line 99 of file imstkConnectiveStrandGenerator.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ generateRandomPointOnFace()

const Vec3d imstk::ConnectiveStrandGenerator::generateRandomPointOnFace ( SurfaceMesh mesh,
int  face 
) const
protected
Returns
A random point on the given face and the given mesh

Definition at line 199 of file imstkConnectiveStrandGenerator.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

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