Lagrange
Loading...
Searching...
No Matches
lagrange::raycasting Namespace Reference

Raycasting operations. More...

Classes

struct  ClosestPointHit
 Result of a single closest point query. More...
 
struct  ClosestPointHitN
 Result of a multi-point closest point query. More...
 
struct  HitBase
 Shared base struct for ray and closest point hits. More...
 
struct  HitBaseN
 Shared base struct for multi-ray and multi-point hits. More...
 
struct  ProjectCommonOptions
 Common options for projection functions. More...
 
struct  ProjectDirectionalOptions
 Options for project_directional(). More...
 
struct  ProjectOptions
 Options for project(). More...
 
class  RayCaster
 A ray caster built on top of Embree that operates directly on SurfaceMesh and SimpleScene objects. More...
 
struct  RayHit
 Result of a single-ray intersection query. More...
 
struct  RayHitN
 Result of a multi-ray intersection query. More...
 

Enumerations

enum class  ProjectMode {
  CLOSEST_VERTEX = 0 , CLOSEST_POINT = 1 , RAY_CASTING = 2 , ClosestVertex = 0 ,
  ClosestPoint = 1 , RayCasting
}
 Main projection mode. More...
 
enum class  CastMode { ONE_WAY = 0 , BOTH_WAYS = 1 , OneWay = 0 , BothWays = 1 }
 Ray-casting mode. More...
 
enum class  FallbackMode {
  CONSTANT = 0 , CLOSEST_VERTEX = 1 , CLOSEST_POINT = 2 , Constant = 0 ,
  ClosestVertex = 1 , ClosestPoint = 2
}
 Fallback mode for vertices without a hit. More...
 
enum class  SceneFlags {
  None = 0 , Dynamic = 1 << 0 , Compact = 1 << 1 , Robust = 1 << 2 ,
  Filter = 1 << 3
}
 Flags for configuring the ray caster and the underlying Embree scene. More...
 
enum class  BuildQuality { Low = 0 , Medium = 1 , High = 2 }
 Quality levels for BVH construction. More...
 
enum class  FallbackMode
 Fallback mode for vertices without a hit.
 

Functions

const std::map< std::string, ProjectMode > & project_modes ()
 <
 
const std::map< std::string, CastMode > & cast_modes ()
 
const std::map< std::string, FallbackMode > & fallback_modes ()
 
const std::map< std::string, FallbackMode > & wrap_modes ()
 
template<typename Scalar, typename Index>
LA_RAYCASTING_API void project (const SurfaceMesh< Scalar, Index > &source, SurfaceMesh< Scalar, Index > &target, const ProjectOptions &options={}, const RayCaster *ray_caster=nullptr)
 Project vertex attributes from one mesh to another.
 
template<typename Scalar, typename Index>
LA_RAYCASTING_API void project_closest_point (const SurfaceMesh< Scalar, Index > &source, SurfaceMesh< Scalar, Index > &target, const ProjectCommonOptions &options={}, const RayCaster *ray_caster=nullptr)
 Project vertex attributes from one mesh to another, by copying attributes from the closest point on the input mesh.
 
template<typename Scalar, typename Index>
LA_RAYCASTING_API void project_closest_vertex (const SurfaceMesh< Scalar, Index > &source, SurfaceMesh< Scalar, Index > &target, const ProjectCommonOptions &options={}, const RayCaster *ray_caster=nullptr)
 Project vertex attributes from one mesh to another, by copying attributes from the closest vertex on the source mesh surface.
 
template<typename Scalar, typename Index>
LA_RAYCASTING_API void project_directional (const SurfaceMesh< Scalar, Index > &source, SurfaceMesh< Scalar, Index > &target, const ProjectDirectionalOptions &options={}, const RayCaster *ray_caster=nullptr)
 Project vertex attributes from one mesh to another, by projecting target vertices along a prescribed direction, and interpolating surface values from facet corners of the source mesh.
 
template<typename Scalar, typename Index>
std::vector< AttributeIdprepare_attribute_ids (const SurfaceMesh< Scalar, Index > &source, const ProjectCommonOptions &options)
 
