AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
axom::quest::SignedDistance< NDIMS > Class Template Reference

#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/v0.5.0/src/axom/quest/SignedDistance.hpp>

Public Types

using PointType = axom::primal::Point< double, NDIMS >
 
using VectorType = axom::primal::Vector< double, NDIMS >
 
using TriangleType = axom::primal::Triangle< double, NDIMS >
 
using BoxType = axom::primal::BoundingBox< double, NDIMS >
 
using BVHTreeType = axom::spin::BVHTree< int, NDIMS >
 

Public Member Functions

 SignedDistance (const mint::Mesh *surfaceMesh, bool isWatertight, int maxObjects, int maxLevels, bool computeSign=true)
 Creates a SignedDistance instance for queries on the given mesh. More...
 
 ~SignedDistance ()
 Destructor. 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, std::vector< int > &bvh_buckets, std::vector< axom::IndexType > &triangles, std::vector< axom::IndexType > &my_triangles, PointType &closest_pt) const
 Computes the distance of the given point to the surface mesh. More...
 
const BVHTreeTypegetBVHTree () const
 Returns a const reference to the underlying bucket tree. More...
 

Member Typedef Documentation

◆ PointType

template<int NDIMS>
using axom::quest::SignedDistance< NDIMS >::PointType = axom::primal::Point<double, NDIMS>

◆ VectorType

template<int NDIMS>
using axom::quest::SignedDistance< NDIMS >::VectorType = axom::primal::Vector<double, NDIMS>

◆ TriangleType

template<int NDIMS>
using axom::quest::SignedDistance< NDIMS >::TriangleType = axom::primal::Triangle<double, NDIMS>

◆ BoxType

template<int NDIMS>
using axom::quest::SignedDistance< NDIMS >::BoxType = axom::primal::BoundingBox<double, NDIMS>

◆ BVHTreeType

template<int NDIMS>
using axom::quest::SignedDistance< NDIMS >::BVHTreeType = axom::spin::BVHTree<int, NDIMS>

Constructor & Destructor Documentation

◆ SignedDistance()

template<int NDIMS>
axom::quest::SignedDistance< NDIMS >::SignedDistance ( const mint::Mesh surfaceMesh,
bool  isWatertight,
int  maxObjects,
int  maxLevels,
bool  computeSign = true 
)

Creates a SignedDistance instance for queries on the given mesh.

Parameters
[in]surfaceMeshuser-supplied surface mesh.
[in]isWatertightindicates if the surface mesh is closed.
[in]maxObjectsmax number of objects for spatial decomposition.
[in]maxLevelsmax levels for spatial decomposition.
[in]computeSignindicates if distance queries should compute signs (optional).
Note
computeSign defaults to true when not specified.
Precondition
surfaceMesh != nullptr

References axom::primal::BoundingBox< T, NDIMS >::addPoint(), axom::spin::BVHTree< T, NDIMS >::build(), axom::mint::Mesh::getCoordinateArray(), axom::mint::Mesh::getNumberOfCells(), axom::mint::Mesh::getNumberOfNodes(), axom::spin::BVHTree< T, NDIMS >::insert(), and SLIC_ASSERT.

◆ ~SignedDistance()

template<int NDIMS>
axom::quest::SignedDistance< NDIMS >::~SignedDistance ( )

Destructor.

Member Function Documentation

◆ computeDistance() [1/3]

template<int NDIMS>
double axom::quest::SignedDistance< NDIMS >::computeDistance ( double  x,
double  y,
double  z = 0.0 
)
inline

Computes the distance of the given point to the input surface mesh.

Parameters
[in]xx-coordinate of the query point
[in]yy-coordinate of the query point
[in]zz-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
minDist minimum signed distance of the query point to the surface.

References axom::primal::Point< double, NDIMS >::make_point().

Referenced by axom::quest::SignedDistance< NDIMS >::computeDistance().

◆ computeDistance() [2/3]

template<int NDIMS>
double axom::quest::SignedDistance< NDIMS >::computeDistance ( const PointType queryPnt) const
inline

Computes the distance of the given point to the surface mesh.

Parameters
[in]queryPntuser-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
minDist the signed minimum distance to the surface mesh.

References axom::primal::BoundingBox< T, NDIMS >::addPoint(), AXOM_DEBUG_PARAM, axom::primal::closest_point(), axom::quest::SignedDistance< NDIMS >::computeDistance(), axom::primal::BoundingBox< T, NDIMS >::contains(), axom::primal::Point< T, NDIMS >::data(), axom::primal::Vector< T, NDIMS >::dot(), axom::spin::BVHTree< T, NDIMS >::find(), axom::spin::BVHTree< T, NDIMS >::getBucketNumObjects(), axom::spin::BVHTree< T, NDIMS >::getBucketObjectArray(), axom::mint::getCellInfo(), axom::mint::Mesh::getCellNodeIDs(), axom::mint::Mesh::getCellType(), axom::mint::Mesh::getNode(), axom::spin::BVHTree< T, NDIMS >::getObjectBox(), axom::spin::BVHTree< T, NDIMS >::getObjectData(), axom::primal::BoundingBox< double, NDIMS >::getPoints(), axom::utilities::isNearlyEqual(), axom::utilities::max(), axom::utilities::min(), axom::mint::CellInfo::num_nodes, axom::primal::Triangle< T, NDIMS >::NUM_TRI_VERTS, axom::mint::QUAD, axom::mint::SEGMENT, SLIC_ASSERT, axom::primal::squared_distance(), and axom::mint::TRIANGLE.

◆ computeDistance() [3/3]

template<int NDIMS>
double axom::quest::SignedDistance< NDIMS >::computeDistance ( const PointType queryPnt,
std::vector< int > &  bvh_buckets,
std::vector< axom::IndexType > &  triangles,
std::vector< axom::IndexType > &  my_triangles,
PointType closest_pt 
) const

Computes the distance of the given point to the surface mesh.

Note
This is an overloaded method that also returns the BVH buckets and corresponding triangles used to calculate the signed distance.
Parameters
[in]queryPntuser-supplied point.
[out]bvh_bucketsthe buckets of the BVH used to satisfy the query.
[out]trianglesthe triangles of the BVH used to satisfy the query.
[out]my_trianglesthe triangle used to compute the pseudo-normal.
Note
The variables 'triangles'/'my_triangles' are relevant in debug mode.
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
minDist the minimum signed distance to the surface mesh.

◆ getBVHTree()

template<int NDIMS>
const BVHTreeType* axom::quest::SignedDistance< NDIMS >::getBVHTree ( ) const
inline

Returns a const reference to the underlying bucket tree.

Returns
ptr pointer to the underlying bucket tree
Postcondition
ptr != nullptr

References DISABLE_COPY_AND_ASSIGNMENT.


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