#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/develop/src/axom/quest/SignedDistance.hpp>
|
| SignedDistance (const mint::Mesh *surfaceMesh, bool isWatertight, bool computeSign=true, int allocatorID=axom::execution_space< ExecSpace >::allocatorID()) |
| Creates a SignedDistance instance for queries on the given mesh. More...
|
|
bool | setMesh (const mint::Mesh *surfaceMesh, int allocatorID=axom::execution_space< ExecSpace >::allocatorID()) |
| Reinitializes a SignedDistance instance with a new surface mesh. More...
|
|
double | computeDistance (double x, double y, double z=0.0) |
| Computes the distance of the given point to the input surface mesh. More...
|
|
double | computeDistance (const PointType &queryPnt) const |
| Computes the distance of the given point to the surface mesh. More...
|
|
double | computeDistance (const PointType &queryPnt, PointType &closestPnt, VectorType &surfaceNormal) const |
| Computes the distance of the given point to the surface mesh This overload also returns the computed closest point on the surface to the query point and the surface normal at that point. More...
|
|
template<typename PointIndexable > |
void | computeDistances (int npts, PointIndexable queryPts, double *outSgnDist, PointType *outClosestPts=nullptr, VectorType *outNormals=nullptr) const |
| Computes the distances of a set of points to the surface mesh. Optionally also returns the computed closest points on the surface to each query point and the surface normals at those points. More...
|
|
const BVHTreeType & | getBVHTree () const |
| Returns a const reference to the underlying bucket tree. More...
|
|
◆ PointType
template<int NDIMS, typename ExecSpace = axom::SEQ_EXEC>
◆ VectorType
template<int NDIMS, typename ExecSpace = axom::SEQ_EXEC>
◆ TriangleType
template<int NDIMS, typename ExecSpace = axom::SEQ_EXEC>
◆ BoxType
template<int NDIMS, typename ExecSpace = axom::SEQ_EXEC>
◆ ZipPoint
template<int NDIMS, typename ExecSpace = axom::SEQ_EXEC>
◆ BVHTreeType
template<int NDIMS, typename ExecSpace = axom::SEQ_EXEC>
◆ SignedDistance()
template<int NDIMS, typename ExecSpace >
Creates a SignedDistance instance for queries on the given mesh.
- Parameters
-
[in] | surfaceMesh | user-supplied surface mesh. |
[in] | isWatertight | indicates if the surface mesh is closed. |
[in] | computeSign | indicates if distance queries should compute signs (optional). |
[in] | allocatorID | the allocator to create the underlying BVH with (optional). |
- Note
- computeSign defaults to true when not specified.
-
The given surface mesh must be allocated in a memory space compatible with the execution space specified in the SignedDistance instantiation.
-
The given allocatorID must be compatible with the execution space specified in the SignedDistance instantiation. By default, a compatible allocator ID used if allocatorID is not specified.
- Precondition
- surfaceMesh != nullptr
References AXOM_UNUSED_VAR, axom::quest::SignedDistance< NDIMS, ExecSpace >::setMesh(), and SLIC_ASSERT.
◆ setMesh()
template<int NDIMS, typename ExecSpace >
Reinitializes a SignedDistance instance with a new surface mesh.
- Parameters
-
[in] | surfaceMesh | user-supplied surface mesh. |
[in] | allocatorID | the allocator to create the underlying BVH with (optional). |
- Note
- The given surface mesh must be allocated in a memory space compatible with the execution space specified in the SignedDistance instantiation.
-
The given allocatorID must be compatible with the execution space specified in the SignedDistance instantiation. By default, a compatible allocator ID used if allocatorID is not specified.
- Returns
- status true if reinitialization was successful.
- Precondition
- surfaceMesh != nullptr
References axom::primal::BoundingBox< T, NDIMS >::addPoint(), AXOM_ANNOTATE_SCOPE, AXOM_LAMBDA, AXOM_UNUSED_VAR, axom::spin::BVH_BUILD_OK, axom::deallocate(), axom::mint::Mesh::getNumberOfCells(), axom::utilities::max(), axom::quest::detail::SD_GetUcdMeshData(), SLIC_ASSERT, and SLIC_CHECK_MSG.
◆ computeDistance() [1/3]
template<int NDIMS, typename ExecSpace = axom::SEQ_EXEC>
Computes the distance of the given point to the input surface mesh.
- Parameters
-
[in] | x | x-coordinate of the query point |
[in] | y | y-coordinate of the query point |
[in] | z | z-coordinate of the query point |
- Note
- When the input is not a closed surface mesh, the assumption is that the surface mesh divides the computational mesh domain into two regions. Hence, the surface mesh has to span the entire domain of interest, e.g., the computational mesh at which the signed distance field is evaluated, along some plane.
- Warning
- The sign of the distance from a given query point is determined by a pseudo-normal which is computed at the closest point on the surface mesh. For a non-watertight mesh, the sign of the distance is not defined everywhere. Specifically, the sign is ambiguous for all points for which a normal projection onto the surface does not exist.
- Returns
- minimum signed distance of the query point to the surface.
◆ computeDistance() [2/3]
template<int NDIMS, typename ExecSpace >
Computes the distance of the given point to the surface mesh.
- Parameters
-
[in] | queryPnt | user-supplied point. |
- Note
- When the input is not a closed surface mesh, the assumption is that the surface mesh divides the computational mesh domain into two regions. Hence, the surface mesh has to span the entire domain of interest, e.g., the computational mesh at which the signed distance field is evaluated, along some plane.
- Warning
- The sign of the distance from a given query point is determined by a pseudo-normal which is computed at the closest point on the surface mesh. For a non-watertight mesh, the sign of the distance is not defined everywhere. Specifically, the sign is ambiguous for all points for which a normal projection onto the surface does not exist.
- Returns
- the signed minimum distance to the surface mesh.
◆ computeDistance() [3/3]
template<int NDIMS, typename ExecSpace >
Computes the distance of the given point to the surface mesh This overload also returns the computed closest point on the surface to the query point and the surface normal at that point.
- Parameters
-
[in] | queryPnt | user-supplied point. |
[out] | closestPnt | the closest point on the surface to queryPnt |
[out] | surfaceNormal | the surface normal of closestPt |
- Note
- When the underlying surface mesh is not watertight, the assumption is that the surface mesh divides the computational mesh domain into two regions. Hence, the surface mesh has to span the entire domain of interest, e.g., the computational mesh at which the signed distance field is evaluated, along some plane.
- Warning
- The sign of the distance from a given query point is determined by a pseudo-normal which is computed at the closest point on the surface mesh. For a non-watertight mesh, the sign of the distance is not defined everywhere. Specifically, the sign is ambiguous for all points for which a normal projection onto the surface does not exist.
- Returns
- the signed minimum distance to the surface mesh.
◆ computeDistances()
template<int NDIMS, typename ExecSpace >
template<typename PointIndexable >
Computes the distances of a set of points to the surface mesh. Optionally also returns the computed closest points on the surface to each query point and the surface normals at those points.
- Parameters
-
[in] | npts | number of points to query |
[in] | queryPnt | user-supplied point indexable type. This can be a pointer-to-array, or a ZipIndexable<PointType>. |
[out] | outSgnDist | array to fill with corresponding signed distances for query points |
[out] | outClosestPts | array to fill with closest points on the mesh. Optional. |
[out] | outNormals | array to fill with surface normals associated with closest points on the mesh. Optional. |
- Note
- When the input is not a closed surface mesh, the assumption is that the surface mesh divides the computational mesh domain into two regions. Hence, the surface mesh has to span the entire domain of interest, e.g., the computational mesh at which the signed distance field is evaluated, along some plane.
- Warning
- The sign of the distance from a given query point is determined by a pseudo-normal which is computed at the closest point on the surface mesh. For a non-watertight mesh, the sign of the distance is not defined everywhere. Specifically, the sign is ambiguous for all points for which a normal projection onto the surface does not exist.
- Returns
- the signed minimum distance to the surface mesh.
- Precondition
- outSgnDist != nullptr
References AXOM_ANNOTATE_SCOPE, AXOM_LAMBDA, AXOM_UNUSED_VAR, axom::primal::BoundingBox< T, NDIMS >::contains(), axom::quest::detail::SD_GetUcdMeshData(), SLIC_ASSERT, SLIC_CHECK_MSG, axom::primal::squared_distance(), and axom::primal::Vector< T, NDIMS >::unitVector().
◆ getBVHTree()
template<int NDIMS, typename ExecSpace = axom::SEQ_EXEC>
Returns a const reference to the underlying bucket tree.
- Returns
- ptr pointer to the underlying bucket tree
The documentation for this class was generated from the following file:
- /home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/develop/src/axom/quest/SignedDistance.hpp