|
Lagrange
|
Classes | |
| struct | LocalFeatureSizeOptions |
| Options for compute_local_feature_size(). More... | |
| struct | ProjectCommonOptions |
| Common options for projection functions. More... | |
| struct | ProjectDirectionalOptions |
| Options for project_directional(). More... | |
| struct | ProjectOptions |
| Options for project(). More... | |
| struct | OccludedFacetSamplerOptions |
| Options for OccludedFacetSampler. More... | |
| class | OccludedFacetSampler< Scalar, Index > |
| Stateful algorithm for finding occluded facets across every instance of a scene. More... | |
| struct | OccludedFacetEstimateOptions |
| Loop options for estimate_occluded_facets() and remove_occluded_facets(). More... | |
| struct | RemoveOccludedFacetsOptions |
| Options for remove_occluded_facets(). More... | |
| class | OccludedInstanceSampler< Scalar, Index > |
| Stateful algorithm for finding occluded instances in a scene. More... | |
| struct | OccludedInstanceEstimateOptions |
| Loop options for estimate_occluded_instances() and remove_occluded_instances(). More... | |
Enumerations | |
| enum class | RayDirectionMode { Interior , Exterior , Both } |
| Ray direction mode for local feature size computation. More... | |
Functions | |
| template<typename Scalar, typename Index> | |
| LA_RAYCASTING_API AttributeId | compute_local_feature_size (SurfaceMesh< Scalar, Index > &mesh, const LocalFeatureSizeOptions &options={}, const RayCaster *ray_caster=nullptr) |
| Compute local feature size for each vertex of a mesh using medial axis approximation. | |
| 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> | |
| LA_RAYCASTING_API void | estimate_occluded_facets (OccludedFacetSampler< Scalar, Index > &sampler, const OccludedFacetEstimateOptions &options, ProgressCallback &progress, const std::atomic_bool *cancel=nullptr) |
| Drive an OccludedFacetSampler progressively until the budget is exhausted, the search converges, or cancellation is requested. | |
| template<typename Scalar, typename Index> | |
| LA_RAYCASTING_API scene::SimpleScene< Scalar, Index, 3 > | remove_occluded_facets (const scene::SimpleScene< Scalar, Index, 3 > &scene, const RemoveOccludedFacetsOptions &options, ProgressCallback &progress, function_ref< bool(Index mesh_index, Index instance_index)> is_occluder=[](Index, Index) { return true;}, const std::atomic_bool *cancel=nullptr) |
| Build a new scene with facets not visible from the outside removed. | |
| template<typename Scalar, typename Index> | |
| LA_RAYCASTING_API void | estimate_occluded_instances (OccludedInstanceSampler< Scalar, Index > &sampler, const OccludedInstanceEstimateOptions &options, ProgressCallback &progress, const std::atomic_bool *cancel=nullptr) |
| Drive an OccludedInstanceSampler progressively. | |
| template<typename Scalar, typename Index> | |
| LA_RAYCASTING_API void | estimate_occluded_instances (const scene::SimpleScene< Scalar, Index, 3 > &scene, function_ref< void(Index mesh_index, Index instance_index)> callback, const OccludedInstanceEstimateOptions &options, ProgressCallback &progress, function_ref< bool(Index mesh_index, Index instance_index)> is_occluder=[](Index, Index) { return true;}, const std::atomic_bool *cancel=nullptr) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Convenience wrapper that builds an OccludedInstanceSampler internally and reports each occluded instance via callback. | |
| template<typename Scalar, typename Index> | |
| LA_RAYCASTING_API scene::SimpleScene< Scalar, Index, 3 > | remove_occluded_instances (const scene::SimpleScene< Scalar, Index, 3 > &scene, const OccludedInstanceEstimateOptions &options, ProgressCallback &progress, function_ref< bool(Index mesh_index, Index instance_index)> is_occluder=[](Index, Index) { return true;}, const std::atomic_bool *cancel=nullptr) |
| Remove fully-occluded mesh instances. | |
|
strong |
#include <lagrange/raycasting/compute_local_feature_size.h>
Ray direction mode for local feature size computation.
| LA_RAYCASTING_API AttributeId compute_local_feature_size | ( | SurfaceMesh< Scalar, Index > & | mesh, |
| const LocalFeatureSizeOptions & | options = {}, | ||
| const RayCaster * | ray_caster = nullptr ) |
#include <lagrange/raycasting/compute_local_feature_size.h>
Compute local feature size for each vertex of a mesh using medial axis approximation.
For each vertex, this function:
Interior mode, rays are cast inward (negative normal direction). For Exterior mode, rays are cast outward (positive normal direction). For Both mode, rays are cast in both directions and the minimum LFS is taken.default_lfs value is used as a fallback.| [in,out] | mesh | Mesh to process (must be a triangle mesh). The mesh is modified to add the local feature size attribute. |
| [in] | options | Options for local feature size computation. |
| [in] | ray_caster | If provided, use this ray caster to perform the queries. The mesh must have been added to the ray caster in advance, and the scene must have been committed. If nullptr, a temporary ray caster will be created internally. |
| Scalar | Mesh scalar type. |
| Index | Mesh index type. |
| LA_RAYCASTING_API void project | ( | const SurfaceMesh< Scalar, Index > & | source, |
| SurfaceMesh< Scalar, Index > & | target, | ||
| const ProjectOptions & | options = {}, | ||
| const RayCaster * | ray_caster = nullptr ) |
#include <lagrange/raycasting/project.h>
Project vertex attributes from one mesh to another.
Different projection modes can be prescribed.
By default, vertex positions are projected. Additional attributes to project can be specified via options.attribute_ids. Set options.project_vertices to false to skip vertex positions.
| [in] | source | Source mesh (must be a triangle mesh). |
| [in,out] | target | Target mesh to be modified. |
| [in] | options | Projection options. |
| [in] | ray_caster | If provided, use this ray caster to perform the queries. The source mesh must have been added to the ray caster in advance, and the scene must have been committed. If nullptr, a temporary ray caster will be created internally. |
| Scalar | Mesh scalar type. |
| Index | Mesh index type. |
| LA_RAYCASTING_API void project_closest_point | ( | const SurfaceMesh< Scalar, Index > & | source, |
| SurfaceMesh< Scalar, Index > & | target, | ||
| const ProjectCommonOptions & | options = {}, | ||
| const RayCaster * | ray_caster = nullptr ) |
#include <lagrange/raycasting/project_closest_point.h>
Project vertex attributes from one mesh to another, by copying attributes from the closest point on the input mesh.
Values are linearly interpolated from the face corners.
By default, vertex positions are projected. Additional attributes to project can be specified via options.attribute_ids. Set options.project_vertices to false to skip vertex positions.
| [in] | source | Source mesh (must be a triangle mesh). |
| [in,out] | target | Target mesh to be modified. |
| [in] | options | Projection options. |
| [in] | ray_caster | If provided, use this ray caster to perform the queries. The source mesh must have been added to the ray caster in advance, and the scene must have been committed. If nullptr, a temporary ray caster will be created internally. |
| Scalar | Mesh scalar type. |
| Index | Mesh index type. |
| LA_RAYCASTING_API void project_closest_vertex | ( | const SurfaceMesh< Scalar, Index > & | source, |
| SurfaceMesh< Scalar, Index > & | target, | ||
| const ProjectCommonOptions & | options = {}, | ||
| const RayCaster * | ray_caster = nullptr ) |
#include <lagrange/raycasting/project_closest_vertex.h>
Project vertex attributes from one mesh to another, by copying attributes from the closest vertex on the source mesh surface.
The closest surface point is found via a closest-point query, then snapped to the nearest vertex of the hit triangle (the vertex with the largest barycentric weight).
By default, vertex positions are projected. Additional attributes to project can be specified via options.attribute_ids. Set options.project_vertices to false to skip vertex positions.
| [in] | source | Source mesh (must be a triangle mesh). |
| [in,out] | target | Target mesh to be modified. |
| [in] | options | Projection options. |
| [in] | ray_caster | If provided, use this ray caster to perform the queries. The source mesh must have been added to the ray caster in advance, and the scene must have been committed. If nullptr, a temporary ray caster will be created internally. |
| Scalar | Mesh scalar type. |
| Index | Mesh index type. |
| LA_RAYCASTING_API void project_directional | ( | const SurfaceMesh< Scalar, Index > & | source, |
| SurfaceMesh< Scalar, Index > & | target, | ||
| const ProjectDirectionalOptions & | options = {}, | ||
| const RayCaster * | ray_caster = nullptr ) |
#include <lagrange/raycasting/project_directional.h>
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.
By default, vertex positions are projected. Additional attributes to project can be specified via options.attribute_ids. Set options.project_vertices to false to skip vertex positions.
| [in] | source | Source mesh (must be a triangle mesh). |
| [in,out] | target | Target mesh to be modified. |
| [in] | options | Projection options. |
| [in] | ray_caster | If provided, use this ray caster to perform the queries. The source mesh must have been added to the ray caster in advance, and the scene must have been committed. If nullptr, a temporary ray caster will be created internally. |
| Scalar | Mesh scalar type. |
| Index | Mesh index type. |
| LA_RAYCASTING_API void estimate_occluded_facets | ( | OccludedFacetSampler< Scalar, Index > & | sampler, |
| const OccludedFacetEstimateOptions & | options, | ||
| ProgressCallback & | progress, | ||
| const std::atomic_bool * | cancel = nullptr ) |
#include <lagrange/raycasting/remove_occluded_facets.h>
Drive an OccludedFacetSampler progressively until the budget is exhausted, the search converges, or cancellation is requested.
Logs per-cycle progress via lagrange::logger() and reports a normalized [0, 1] fraction to progress.
The caller can inspect sampler after the call returns to retrieve per-element stats, build an output scene, etc.
| [in,out] | sampler | Sampler to drive. |
| [in] | options | Estimate options. |
| [in,out] | progress | Progress callback (default-constructed = silent). |
| [in] | cancel | Optional cancellation flag, polled at cycle boundaries. |
| Scalar | Mesh scalar type. |
| Index | Mesh index type. |
| LA_RAYCASTING_API scene::SimpleScene< Scalar, Index, 3 > remove_occluded_facets | ( | const scene::SimpleScene< Scalar, Index, 3 > & | scene, |
| const RemoveOccludedFacetsOptions & | options, | ||
| ProgressCallback & | progress, | ||
| function_ref< bool(Index mesh_index, Index instance_index)> | is_occluder = [](Index, Index) { return true;}, | ||
| const std::atomic_bool * | cancel = nullptr ) |
#include <lagrange/raycasting/remove_occluded_facets.h>
Build a new scene with facets not visible from the outside removed.
The output contains one unique mesh per input instance: instances of the same source mesh can end up with different facets culled, so the input's instancing cannot be preserved.
| [in] | scene | Input scene. |
| [in] | options | Options. |
| [in,out] | progress | Progress callback (see estimate_occluded_facets). |
| [in] | is_occluder | Forwarded to the underlying OccludedFacetSampler ctor. |
| [in] | cancel | Optional cancellation flag. |
| Scalar | Mesh scalar type. |
| Index | Mesh index type. |
| LA_RAYCASTING_API void estimate_occluded_instances | ( | OccludedInstanceSampler< Scalar, Index > & | sampler, |
| const OccludedInstanceEstimateOptions & | options, | ||
| ProgressCallback & | progress, | ||
| const std::atomic_bool * | cancel = nullptr ) |
#include <lagrange/raycasting/remove_occluded_instances.h>
Drive an OccludedInstanceSampler progressively.
See estimate_occluded_facets for the shared semantics; the only difference here is per-batch (rather than per-cycle) granularity.
| [in,out] | sampler | Sampler to drive. |
| [in] | options | Estimate options. |
| [in,out] | progress | Progress callback (default-constructed = silent). |
| [in] | cancel | Optional cancellation flag, polled at batch boundaries. |
| Scalar | Mesh scalar type. |
| Index | Mesh index type. |
| LA_RAYCASTING_API void estimate_occluded_instances | ( | const scene::SimpleScene< Scalar, Index, 3 > & | scene, |
| function_ref< void(Index mesh_index, Index instance_index)> | callback, | ||
| const OccludedInstanceEstimateOptions & | options, | ||
| ProgressCallback & | progress, | ||
| function_ref< bool(Index mesh_index, Index instance_index)> | is_occluder = [](Index, Index) { return true;}, | ||
| const std::atomic_bool * | cancel = nullptr ) |
#include <lagrange/raycasting/remove_occluded_instances.h>
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Convenience wrapper that builds an OccludedInstanceSampler internally and reports each occluded instance via callback.
| [in] | scene | Scene to process. |
| [in] | callback | Called as callback(mesh_index, instance_index). |
| [in] | options | Options. |
| [in,out] | progress | Progress callback. |
| [in] | is_occluder | Forwarded to OccludedInstanceSampler ctor: returns whether (mesh_index, instance_index) should block rays. Non-occluder instances are still tested for visibility but don't contribute to the ray-caster scene. |
| [in] | cancel | Optional cancellation flag. |
| Scalar | Mesh scalar type. |
| Index | Mesh index type. |
| LA_RAYCASTING_API scene::SimpleScene< Scalar, Index, 3 > remove_occluded_instances | ( | const scene::SimpleScene< Scalar, Index, 3 > & | scene, |
| const OccludedInstanceEstimateOptions & | options, | ||
| ProgressCallback & | progress, | ||
| function_ref< bool(Index mesh_index, Index instance_index)> | is_occluder = [](Index, Index) { return true;}, | ||
| const std::atomic_bool * | cancel = nullptr ) |
#include <lagrange/raycasting/remove_occluded_instances.h>
Remove fully-occluded mesh instances.
Convenience wrapper around estimate_occluded_instances + scene::filter_instances.
| [in] | scene | Scene to process. |
| [in] | options | Options. |
| [in,out] | progress | Progress callback. |
| [in] | is_occluder | Forwarded to the underlying sampler — see estimate_occluded_instances. Non-occluders are still candidates for removal but don't block rays from others. |
| [in] | cancel | Optional cancellation flag. |
| Scalar | Mesh scalar type. |
| Index | Mesh index type. |