FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
FEAT::Geometry::VertexRaycaster< MeshType_ > Class Template Reference

Utility class for casting rays originating from a mesh vertex. More...

#include <raycast.hpp>

Public Types

using DataType = typename MeshType::CoordType
 Data type. More...
 
using IntersectionDataType = IntersectionData< DataType >
 Intersection data type. More...
 
using IntersectionResultType = std::optional< IntersectionDataType >
 Intersection result type. More...
 
using MeshType = MeshType_
 Mesh type. More...
 
using Vector = typename MeshType::VertexType
 Vector type. More...
 

Public Member Functions

 VertexRaycaster (const MeshType &mesh)
 Constructor. More...
 
IntersectionResultType cast (const Index vertex, const Vector &direction) const
 Cast a ray from the given vertex in the given direction. More...
 

Static Public Attributes

static constexpr int facet_dim = shape_dim - 1
 Dimension of the facets to test against. More...
 
static constexpr int shape_dim = MeshType::shape_dim
 Dimension of the mesh shape. More...
 

Protected Attributes

Adjacency::Graph _c_at_v
 Precomputes mapping from vertices to adjacent shape_dim-cells. More...
 
const MeshType_mesh
 Reference to mesh. More...
 

Detailed Description

template<typename MeshType_>
class FEAT::Geometry::VertexRaycaster< MeshType_ >

Utility class for casting rays originating from a mesh vertex.

Definition at line 462 of file raycast.hpp.

Member Typedef Documentation

◆ DataType

template<typename MeshType_ >
using FEAT::Geometry::VertexRaycaster< MeshType_ >::DataType = typename MeshType::CoordType

Data type.

Definition at line 469 of file raycast.hpp.

◆ IntersectionDataType

template<typename MeshType_ >
using FEAT::Geometry::VertexRaycaster< MeshType_ >::IntersectionDataType = IntersectionData<DataType>

Intersection data type.

Definition at line 472 of file raycast.hpp.

◆ IntersectionResultType

template<typename MeshType_ >
using FEAT::Geometry::VertexRaycaster< MeshType_ >::IntersectionResultType = std::optional<IntersectionDataType>

Intersection result type.

Definition at line 475 of file raycast.hpp.

◆ MeshType

template<typename MeshType_ >
using FEAT::Geometry::VertexRaycaster< MeshType_ >::MeshType = MeshType_

Mesh type.

Definition at line 466 of file raycast.hpp.

◆ Vector

template<typename MeshType_ >
using FEAT::Geometry::VertexRaycaster< MeshType_ >::Vector = typename MeshType::VertexType

Vector type.

Definition at line 478 of file raycast.hpp.

Constructor & Destructor Documentation

◆ VertexRaycaster()

template<typename MeshType_ >
FEAT::Geometry::VertexRaycaster< MeshType_ >::VertexRaycaster ( const MeshType mesh)
inlineexplicit

Constructor.

Definition at line 495 of file raycast.hpp.

Member Function Documentation

◆ cast()

template<typename MeshType_ >
IntersectionResultType FEAT::Geometry::VertexRaycaster< MeshType_ >::cast ( const Index  vertex,
const Vector direction 
) const
inline

Cast a ray from the given vertex in the given direction.

Parameters
[in]vertexIndex of origin vertex
[in]directionDirection to cast ray in
Returns
Either nothing or IntersectionData for the closest intersection point by exit point. If multiple intersections with the same closest exit point exits, it chooses the intersection with the closest entry point.

Itersections are checked with all facets of all cells adjacent to the given vertex.

Note
Because the ray always originates from a vertex the returned entry point is extremely unstable. Use the exit point t_exit to determine how far a ray reached into the mesh.

Definition at line 516 of file raycast.hpp.

References FEAT::Geometry::VertexRaycaster< MeshType_ >::_c_at_v, FEAT::Geometry::VertexRaycaster< MeshType_ >::_mesh, FEAT::Math::abs(), FEAT::Adjacency::CompositeAdjactor< Adj1_, Adj2_ >::image_begin(), FEAT::Adjacency::CompositeAdjactor< Adj1_, Adj2_ >::image_end(), FEAT::Geometry::IntersectionData< DT_ >::t_entry, and FEAT::Geometry::IntersectionData< DT_ >::t_exit.

Member Data Documentation

◆ _c_at_v

template<typename MeshType_ >
Adjacency::Graph FEAT::Geometry::VertexRaycaster< MeshType_ >::_c_at_v
protected

Precomputes mapping from vertices to adjacent shape_dim-cells.

Definition at line 491 of file raycast.hpp.

Referenced by FEAT::Geometry::VertexRaycaster< MeshType_ >::cast().

◆ _mesh

template<typename MeshType_ >
const MeshType& FEAT::Geometry::VertexRaycaster< MeshType_ >::_mesh
protected

Reference to mesh.

Definition at line 488 of file raycast.hpp.

Referenced by FEAT::Geometry::VertexRaycaster< MeshType_ >::cast().

◆ facet_dim

template<typename MeshType_ >
constexpr int FEAT::Geometry::VertexRaycaster< MeshType_ >::facet_dim = shape_dim - 1
staticconstexpr

Dimension of the facets to test against.

Definition at line 484 of file raycast.hpp.

◆ shape_dim

template<typename MeshType_ >
constexpr int FEAT::Geometry::VertexRaycaster< MeshType_ >::shape_dim = MeshType::shape_dim
staticconstexpr

Dimension of the mesh shape.

Definition at line 481 of file raycast.hpp.


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