NetDEM v1.0
Loading...
Searching...
No Matches
netdem::SolverBooleanPP Class Reference

Solver for triangle mesh contacts between two particles using boolean operations. More...

#include <solver_boolean_pp.hpp>

Inheritance diagram for netdem::SolverBooleanPP:
netdem::CollisionSolverPP

Public Member Functions

 SolverBooleanPP ()
 Default constructor for SolverBooleanPP.
 
 SolverBooleanPP (Particle *const p1, Particle *const p2)
 Constructor for SolverBooleanPP.
 
CollisionSolverPPClone () const override
 Creates a copy of this collision solver.
 
void Init (Particle *const p1, Particle *const p2) override
 Initializes the collision solver with two particles.
 
bool Detect () override
 Detects collisions between two particles using boolean operations on their triangle meshes.
 
void ResolveInit (ContactPP *const cnt, double timestep) override
 Initializes the contact point between two particles at time t = 0.
 
void ResolveUpdate (ContactPP *const cnt, double timestep) override
 Updates the contact point between two particles at time t > 0.
 
void ResolveInit (CollisionGeometries *const cnt_geoms, double timestep, const VecXT< Vec3d > &vertices, const VecXT< Vec3i > &facets, const VecXT< int > &facets_of_1or2)
 Initializes the contact geometries between two particles at time t = 0.
 
void ResolveUpdate (CollisionGeometries *const cnt_geoms, double timestep, const VecXT< Vec3d > &vertices, const VecXT< Vec3i > &facets, const VecXT< int > &facets_of_1or2)
 Updates the contact geometries between two particles at time t > 0.
 
void ResolveInit_Equivalent (CollisionGeometries *const cnt_geoms, double timestep)
 Initializes the contact geometries between two equivalent shapes at time t = 0.
 
void ResolveUpdate_Equivalent (CollisionGeometries *const cnt_geoms, double timestep)
 Updates the contact geometries between two equivalent shapes at time t > 0.
 
STLModel GetContactTriMesh (int id)
 Returns an STL model of the contact triangle mesh for a given component.
 
- Public Member Functions inherited from netdem::CollisionSolverPP
 CollisionSolverPP ()
 
 CollisionSolverPP (Particle *const p1, Particle *const p2)
 
virtual bool Detect (ContactPP *const cnt)
 
virtual ~CollisionSolverPP ()
 

Protected Member Functions

void ClearIntersectInfo ()
 Clears the intersection information between the two triangle meshes.
 
void SeperateComponents ()
 Separates the intersection components in the triangle mesh into separate lists.
 
- Protected Member Functions inherited from netdem::CollisionSolverPP
void InitBasicGeoms (CollisionGeometries *const cnt_geoms, double timestep)
 
void UpdateBasicGeoms (CollisionGeometries *const cnt_geoms, double timestep, Vec3d const &dir_n_old)
 Update the basic contact geometries associated with a collision.
 

Protected Attributes

double bound_sphere_radius_1
 < The radius of the bounding sphere for the first STL model.
 
double bound_sphere_radius_2
 
Vec3d dpos_12
 Pointer to the first STLModel object.
 
STLModelstl_model_1 {nullptr}
 Pointer to the second STLModel object.
 
STLModelstl_model_2 {nullptr}
 List of intersection vertices.
 
VecXT< Vec3dvertices_isct
 List of intersection facets.
 
VecXT< Vec3ifacets_isct
 List of birth IDs for each intersection facet.
 
VecXT< int > facets_birth_ids
 List of components (connected sets of facets) for each STL model.
 
VecXT< VecXT< Vec3i > > comp_facets_list
 
VecXT< VecXT< int > > comp_facets_of_1or2_list
 

Additional Inherited Members

- Public Attributes inherited from netdem::CollisionSolverPP
Particleparticle_1 {nullptr}
 
Particleparticle_2 {nullptr}
 

Detailed Description

Solver for triangle mesh contacts between two particles using boolean operations.

Examples
10_gen_dataset_trimesh.cpp, 11_test_dataset_trimesh.cpp, 16_test_ann_vs_geom_trimesh.cpp, and 17_test_ann_vs_geom_trimesh.cpp.

Constructor & Destructor Documentation

◆ SolverBooleanPP() [1/2]

netdem::SolverBooleanPP::SolverBooleanPP ( )

Default constructor for SolverBooleanPP.

◆ SolverBooleanPP() [2/2]

netdem::SolverBooleanPP::SolverBooleanPP ( Particle *const p1,
Particle *const p2 )

Constructor for SolverBooleanPP.

Parameters
p1The first particle to check for collisions against the second particle.
p2The second particle to check for collisions against the first particle.

Member Function Documentation

◆ ClearIntersectInfo()

void netdem::SolverBooleanPP::ClearIntersectInfo ( )
protected

Clears the intersection information between the two triangle meshes.

◆ Clone()

CollisionSolverPP * netdem::SolverBooleanPP::Clone ( ) const
overridevirtual

Creates a copy of this collision solver.

Returns
A new instance of the collision solver.

Implements netdem::CollisionSolverPP.

◆ Detect()

bool netdem::SolverBooleanPP::Detect ( )
overridevirtual

Detects collisions between two particles using boolean operations on their triangle meshes.

Returns
True if a collision occurred, false otherwise.

Implements netdem::CollisionSolverPP.

Examples
10_gen_dataset_trimesh.cpp, 11_test_dataset_trimesh.cpp, 16_test_ann_vs_geom_trimesh.cpp, and 17_test_ann_vs_geom_trimesh.cpp.

