PhysicsBasedAnimationToolkit 0.0.10
Cross-platform C++20 library of algorithms and data structures commonly used in computer graphics research on physically-based simulation.
Loading...
Searching...
No Matches
ClosestPointQueries.h File Reference

This file contains functions to answer closest point queries. More...

#include "pbat/HostDevice.h"
#include "pbat/math/linalg/mini/Mini.h"
#include <algorithm>
#include <cassert>

Go to the source code of this file.

Namespaces

namespace  pbat
 The main namespace of the library.
 
namespace  pbat::geometry
 Geometric queries, quantities and data structures.
 
namespace  pbat::geometry::ClosestPointQueries
 This namespace contains functions to answer closest point queries.
 

Functions

template<mini::CMatrix TMatrixX, mini::CMatrix TMatrixP, mini::CMatrix TMatrixN>
PBAT_HOST_DEVICE auto pbat::geometry::ClosestPointQueries::PointOnPlane (TMatrixX const &X, TMatrixP const &P, TMatrixN const &n) -> mini::SVector< typename TMatrixX::ScalarType, TMatrixX::kRows >
 Obtain the point on the plane (P,n) closest to the point X.
 
template<mini::CMatrix TMatrixX, mini::CMatrix TMatrixP, mini::CMatrix TMatrixQ>
PBAT_HOST_DEVICE auto pbat::geometry::ClosestPointQueries::PointOnLineSegment (TMatrixX const &X, TMatrixP const &P, TMatrixQ const &Q) -> mini::SVector< typename TMatrixX::ScalarType, TMatrixX::kRows >
 Obtain the point on the line segment PQ closest to the point X.
 
template<mini::CMatrix TMatrixX, mini::CMatrix TMatrixL, mini::CMatrix TMatrixU>
PBAT_HOST_DEVICE auto pbat::geometry::ClosestPointQueries::PointOnAxisAlignedBoundingBox (TMatrixX const &X, TMatrixL const &L, TMatrixU const &U) -> mini::SVector< typename TMatrixX::ScalarType, TMatrixX::kRows >
 Obtain the point on the axis-aligned bounding box (AABB) defined by the lower and upper corners closest to the point X.
 
template<mini::CMatrix TMatrixP, mini::CMatrix TMatrixA, mini::CMatrix TMatrixB, mini::CMatrix TMatrixC>
PBAT_HOST_DEVICE auto pbat::geometry::ClosestPointQueries::UvwPointInTriangle (TMatrixP const &P, TMatrixA const &A, TMatrixB const &B, TMatrixC const &C) -> mini::SVector< typename TMatrixP::ScalarType, 3 >
 Obtain the point on the triangle ABC closest to the point P in barycentric coordinates.
 
template<mini::CMatrix TMatrixP, mini::CMatrix TMatrixA, mini::CMatrix TMatrixB, mini::CMatrix TMatrixC>
PBAT_HOST_DEVICE auto pbat::geometry::ClosestPointQueries::PointInTriangle (TMatrixP const &P, TMatrixA const &A, TMatrixB const &B, TMatrixC const &C) -> mini::SVector< typename TMatrixP::ScalarType, TMatrixP::kRows >
 Obtain the point on the triangle ABC closest to the point P.
 
template<mini::CMatrix TMatrixP, mini::CMatrix TMatrixA, mini::CMatrix TMatrixB, mini::CMatrix TMatrixC, mini::CMatrix TMatrixD>
PBAT_HOST_DEVICE auto pbat::geometry::ClosestPointQueries::PointInTetrahedron (TMatrixP const &P, TMatrixA const &A, TMatrixB const &B, TMatrixC const &C, TMatrixD const &D) -> mini::SVector< typename TMatrixP::ScalarType, TMatrixP::kRows >
 Obtain the point in the tetrahedron ABCD closest to the point P. The order of ABCD must be such that all faces ABC, ACD, ADB and BDC are oriented with outwards pointing normals when viewed from outside the tetrahedron.
 
template<mini::CMatrix TMatrixP1, mini::CMatrix TMatrixQ1, mini::CMatrix TMatrixP2, mini::CMatrix TMatrixQ2, class TScalar = typename TMatrixP1::ScalarType>
PBAT_HOST_DEVICE auto pbat::geometry::ClosestPointQueries::Lines (TMatrixP1 const &P1, TMatrixQ1 const &Q1, TMatrixP2 const &P2, TMatrixQ2 const &Q2, TScalar eps=std::numeric_limits< TScalar >::min()) -> mini::SVector< TScalar, 2 >
 Find closest points on two lines defined by points P1, Q1 and P2, Q2.
 

Detailed Description

This file contains functions to answer closest point queries.

Author
Quoc-Minh Ton-That (tonth.nosp@m.at.q.nosp@m.uocmi.nosp@m.nh@g.nosp@m.mail..nosp@m.com)
Date
2025-02-12