template<typename Scalar, typename Index>
std::unique_ptr< RayCasterprepare_ray_caster (const SurfaceMesh< Scalar, Index > &source, const RayCaster *ray_caster)
 
template<typename Scalar, typename Index>
void project (const SurfaceMesh< Scalar, Index > &source, SurfaceMesh< Scalar, Index > &target, const ProjectOptions &options, const RayCaster *ray_caster)
 Project vertex attributes from one mesh to another.
 
template<typename Scalar, typename Index>
void project_closest_point (const SurfaceMesh< Scalar, Index > &source, SurfaceMesh< Scalar, Index > &target, const ProjectCommonOptions &options, const RayCaster *ray_caster)
 Project vertex attributes from one mesh to another, by copying attributes from the closest point on the input mesh.
 
template<typename Scalar, typename Index>
void project_closest_vertex (const SurfaceMesh< Scalar, Index > &source, SurfaceMesh< Scalar, Index > &target, const ProjectCommonOptions &options, const RayCaster *ray_caster)
 Project vertex attributes from one mesh to another, by copying attributes from the closest vertex on the source mesh surface.
 
template<typename Scalar, typename Index>
void project_directional (const SurfaceMesh< Scalar, Index > &source, SurfaceMesh< Scalar, Index > &target, const ProjectDirectionalOptions &options, const RayCaster *ray_caster)
 Project vertex attributes from one mesh to another, by projecting target vertices along a prescribed direction, and interpolating surface values from facet corners of the source mesh.
 

Detailed Description

Raycasting operations.

Enumeration Type Documentation

◆ ProjectMode

enum class ProjectMode
strong

Main projection mode.

Enumerator
CLOSEST_VERTEX 
Deprecated
Use ClosestVertex instead.
CLOSEST_POINT 
Deprecated
Use ClosestPoint instead.
RAY_CASTING 
Deprecated
Use RayCasting instead.
ClosestVertex 

Copy attribute from the closest vertex on the source mesh.

ClosestPoint 

Interpolate attribute from the closest point on the source mesh.

RayCasting 

Copy attribute by projecting along a prescribed direction on the source mesh.

◆ CastMode

enum class CastMode
strong

Ray-casting mode.

Enumerator
ONE_WAY 
Deprecated
Use OneWay instead.
BOTH_WAYS 
Deprecated
Use BothWays instead.
OneWay 

Cast a ray forward in the prescribed direction.

BothWays 

Cast a ray both forward and backward in the prescribed direction.

◆ FallbackMode

enum class FallbackMode
strong

Fallback mode for vertices without a hit.

Enumerator
CONSTANT 
Deprecated
Use Constant instead.
CLOSEST_VERTEX 
Deprecated
Use ClosestVertex instead.
CLOSEST_POINT 
Deprecated
Use ClosestPoint instead.
Constant 

Fill with a constant value (defaults to 0).

ClosestVertex 

Copy attribute from the closest vertex on the source mesh.

ClosestPoint 

Interpolate attribute from the closest point on the source mesh.

◆ SceneFlags

enum class SceneFlags
strong

Flags for configuring the ray caster and the underlying Embree scene.

These flags are passed to the RayCaster constructor and control how the BVH is built and traversed.

Enumerator
None 

No special behavior.

Dynamic 

Indicates that the scene will be updated frequently.

Compact 

Use a more compact BVH layout that may be faster to build but slower to traverse.

Robust 

Use a more robust BVH traversal algorithm that is slower but less likely to miss hits due to numerical issues.

Filter 

Enable user-defined intersection and occlusion filters.

◆ BuildQuality

enum class BuildQuality
strong

Quality levels for BVH construction.

Higher quality typically results in faster ray queries but longer build times.

Enumerator
Low 

Fastest build time, lowest BVH quality.

Medium 

Moderate build time and BVH quality.

High 

Slowest build time, highest BVH quality.

Function Documentation

◆ project_modes()

const std::map< std::string, ProjectMode > & project_modes ( )
inline

<

Deprecated
Use FallbackMode instead.