◆ GetContactTriMesh()

STLModel netdem::SolverBooleanPP::GetContactTriMesh ( int id)

Returns an STL model of the contact triangle mesh for a given component.

Parameters
idThe ID of the component.
Returns
The STL model of the contact triangle mesh.

◆ Init()

void netdem::SolverBooleanPP::Init ( Particle *const p1,
Particle *const p2 )
overridevirtual

Initializes the collision solver with two particles.

Parameters
p1The first particle to check for collisions against the second particle.
p2The second particle to check for collisions against the first particle.

Reimplemented from netdem::CollisionSolverPP.

Examples
10_gen_dataset_trimesh.cpp, 11_test_dataset_trimesh.cpp, 16_test_ann_vs_geom_trimesh.cpp, and 17_test_ann_vs_geom_trimesh.cpp.

◆ ResolveInit() [1/2]

void netdem::SolverBooleanPP::ResolveInit ( CollisionGeometries *const cnt_geoms,
double timestep,
const VecXT< Vec3d > & vertices,
const VecXT< Vec3i > & facets,
const VecXT< int > & facets_of_1or2 )

Initializes the contact geometries between two particles at time t = 0.

Parameters
cnt_geomsThe contact geometries.
timestepThe simulation timestep.
verticesThe vector of vertices defining the triangle mesh.
facetsThe vector of facets defining the triangle mesh.
facets_of_1or2A vector indicating whether each facet is from particle 1 or particle 2.

◆ ResolveInit() [2/2]

void netdem::SolverBooleanPP::ResolveInit ( ContactPP *const cnt,
double timestep )
overridevirtual

Initializes the contact point between two particles at time t = 0.

Parameters
cntThe contact point.
timestepThe simulation timestep.

Implements netdem::CollisionSolverPP.

Examples
10_gen_dataset_trimesh.cpp, 11_test_dataset_trimesh.cpp, 16_test_ann_vs_geom_trimesh.cpp, and 17_test_ann_vs_geom_trimesh.cpp.

◆ ResolveInit_Equivalent()

void netdem::SolverBooleanPP::ResolveInit_Equivalent ( CollisionGeometries *const cnt_geoms,
double timestep )

Initializes the contact geometries between two equivalent shapes at time t = 0.

Parameters
cnt_geomsThe contact geometries.
timestepThe simulation timestep.

◆ ResolveUpdate() [1/2]

void netdem::SolverBooleanPP::ResolveUpdate ( CollisionGeometries *const cnt_geoms,
double timestep,
const VecXT< Vec3d > & vertices,
const VecXT< Vec3i > & facets,
const VecXT< int > & facets_of_1or2 )

Updates the contact geometries between two particles at time t > 0.

Parameters
cnt_geomsThe contact geometries.
timestepThe simulation timestep.
verticesThe vector of vertices defining the triangle mesh.
facetsThe vector of facets defining the triangle mesh.
facets_of_1or2A vector indicating whether each facet is from particle 1 or particle 2.

◆ ResolveUpdate() [2/2]

void netdem::SolverBooleanPP::ResolveUpdate ( ContactPP *const cnt,
double timestep )
overridevirtual

Updates the contact point between two particles at time t > 0.

Parameters
cntThe contact point.
timestepThe simulation timestep.

Implements netdem::CollisionSolverPP.

◆ ResolveUpdate_Equivalent()

void netdem::SolverBooleanPP::ResolveUpdate_Equivalent ( CollisionGeometries *const cnt_geoms,
double timestep )

Updates the contact geometries between two equivalent shapes at time t > 0.

Parameters
cnt_geomsThe contact geometries.
timestepThe simulation timestep.

◆ SeperateComponents()

void netdem::SolverBooleanPP::SeperateComponents ( )
protected

Separates the intersection components in the triangle mesh into separate lists.

Member Data Documentation

◆ bound_sphere_radius_1

double netdem::SolverBooleanPP::bound_sphere_radius_1
protected

< The radius of the bounding sphere for the first STL model.

The radius of the bounding sphere for the second STL model.

◆ bound_sphere_radius_2

double netdem::SolverBooleanPP::bound_sphere_radius_2
protected

The relative position vector between the centers of the two bounding spheres.

◆ comp_facets_list

VecXT<VecXT<Vec3i> > netdem::SolverBooleanPP::comp_facets_list
protected

List of components containing facets from either the first or second STL model.

◆ comp_facets_of_1or2_list

VecXT<VecXT<int> > netdem::SolverBooleanPP::comp_facets_of_1or2_list
protected

◆ dpos_12

Vec3d netdem::SolverBooleanPP::dpos_12
protected

Pointer to the first STLModel object.

◆ facets_birth_ids

VecXT<int> netdem::SolverBooleanPP::facets_birth_ids
protected

List of components (connected sets of facets) for each STL model.

◆ facets_isct

VecXT<Vec3i> netdem::SolverBooleanPP::facets_isct
protected

List of birth IDs for each intersection facet.

◆ stl_model_1

STLModel* netdem::SolverBooleanPP::stl_model_1 {nullptr}
protected

Pointer to the second STLModel object.

◆ stl_model_2

STLModel* netdem::SolverBooleanPP::stl_model_2 {nullptr}
protected

List of intersection vertices.

◆ vertices_isct

VecXT<Vec3d> netdem::SolverBooleanPP::vertices_isct
protected

List of intersection facets.


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