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>
|
void | setInputMeshes (std::shared_ptr< SurfaceMesh > inputMeshA, std::shared_ptr< SurfaceMesh > inputMeshB) |
|
std::shared_ptr< LineMesh > | getOutputMesh () 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 () |
|
std::shared_ptr< Geometry > | getInput (size_t port=0) const |
| Returns input geometry given port, returns nullptr if doesn't exist.
|
|
std::shared_ptr< Geometry > | getOutput (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.
|
|
|
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< LineMesh > | createStrands (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 |
|
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) |
|
|
int | m_segmentsPerStrand = 3 |
|
double | m_strandsPerFace = 1 |
|
double | m_allowedAngleDeviation = PI |
|
TypeCheckContainer | m_requiredTypeChecks |
|
TypeCheckContainer | m_optionalTypeChecks |
|
|
using | GeometryCheck = std::function< bool(Geometry *)> |
|
using | TypeCheckContainer = std::unordered_map< size_t, GeometryCheck > |
|
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.
◆ 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
-
meshA | mesh on one side of the connective tissue |
faces | list of faces on meshA that will have strands on them |
meshB | mesh on the other side of the connective tissue |
- Returns
- the generate mesh
Definition at line 99 of file imstkConnectiveStrandGenerator.cpp.
◆ generateRandomPointOnFace()
const Vec3d imstk::ConnectiveStrandGenerator::generateRandomPointOnFace |
( |
SurfaceMesh * |
mesh, |
|
|
int |
face |
|
) |
| const |
|
protected |
The documentation for this class was generated from the following files: