This chapter represents documentation about AABB Tree. More...
Typedefs | |
| using | MR::FaceTreeTraits3 = AABBTreeTraits<FaceTag, Box3f> |
| template<typename V> | |
| using | MR::LineTreeTraits = AABBTreeTraits<UndirectedEdgeTag, Box<V>> |
| using | MR::LineTreeTraits2 = LineTreeTraits<Vector2f> |
| using | MR::LineTreeTraits3 = LineTreeTraits<Vector3f> |
| template<typename T> | |
| using | MR::AABBTreeNodeVec = Vector<AABBTreeNode<T>, NodeId> |
| using | MR::PreciseCollisionResult = std::vector<VarEdgeTri> |
| using | MR::TriangleCallback = std::function<ProcessOneResult( const Vector3f & p, FaceId f, const Vector3f & q, float distSq )> |
| using | MR::Line3fMesh = Line3Mesh<float> |
| using | MR::Line3dMesh = Line3Mesh<double> |
| using | MR::MeshIntersectionCallback = std::function<bool(const MeshIntersectionResult &)> |
| using | MR::FoundBoxedTriCallback = std::function<Processing( FaceId found, Ball3f & ball )> |
| using | MR::FoundTriCallback = std::function<Processing( const MeshProjectionResult & found, Ball3f & ball )> |
| this callback is invoked on every triangle at least partially in the ball, and allows changing (shrinking only) the ball | |
| template<typename T> | |
| using | MR::PolylineIntersectionCallback2 = std::function<Processing(const EdgePoint & polylinePoint, T rayPos, T & rayStart, T & rayEnd)> |
| using | MR::PolylineIntersectionCallback2f = PolylineIntersectionCallback2<float> |
| using | MR::PolylineIntersectionCallback2d = PolylineIntersectionCallback2<double> |
| template<typename V> | |
| using | MR::FoundEdgeCallback = std::function<void( UndirectedEdgeId, const V& closestPt, float distSq )> |
| using | MR::FoundEdgeCallback2 = FoundEdgeCallback<Vector2f> |
| using | MR::FoundEdgeCallback3 = FoundEdgeCallback<Vector3f> |
Functions | |
| int | MR::getNumNodes (int numLeaves) |
| returns the number of nodes in the binary tree with given number of leaves | |
| template<typename T> | |
| AABBTreeNodeVec< T > | MR::makeAABBTreeNodeVec (Buffer< BoxedLeaf< T > > boxedLeaves) |
| int | MR::getNumNodesPoints (int numPoints) |
| returns the number of nodes in the binary tree with given number of points | |
| VertId | MR::findDirMax (const Vector3f &dir, const Mesh &m, UseAABBTree u=UseAABBTree::Yes) |
| VertId | MR::findDirMax (const Vector3f &dir, const MeshPart &mp, UseAABBTree u=UseAABBTree::Yes) |
| VertId | MR::findDirMax (const Vector3f &dir, const MeshVertPart &mp, UseAABBTree u=UseAABBTree::Yes) |
| VertId | MR::findDirMax (const Vector3f &dir, const Polyline3 &polyline, UseAABBTree u=UseAABBTree::Yes) |
| VertId | MR::findDirMax (const Vector2f &dir, const Polyline2 &polyline, UseAABBTree u=UseAABBTree::Yes) |
| VertId | MR::findDirMax (const Vector3f &dir, const PointCloud &cloud, const VertBitSet *region=nullptr, UseAABBTree u=UseAABBTree::Yes) |
| VertId | MR::findDirMax (const Vector3f &dir, const AABBTreePoints &tree, const VertBitSet *region=nullptr) |
| template<typename T> | |
| void | MR::findMaxVectorDim (int &dimX, int &dimY, int &dimZ, const Vector3< T > &dir) |
| finds index of maximum axis and stores it into dimZ | |
| MR::IntersectionPrecomputes< T >::IntersectionPrecomputes ()=default | |
| MR::IntersectionPrecomputes< T >::IntersectionPrecomputes (const Vector3< T > &dir) | |
| template<typename T> | |
| void | MR::findMaxVectorDim (int &dimX, int &dimY, const Vector2< T > &dir) |
| finds index of maximum axis and stores it into dimY | |
| std::vector< FaceFace > | MR::findCollidingTriangles (const MeshPart &a, const MeshPart &b, const AffineXf3f *rigidB2A=nullptr, bool firstIntersectionOnly=false) |
| finds all pairs of colliding triangles from two meshes or two mesh regions | |
| std::pair< FaceBitSet, FaceBitSet > | MR::findCollidingTriangleBitsets (const MeshPart &a, const MeshPart &b, const AffineXf3f *rigidB2A=nullptr) |
| the same as findCollidingTriangles, but returns one bite set per mesh with colliding triangles | |
| Expected< bool > | MR::findSelfCollidingTriangles (const MeshPart &mp, std::vector< FaceFace > *outCollidingPairs, ProgressCallback cb={}, const Face2RegionMap *regionMap=nullptr, bool touchIsIntersection=false) |
| finds all pairs (or the fact of any self-collision) of colliding triangles from one mesh or a region | |
| Expected< std::vector< FaceFace > > | MR::findSelfCollidingTriangles (const MeshPart &mp, ProgressCallback cb={}, const Face2RegionMap *regionMap=nullptr, bool touchIsIntersection=false) |
| finds all pairs of colliding triangles from one mesh or a region | |
| Expected< FaceBitSet > | MR::findSelfCollidingTrianglesBS (const MeshPart &mp, ProgressCallback cb={}, const Face2RegionMap *regionMap=nullptr, bool touchIsIntersection=false) |
| the same findSelfCollidingTriangles but returns the union of all self-intersecting faces | |
| bool | MR::isInside (const MeshPart &a, const MeshPart &b, const AffineXf3f *rigidB2A=nullptr) |
| checks that arbitrary mesh part A is inside of closed mesh part B | |
| bool | MR::isNonIntersectingInside (const MeshPart &a, const MeshPart &b, const AffineXf3f *rigidB2A=nullptr) |
| checks that arbitrary mesh part A is inside of closed mesh part B The version of isInside without collision check; it is user's responsibility to guarantee that the meshes don't collide | |
| bool | MR::isNonIntersectingInside (const Mesh &a, FaceId partFace, const MeshPart &b, const AffineXf3f *rigidB2A=nullptr) |
| checks that arbitrary mesh A part (whole part is represented by one face partFace) is inside of closed mesh part B The version of isInside without collision check; it is user's responsibility to guarantee that the meshes don't collide | |
| bool | MR::operator== (const EdgeTri &a, const EdgeTri &b) |
| PreciseCollisionResult | MR::findCollidingEdgeTrisPrecise (const MeshPart &a, const MeshPart &b, ConvertToIntVector conv, const AffineXf3f *rigidB2A=nullptr, bool anyIntersection=false) |
| finds all pairs of colliding edges from one mesh and triangle from another mesh | |
| std::vector< EdgeTri > | MR::findSelfCollidingEdgeTrisPrecise (const MeshPart &mp, ConvertToIntVector conv, bool anyIntersection=false, const AffineXf3f *rigidB2A=nullptr, int aVertSizes=0) |
| finds all pairs of colliding edges and triangle within one mesh | |
| std::vector< EdgeTri > | MR::findCollidingEdgeTrisPrecise (const Mesh &a, const std::vector< EdgeId > &edgesA, const Mesh &b, const std::vector< FaceId > &facesB, ConvertToIntVector conv, const AffineXf3f *rigidB2A=nullptr) |
| finds all intersections between every given edge from A and given triangles from B | |
| std::vector< EdgeTri > | MR::findCollidingEdgeTrisPrecise (const Mesh &a, const std::vector< FaceId > &facesA, const Mesh &b, const std::vector< EdgeId > &edgesB, ConvertToIntVector conv, const AffineXf3f *rigidB2A=nullptr) |
| finds all intersections between every given triangle from A and given edge from B | |
| CoordinateConverters | MR::getVectorConverters (const MeshPart &a) |
| creates simple converters from Vector3f to Vector3i and back in mesh part area range | |
| CoordinateConverters | MR::getVectorConverters (const MeshPart &a, const MeshPart &b, const AffineXf3f *rigidB2A=nullptr) |
| creates simple converters from Vector3f to Vector3i and back in mesh parts area range | |
| void | MR::processCloseTriangles (const MeshPart &mp, const Triangle3f &t, float rangeSq, const TriangleCallback &call) |
| std::optional< float > | MR::signedDistanceToMesh (const MeshPart &mp, const Vector3f &p, const SignedDistanceToMeshOptions &op) |
| MeshIntersectionResult | MR::rayMeshIntersect (const MeshPart &meshPart, const Line3f &line, float rayStart=0.0f, float rayEnd=FLT_MAX, const IntersectionPrecomputes< float > *prec=nullptr, bool closestIntersect=true, const FacePredicate &validFaces={}) |
| MeshIntersectionResult | MR::rayMeshIntersect (const MeshPart &meshPart, const Line3d &line, double rayStart=0.0, double rayEnd=DBL_MAX, const IntersectionPrecomputes< double > *prec=nullptr, bool closestIntersect=true, const FacePredicate &validFaces={}) |
| void | MR::multiRayMeshIntersect (const MeshPart &meshPart, const std::vector< Vector3f > &origins, const std::vector< Vector3f > &dirs, const MultiRayMeshIntersectResult &result, float rayStart=0.0f, float rayEnd=FLT_MAX, bool closestIntersect=true, const FacePredicate &validFaces={}) |
| MultiMeshIntersectionResult | MR::rayMultiMeshAnyIntersect (const std::vector< Line3fMesh > &lineMeshes, float rayStart=0.0f, float rayEnd=FLT_MAX) |
| MultiMeshIntersectionResult | MR::rayMultiMeshAnyIntersect (const std::vector< Line3dMesh > &lineMeshes, double rayStart=0.0, double rayEnd=DBL_MAX) |
| Same as rayMultiMeshAnyIntersectF, but use double precision. | |
| void | MR::rayMeshIntersectAll (const MeshPart &meshPart, const Line3f &line, MeshIntersectionCallback callback, float rayStart=0.0f, float rayEnd=FLT_MAX, const IntersectionPrecomputes< float > *prec=nullptr) |
| void | MR::rayMeshIntersectAll (const MeshPart &meshPart, const Line3d &line, MeshIntersectionCallback callback, double rayStart=0.0, double rayEnd=DBL_MAX, const IntersectionPrecomputes< double > *prec=nullptr) |
| Same as rayMeshIntersectAllF, but use double precision. | |
| void | MR::planeMeshIntersect (const MeshPart &meshPart, const Plane3f &plane, FaceBitSet *fs, UndirectedEdgeBitSet *ues, VertBitSet *vs, std::vector< FaceId > *fsVec=nullptr) |
| void | MR::xyPlaneMeshIntersect (const MeshPart &meshPart, float zLevel, FaceBitSet *fs, UndirectedEdgeBitSet *ues, VertBitSet *vs, std::vector< FaceId > *fsVec=nullptr) |
| MeshMeshDistanceResult | MR::findDistance (const MeshPart &a, const MeshPart &b, const AffineXf3f *rigidB2A=nullptr, float upDistLimitSq=FLT_MAX) |
| computes minimal distance between two meshes or two mesh regions | |
| MeshMeshSignedDistanceResult | MR::findSignedDistance (const MeshPart &a, const MeshPart &b, const AffineXf3f *rigidB2A=nullptr, float upDistLimitSq=FLT_MAX) |
| computes minimal distance between two meshes | |
| MeshMeshCollisionStatus | MR::findCollisionStatus (const MeshPart &a, const MeshPart &b, const AffineXf3f *rigidB2A=nullptr) |
| finds if two meshes are touching, colliding or inside each other | |
| MeshMeshCollisionStatus | MR::findCollisionStatus (const MeshPart &a, const MeshPart &b, const MeshMeshDistanceResult &distRes, const AffineXf3f *rigidB2A=nullptr, std::vector< FaceFace > *collisions=nullptr) |
| finds if two meshes are touching, colliding or inside each other | |
| float | MR::findMaxDistanceSqOneWay (const MeshPart &a, const MeshPart &b, const AffineXf3f *rigidB2A=nullptr, float maxDistanceSq=FLT_MAX) |
| returns the maximum of the squared distances from each B-mesh vertex to A-mesh | |
| float | MR::findMaxDistanceSq (const MeshPart &a, const MeshPart &b, const AffineXf3f *rigidB2A=nullptr, float maxDistanceSq=FLT_MAX) |
| returns the squared Hausdorff distance between two meshes, that is the maximum of squared distances from each mesh vertex to the other mesh (in both directions) | |
| MeshProjectionTransforms | MR::createProjectionTransforms (AffineXf3f &storageXf, const AffineXf3f *pointXf, const AffineXf3f *treeXf) |
| Creates structure with simplified transforms for projection functions, with rigidXfPoint applied to point, and nonRigidXfTree applied to tree. | |
| MeshProjectionResult | MR::findProjection (const Vector3f &pt, const MeshPart &mp, float upDistLimitSq=FLT_MAX, const AffineXf3f *xf=nullptr, float loDistLimitSq=0, const FacePredicate &validFaces={}, const std::function< bool(const MeshProjectionResult &)> &validProjections={}) |
| computes the closest point on mesh (or its region) to given point | |
| MeshProjectionResult | MR::findProjectionSubtree (const Vector3f &pt, const MeshPart &mp, const AABBTree &tree, float upDistLimitSq=FLT_MAX, const AffineXf3f *xf=nullptr, float loDistLimitSq=0, const FacePredicate &validFaces={}, const std::function< bool(const MeshProjectionResult &)> &validProjections={}) |
| computes the closest point on mesh (or its region) to given point | |
| void | MR::findBoxedTrisInBall (const MeshPart &mp, Ball3f ball, const FoundBoxedTriCallback &foundCallback) |
| void | MR::findTrisInBall (const MeshPart &mp, const Ball3f &ball, const FoundTriCallback &foundCallback, const FacePredicate &validFaces={}) |
| std::optional< SignedDistanceToMeshResult > | MR::findSignedDistance (const Vector3f &pt, const MeshPart &mp, float upDistLimitSq=FLT_MAX, float loDistLimitSq=0) |
| computes the closest point on mesh (or its region) to given point, and finds the distance with sign to it (positive - outside, negative - inside the mesh) | |
| void | MR::findPointsInBall (const PointCloud &pointCloud, const Ball3f &ball, const OnPointInBallFound &foundCallback, const AffineXf3f *xf=nullptr) |
| MR_BIND_IGNORE void | MR::findPointsInBall (const PointCloud &pointCloud, const Ball3f &ball, const FoundPointCallback &foundCallback, const AffineXf3f *xf=nullptr) |
| void | MR::findPointsInBall (const Mesh &mesh, const Ball3f &ball, const OnPointInBallFound &foundCallback, const AffineXf3f *xf=nullptr) |
| MR_BIND_IGNORE void | MR::findPointsInBall (const Mesh &mesh, const Ball3f &ball, const FoundPointCallback &foundCallback, const AffineXf3f *xf=nullptr) |
| void | MR::findPointsInBall (const AABBTreePoints &tree, Ball3f ball, const OnPointInBallFound &foundCallback, const AffineXf3f *xf=nullptr) |
| MR_BIND_IGNORE void | MR::findPointsInBall (const AABBTreePoints &tree, const Ball3f &ball, const FoundPointCallback &foundCallback, const AffineXf3f *xf=nullptr) |
| void | MR::findPointsInBox (const PointCloud &pointCloud, const Box3f &box, const FoundPointCallback &foundCallback, const AffineXf3f *xf=nullptr) |
| void | MR::findPointsInBox (const Mesh &mesh, const Box3f &box, const FoundPointCallback &foundCallback, const AffineXf3f *xf=nullptr) |
| void | MR::findPointsInBox (const AABBTreePoints &tree, const Box3f &box, const FoundPointCallback &foundCallback, const AffineXf3f *xf=nullptr) |
| PointsProjectionResult | MR::findProjectionOnPoints (const Vector3f &pt, const PointCloudPart &pcp, float upDistLimitSq=FLT_MAX, const AffineXf3f *xf=nullptr, float loDistLimitSq=0, VertPredicate skipCb={}) |
| computes the closest point on point cloud to given point | |
| PointsProjectionResult | MR::findProjectionOnPoints (const Vector3f &pt, const AABBTreePoints &tree, float upDistLimitSq=FLT_MAX, const AffineXf3f *xf=nullptr, float loDistLimitSq=0, const VertBitSet *region=nullptr, VertPredicate skipCb={}) |
| computes the closest point on AABBTreePoints to given point | |
| void | MR::findFewClosestPoints (const Vector3f &pt, const PointCloud &pc, FewSmallest< PointsProjectionResult > &res, float upDistLimitSq=FLT_MAX, const AffineXf3f *xf=nullptr, float loDistLimitSq=0) |
| finds a number of the closest points in the cloud (as configured in | |
| Buffer< VertId > | MR::findNClosestPointsPerPoint (const PointCloud &pc, int numNei, const ProgressCallback &progress={}) |
| finds given number of closest points (excluding itself) to each valid point in the cloud; | |
| VertPair | MR::findTwoClosestPoints (const PointCloud &pc, const ProgressCallback &progress={}) |
| finds two closest points (first id < second id) in whole point cloud | |
| std::vector< EdgePointPair > | MR::findCollidingEdgePairs (const Polyline2 &a, const Polyline2 &b, const AffineXf2f *rigidB2A=nullptr, bool firstIntersectionOnly=false) |
| finds all pairs of colliding edges from two 2d polylines | |
| std::vector< UndirectedEdgeUndirectedEdge > | MR::findCollidingEdges (const Polyline2 &a, const Polyline2 &b, const AffineXf2f *rigidB2A=nullptr, bool firstIntersectionOnly=false) |
| finds all pairs of colliding edges from two 2d polylines | |
| std::pair< UndirectedEdgeBitSet, UndirectedEdgeBitSet > | MR::findCollidingEdgesBitsets (const Polyline2 &a, const Polyline2 &b, const AffineXf2f *rigidB2A=nullptr) |
| finds bitset per polyline with colliding edges | |
| std::vector< EdgePointPair > | MR::findSelfCollidingEdgePairs (const Polyline2 &polyline) |
| finds all pairs of colliding edges from 2d polyline | |
| std::vector< UndirectedEdgeUndirectedEdge > | MR::findSelfCollidingEdges (const Polyline2 &polyline) |
| finds all pairs of colliding edges from 2d polyline | |
| UndirectedEdgeBitSet | MR::findSelfCollidingEdgesBS (const Polyline2 &polyline) |
| finds the union of all self-intersecting edges | |
| bool | MR::isInside (const Polyline2 &a, const Polyline2 &b, const AffineXf2f *rigidB2A=nullptr) |
| checks that arbitrary 2d polyline A is inside of closed 2d polyline B | |
| bool | MR::isPointInsidePolyline (const Polyline2 &polyline, const Vector2f &point) |
| detect if given point is inside polyline, by counting ray intersections | |
| std::optional< PolylineIntersectionResult2 > | MR::rayPolylineIntersect (const Polyline2 &polyline, const Line2f &line, float rayStart=0, float rayEnd=FLT_MAX, const IntersectionPrecomputes2< float > *prec=nullptr, bool closestIntersect=true) |
| std::optional< PolylineIntersectionResult2 > | MR::rayPolylineIntersect (const Polyline2 &polyline, const Line2d &line, double rayStart=0, double rayEnd=DBL_MAX, const IntersectionPrecomputes2< double > *prec=nullptr, bool closestIntersect=true) |
| void | MR::rayPolylineIntersectAll (const Polyline2 &polyline, const Line2f &line, const PolylineIntersectionCallback2f &callback, float rayStart=0.0f, float rayEnd=FLT_MAX, const IntersectionPrecomputes2< float > *prec=nullptr) |
| void | MR::rayPolylineIntersectAll (const Polyline2 &polyline, const Line2d &line, const PolylineIntersectionCallback2d &callback, double rayStart=0.0, double rayEnd=DBL_MAX, const IntersectionPrecomputes2< double > *prec=nullptr) |
| PolylineProjectionResult2 | MR::findProjectionOnPolyline2 (const Vector2f &pt, const Polyline2 &polyline, float upDistLimitSq=FLT_MAX, AffineXf2f *xf=nullptr, float loDistLimitSq=0) |
| computes the closest point on polyline to given point | |
| PolylineProjectionResult3 | MR::findProjectionOnPolyline (const Vector3f &pt, const Polyline3 &polyline, float upDistLimitSq=FLT_MAX, AffineXf3f *xf=nullptr, float loDistLimitSq=0) |
| computes the closest point on polyline to given point | |
| PolylineProjectionResult3Arg | MR::findMaxProjectionOnPolyline (const VertCoords &points, const Polyline3 &polyline, const VertBitSet *pointsRegion=nullptr, AffineXf3f *xf=nullptr, float loDistLimitSq=0) |
| for each of points (pointsRegion) computes the closest point on polyline and returns the point for which maximum distance is reached, | |
| PolylineProjectionResult3 | MR::findProjectionOnPolyline (const Line3f &ln, const Polyline3 &polyline, float upDistLimitSq=FLT_MAX, AffineXf3f *xf=nullptr, float loDistLimitSq=0) |
| computes the closest point on polyline to given straight line | |
| Polyline2ProjectionWithOffsetResult | MR::findProjectionOnPolyline2WithOffset (const Vector2f &pt, const Polyline2 &polyline, const Vector< float, UndirectedEdgeId > &offsetPerEdge, float upDistLimit=FLT_MAX, AffineXf2f *xf=nullptr, float loDistLimit=0) |
| computes the closest point on polyline to given point, respecting each edge offset | |
| PolylineProjectionWithOffsetResult3 | MR::findProjectionOnPolylineWithOffset (const Vector3f &pt, const Polyline3 &polyline, const Vector< float, UndirectedEdgeId > &offsetPerEdge, float upDistLimit=FLT_MAX, AffineXf3f *xf=nullptr, float loDistLimit=0) |
| computes the closest point on polyline to given point, respecting each edge offset | |
| void | MR::findEdgesInBall (const Polyline2 &polyline, const Vector2f ¢er, float radius, const FoundEdgeCallback2 &foundCallback, AffineXf2f *xf=nullptr) |
| Finds all edges of given polyline that cross or touch given ball (center, radius) | |
| void | MR::findEdgesInBall (const Polyline3 &polyline, const Vector3f ¢er, float radius, const FoundEdgeCallback3 &foundCallback, AffineXf3f *xf=nullptr) |
| Finds all edges of given polyline that cross or touch given ball (center, radius) | |
| void | MR::findMeshEdgesInBall (const Mesh &mesh, const AABBTreePolyline3 &tree, const Vector3f ¢er, float radius, const FoundEdgeCallback3 &foundCallback, AffineXf3f *xf=nullptr) |
| Finds all edges of given mesh edges (specified by the tree) that cross or touch given ball (center, radius) | |
| PolylineProjectionResult3 | MR::findProjectionOnMeshEdges (const Vector3f &pt, const Mesh &mesh, const AABBTreePolyline3 &tree, float upDistLimitSq=FLT_MAX, AffineXf3f *xf=nullptr, float loDistLimitSq=0) |
| computes the closest point on the mesh edges (specified by the tree) to given point | |
| PolylineProjectionResult3 | MR::findProjectionOnMeshEdges (const Line3f &ln, const Mesh &mesh, const AABBTreePolyline3 &tree, float upDistLimitSq=FLT_MAX, AffineXf3f *xf=nullptr, float loDistLimitSq=0) |
| computes the closest point on the mesh edges (specified by the tree) to given straight line | |
Variables | |
| Vector3< T > | MR::IntersectionPrecomputes< T >::invDir |
| {1 / dir} | |
| int | MR::IntersectionPrecomputes< T >::maxDimIdxZ = 2 |
| int | MR::IntersectionPrecomputes< T >::idxX = 0 |
| int | MR::IntersectionPrecomputes< T >::idxY = 1 |
| Vector3i | MR::IntersectionPrecomputes< T >::sign |
| stores signs of direction vector; | |
| T | MR::IntersectionPrecomputes< T >::Sx |
| precomputed factors | |
| T | MR::IntersectionPrecomputes< T >::Sy |
| T | MR::IntersectionPrecomputes< T >::Sz |
This chapter represents documentation about AABB Tree.
| using MR::AABBTreeNodeVec = Vector<AABBTreeNode<T>, NodeId> |
#include <MRMesh/MRAABBTreeNode.h>
| using MR::FaceTreeTraits3 = AABBTreeTraits<FaceTag, Box3f> |
#include <MRMesh/MRAABBTreeNode.h>
| using MR::FoundBoxedTriCallback = std::function<Processing( FaceId found, Ball3f & ball )> |
#include <MRMesh/MRMeshProject.h>
this callback is invoked on every triangle with bounding box at least partially in the ball (the triangle itself can be fully out of ball), and allows changing (shrinking only) the ball
| using MR::FoundEdgeCallback = std::function<void( UndirectedEdgeId, const V& closestPt, float distSq )> |
#include <MRMesh/MRPolylineProject.h>
| using MR::FoundEdgeCallback2 = FoundEdgeCallback<Vector2f> |
#include <MRMesh/MRPolylineProject.h>
| using MR::FoundEdgeCallback3 = FoundEdgeCallback<Vector3f> |
#include <MRMesh/MRPolylineProject.h>
| using MR::FoundTriCallback = std::function<Processing( const MeshProjectionResult & found, Ball3f & ball )> |
#include <MRMesh/MRMeshProject.h>
this callback is invoked on every triangle at least partially in the ball, and allows changing (shrinking only) the ball
| using MR::Line3dMesh = Line3Mesh<double> |
#include <MRMesh/MRMeshIntersect.h>
| using MR::Line3fMesh = Line3Mesh<float> |
#include <MRMesh/MRMeshIntersect.h>
| using MR::LineTreeTraits = AABBTreeTraits<UndirectedEdgeTag, Box<V>> |
#include <MRMesh/MRAABBTreeNode.h>
| using MR::LineTreeTraits2 = LineTreeTraits<Vector2f> |
#include <MRMesh/MRAABBTreeNode.h>
| using MR::LineTreeTraits3 = LineTreeTraits<Vector3f> |
#include <MRMesh/MRAABBTreeNode.h>
| using MR::MeshIntersectionCallback = std::function<bool(const MeshIntersectionResult &)> |
#include <MRMesh/MRMeshIntersect.h>
this callback is envoked for each encountered ray-mesh intersection; if it returns false, then the search immediately terminates
| using MR::PolylineIntersectionCallback2 = std::function<Processing(const EdgePoint & polylinePoint, T rayPos, T & rayStart, T & rayEnd)> |
#include <MRMesh/MRPolyline2Intersect.h>
this callback is envoked for each encountered ray-polyline intersection; if it returns Processing::Stop, then the search immediately terminates; the callback can reduce rayEnd affecting the following search, but it shall not increase rayEnd
| using MR::PolylineIntersectionCallback2d = PolylineIntersectionCallback2<double> |
#include <MRMesh/MRPolyline2Intersect.h>
| using MR::PolylineIntersectionCallback2f = PolylineIntersectionCallback2<float> |
#include <MRMesh/MRPolyline2Intersect.h>
| using MR::PreciseCollisionResult = std::vector<VarEdgeTri> |
#include <MRMesh/MRMeshCollidePrecise.h>
In each VarEdgeTri = pair of (intersected edge, intersected triangle), the intersected edge is directed from negative half-space of the intersected triangle B to its positive half-space
| using MR::TriangleCallback = std::function<ProcessOneResult( const Vector3f & p, FaceId f, const Vector3f & q, float distSq )> |
#include <MRMesh/MRMeshDistance.h>
this callback is invoked for every triangle in range, where
| p | closest point on original triangle (if distSq == 0 then it is random point on original triangle, see triDist comment) |
| f | triangle id in question |
| q | closest point on f-triangle (if distSq == 0 then it is random point on f-triangle, see triDist comment) |
| distSq | squared distance in between p and q |
|
strong |
#include <MRMesh/MRMeshMeshDistance.h>
| Enumerator | |
|---|---|
| BothOutside | |
| BothInside | |
| AInside | |
| BInside | |
| Colliding | |
| Touching | |
|
strong |
#include <MRMesh/MRMeshDistance.h>
| Enumerator | |
|---|---|
| StopProcessing | |
| ContinueProcessing | |
| MeshProjectionTransforms MR::createProjectionTransforms | ( | AffineXf3f & | storageXf, |
| const AffineXf3f * | pointXf, | ||
| const AffineXf3f * | treeXf ) |
#include <MRMesh/MRMeshProject.h>
Creates structure with simplified transforms for projection functions, with rigidXfPoint applied to point, and nonRigidXfTree applied to tree.
| storageXf | this argument will hold modified transfrom |
| pointXf | transform for points to be projected |
| treeXf | transform for tree's boxes |
| void MR::findBoxedTrisInBall | ( | const MeshPart & | mp, |
| Ball3f | ball, | ||
| const FoundBoxedTriCallback & | foundCallback ) |
#include <MRMesh/MRMeshProject.h>
enumerates all triangles with bounding boxes at least partially in the ball (the triangles themselves can be fully out of ball) until callback returns Stop; the ball during enumeration can shrink (new ball is always within the previous one) but never expand
| std::vector< EdgePointPair > MR::findCollidingEdgePairs | ( | const Polyline2 & | a, |
| const Polyline2 & | b, | ||
| const AffineXf2f * | rigidB2A = nullptr, | ||
| bool | firstIntersectionOnly = false ) |
#include <MRMesh/MRPolyline2Collide.h>
finds all pairs of colliding edges from two 2d polylines
| rigidB2A | rigid transformation from B-polyline space to A polyline space, nullptr considered as identity transformation |
| firstIntersectionOnly | if true then the function returns at most one pair of intersecting edges and returns faster |
| std::vector< UndirectedEdgeUndirectedEdge > MR::findCollidingEdges | ( | const Polyline2 & | a, |
| const Polyline2 & | b, | ||
| const AffineXf2f * | rigidB2A = nullptr, | ||
| bool | firstIntersectionOnly = false ) |
#include <MRMesh/MRPolyline2Collide.h>
finds all pairs of colliding edges from two 2d polylines
| rigidB2A | rigid transformation from B-polyline space to A polyline space, nullptr considered as identity transformation |
| firstIntersectionOnly | if true then the function returns at most one pair of intersecting edges and returns faster |
| std::pair< UndirectedEdgeBitSet, UndirectedEdgeBitSet > MR::findCollidingEdgesBitsets | ( | const Polyline2 & | a, |
| const Polyline2 & | b, | ||
| const AffineXf2f * | rigidB2A = nullptr ) |
#include <MRMesh/MRPolyline2Collide.h>
finds bitset per polyline with colliding edges
| rigidB2A | rigid transformation from B-polyline space to A polyline space, nullptr considered as identity transformation |
| std::vector< EdgeTri > MR::findCollidingEdgeTrisPrecise | ( | const Mesh & | a, |
| const std::vector< EdgeId > & | edgesA, | ||
| const Mesh & | b, | ||
| const std::vector< FaceId > & | facesB, | ||
| ConvertToIntVector | conv, | ||
| const AffineXf3f * | rigidB2A = nullptr ) |
#include <MRMesh/MRMeshCollidePrecise.h>
finds all intersections between every given edge from A and given triangles from B
| std::vector< EdgeTri > MR::findCollidingEdgeTrisPrecise | ( | const Mesh & | a, |
| const std::vector< FaceId > & | facesA, | ||
| const Mesh & | b, | ||
| const std::vector< EdgeId > & | edgesB, | ||
| ConvertToIntVector | conv, | ||
| const AffineXf3f * | rigidB2A = nullptr ) |
#include <MRMesh/MRMeshCollidePrecise.h>
finds all intersections between every given triangle from A and given edge from B
| PreciseCollisionResult MR::findCollidingEdgeTrisPrecise | ( | const MeshPart & | a, |
| const MeshPart & | b, | ||
| ConvertToIntVector | conv, | ||
| const AffineXf3f * | rigidB2A = nullptr, | ||
| bool | anyIntersection = false ) |
#include <MRMesh/MRMeshCollidePrecise.h>
finds all pairs of colliding edges from one mesh and triangle from another mesh
| rigidB2A | rigid transformation from B-mesh space to A mesh space, nullptr considered as identity transformation |
| anyIntersection | if true then the function returns as fast as it finds any intersection |
|
nodiscard |
#include <MRMesh/MRMeshCollide.h>
the same as findCollidingTriangles, but returns one bite set per mesh with colliding triangles
|
nodiscard |
#include <MRMesh/MRMeshCollide.h>
finds all pairs of colliding triangles from two meshes or two mesh regions
| rigidB2A | rigid transformation from B-mesh space to A mesh space, nullptr considered as identity transformation |
| firstIntersectionOnly | if true then the function returns at most one pair of intersecting triangles and returns faster |
| MeshMeshCollisionStatus MR::findCollisionStatus | ( | const MeshPart & | a, |
| const MeshPart & | b, | ||
| const AffineXf3f * | rigidB2A = nullptr ) |
#include <MRMesh/MRMeshMeshDistance.h>
finds if two meshes are touching, colliding or inside each other
| rigidB2A | rigid transformation from B-mesh space to A mesh space, nullptr considered as identity transformation |
| MeshMeshCollisionStatus MR::findCollisionStatus | ( | const MeshPart & | a, |
| const MeshPart & | b, | ||
| const MeshMeshDistanceResult & | distRes, | ||
| const AffineXf3f * | rigidB2A = nullptr, | ||
| std::vector< FaceFace > * | collisions = nullptr ) |
#include <MRMesh/MRMeshMeshDistance.h>
finds if two meshes are touching, colliding or inside each other
| distRes | result of findDistance on these input |
| rigidB2A | rigid transformation from B-mesh space to A mesh space, nullptr considered as identity transformation |
| collisions | optional output collisions among A and B |
|
nodiscard |
#include <MRMesh/MRDirMax.h>
finds the vertex in the polyline having the largest projection on given direction, optionally uses aabb-tree inside for faster computation
|
nodiscard |
#include <MRMesh/MRDirMax.h>
finds the point in the tree having the largest projection on given direction
|
nodiscard |
#include <MRMesh/MRDirMax.h>
finds the vertex in the mesh part having the largest projection on given direction, optionally uses aabb-tree inside for faster computation
|
nodiscard |
#include <MRMesh/MRDirMax.h>
finds the vertex in the mesh part having the largest projection on given direction, optionally uses aabb-tree inside for faster computation
|
nodiscard |
#include <MRMesh/MRDirMax.h>
finds the vertex in the mesh part having the largest projection on given direction, optionally uses aabb-points-tree inside for faster computation
|
nodiscard |
#include <MRMesh/MRDirMax.h>
finds the point in the cloud having the largest projection on given direction, optionally uses aabb-tree inside for faster computation
|
nodiscard |
#include <MRMesh/MRDirMax.h>
finds the vertex in the polyline having the largest projection on given direction, optionally uses aabb-tree inside for faster computation
| MeshMeshDistanceResult MR::findDistance | ( | const MeshPart & | a, |
| const MeshPart & | b, | ||
| const AffineXf3f * | rigidB2A = nullptr, | ||
| float | upDistLimitSq = FLT_MAX ) |
#include <MRMesh/MRMeshMeshDistance.h>
computes minimal distance between two meshes or two mesh regions
| rigidB2A | rigid transformation from B-mesh space to A mesh space, nullptr considered as identity transformation |
| upDistLimitSq | upper limit on the distance in question, if the real distance is larger then the function exists returning upDistLimitSq and no valid points |
| void MR::findEdgesInBall | ( | const Polyline2 & | polyline, |
| const Vector2f & | center, | ||
| float | radius, | ||
| const FoundEdgeCallback2 & | foundCallback, | ||
| AffineXf2f * | xf = nullptr ) |
#include <MRMesh/MRPolylineProject.h>
Finds all edges of given polyline that cross or touch given ball (center, radius)
| void MR::findEdgesInBall | ( | const Polyline3 & | polyline, |
| const Vector3f & | center, | ||
| float | radius, | ||
| const FoundEdgeCallback3 & | foundCallback, | ||
| AffineXf3f * | xf = nullptr ) |
#include <MRMesh/MRPolylineProject.h>
Finds all edges of given polyline that cross or touch given ball (center, radius)
| void MR::findFewClosestPoints | ( | const Vector3f & | pt, |
| const PointCloud & | pc, | ||
| FewSmallest< PointsProjectionResult > & | res, | ||
| float | upDistLimitSq = FLT_MAX, | ||
| const AffineXf3f * | xf = nullptr, | ||
| float | loDistLimitSq = 0 ) |
#include <MRMesh/MRPointsProject.h>
finds a number of the closest points in the cloud (as configured in
| res) | to given point |
| upDistLimitSq | upper limit on the distance in question, points with larger distance than it will not be returned |
| xf | pointcloud-to-point transformation, if not specified then identity transformation is assumed |
| loDistLimitSq | low limit on the distance in question, the algorithm can return given number of points within this distance even skipping closer ones |
| float MR::findMaxDistanceSq | ( | const MeshPart & | a, |
| const MeshPart & | b, | ||
| const AffineXf3f * | rigidB2A = nullptr, | ||
| float | maxDistanceSq = FLT_MAX ) |
#include <MRMesh/MRMeshMeshDistance.h>
returns the squared Hausdorff distance between two meshes, that is the maximum of squared distances from each mesh vertex to the other mesh (in both directions)
| rigidB2A | rigid transformation from B-mesh space to A mesh space, nullptr considered as identity transformation |
| maxDistanceSq | upper limit on the positive distance in question, if the real distance is larger than the function exists returning maxDistanceSq |
| float MR::findMaxDistanceSqOneWay | ( | const MeshPart & | a, |
| const MeshPart & | b, | ||
| const AffineXf3f * | rigidB2A = nullptr, | ||
| float | maxDistanceSq = FLT_MAX ) |
#include <MRMesh/MRMeshMeshDistance.h>
returns the maximum of the squared distances from each B-mesh vertex to A-mesh
| rigidB2A | rigid transformation from B-mesh space to A mesh space, nullptr considered as identity transformation |
| maxDistanceSq | upper limit on the positive distance in question, if the real distance is larger than the function exists returning maxDistanceSq |
| PolylineProjectionResult3Arg MR::findMaxProjectionOnPolyline | ( | const VertCoords & | points, |
| const Polyline3 & | polyline, | ||
| const VertBitSet * | pointsRegion = nullptr, | ||
| AffineXf3f * | xf = nullptr, | ||
| float | loDistLimitSq = 0 ) |
#include <MRMesh/MRPolylineProject.h>
for each of points (pointsRegion) computes the closest point on polyline and returns the point for which maximum distance is reached,
| xf | polyline-to-point transformation, if not specified then identity transformation is assumed |
| loDistLimitSq | low limit on the distance in question, if a point is found within this distance then it is immediately returned without searching for a closer one |
| void MR::findMaxVectorDim | ( | int & | dimX, |
| int & | dimY, | ||
| const Vector2< T > & | dir ) |
#include <MRMesh/MRIntersectionPrecomputes2.h>
finds index of maximum axis and stores it into dimY
http:/// jcgt.org/published/0002/01/05/paper.pdf Example input: dir = (1,-2). Result: dimY = 1, dimX = 0.
| [out] | dimX | index of minimum axis |
| [out] | dimY | index of maximum axis |
| void MR::findMaxVectorDim | ( | int & | dimX, |
| int & | dimY, | ||
| int & | dimZ, | ||
| const Vector3< T > & | dir ) |
#include <MRMesh/MRIntersectionPrecomputes.h>
finds index of maximum axis and stores it into dimZ
http:/// jcgt.org/published/0002/01/05/paper.pdf Example input: dir = (1,1,-2). Result: dimZ = 2, dimX = 1, dimY = 0.
| [out] | dimX | are filled by right-hand rule from dimZ |
| [out] | dimY | are filled by right-hand rule from dimZ |
| [out] | dimZ | index of maximum axis |
x>y>z
x>z>y
z>x>y
y>z>x
y>x>z
z>y>x
| void MR::findMeshEdgesInBall | ( | const Mesh & | mesh, |
| const AABBTreePolyline3 & | tree, | ||
| const Vector3f & | center, | ||
| float | radius, | ||
| const FoundEdgeCallback3 & | foundCallback, | ||
| AffineXf3f * | xf = nullptr ) |
#include <MRMesh/MRPolylineProject.h>
Finds all edges of given mesh edges (specified by the tree) that cross or touch given ball (center, radius)
|
nodiscard |
#include <MRMesh/MRPointsProject.h>
finds given number of closest points (excluding itself) to each valid point in the cloud;
| numNei | the number of closest points to find for each point |
| void MR::findPointsInBall | ( | const AABBTreePoints & | tree, |
| Ball3f | ball, | ||
| const OnPointInBallFound & | foundCallback, | ||
| const AffineXf3f * | xf = nullptr ) |
#include <MRMesh/MRPointsInBall.h>
Finds all points in tree that are inside or on the surface of given ball until callback returns Stop; the ball can shrink (new ball is always within the previous one) during the search but never expand
| xf | points-to-center transformation, if not specified then identity transformation is assumed |
| MR_BIND_IGNORE void MR::findPointsInBall | ( | const AABBTreePoints & | tree, |
| const Ball3f & | ball, | ||
| const FoundPointCallback & | foundCallback, | ||
| const AffineXf3f * | xf = nullptr ) |
#include <MRMesh/MRPointsInBall.h>
Finds all points in tree that are inside or on the surface of given ball
| xf | points-to-center transformation, if not specified then identity transformation is assumed |
| MR_BIND_IGNORE void MR::findPointsInBall | ( | const Mesh & | mesh, |
| const Ball3f & | ball, | ||
| const FoundPointCallback & | foundCallback, | ||
| const AffineXf3f * | xf = nullptr ) |
#include <MRMesh/MRPointsInBall.h>
Finds all valid vertices of the mesh that are inside or on the surface of given ball
| xf | points-to-center transformation, if not specified then identity transformation is assumed |
| void MR::findPointsInBall | ( | const Mesh & | mesh, |
| const Ball3f & | ball, | ||
| const OnPointInBallFound & | foundCallback, | ||
| const AffineXf3f * | xf = nullptr ) |
#include <MRMesh/MRPointsInBall.h>
Finds all valid vertices of the mesh that are inside or on the surface of given ball until callback returns Stop; the ball can shrink (new ball is always within the previous one) during the search but never expand
| xf | points-to-center transformation, if not specified then identity transformation is assumed |
| MR_BIND_IGNORE void MR::findPointsInBall | ( | const PointCloud & | pointCloud, |
| const Ball3f & | ball, | ||
| const FoundPointCallback & | foundCallback, | ||
| const AffineXf3f * | xf = nullptr ) |
#include <MRMesh/MRPointsInBall.h>
Finds all valid points of pointCloud that are inside or on the surface of given ball
| xf | points-to-center transformation, if not specified then identity transformation is assumed |
| void MR::findPointsInBall | ( | const PointCloud & | pointCloud, |
| const Ball3f & | ball, | ||
| const OnPointInBallFound & | foundCallback, | ||
| const AffineXf3f * | xf = nullptr ) |
#include <MRMesh/MRPointsInBall.h>
Finds all valid points of pointCloud that are inside or on the surface of given ball until callback returns Stop; the ball can shrink (new ball is always within the previous one) during the search but never expand
| xf | points-to-center transformation, if not specified then identity transformation is assumed |
| void MR::findPointsInBox | ( | const AABBTreePoints & | tree, |
| const Box3f & | box, | ||
| const FoundPointCallback & | foundCallback, | ||
| const AffineXf3f * | xf = nullptr ) |
#include <MRMesh/MRPointsInBox.h>
Finds all points in tree that are inside or on the surface of given box
| xf | points-to-center transformation, if not specified then identity transformation is assumed |
| void MR::findPointsInBox | ( | const Mesh & | mesh, |
| const Box3f & | box, | ||
| const FoundPointCallback & | foundCallback, | ||
| const AffineXf3f * | xf = nullptr ) |
#include <MRMesh/MRPointsInBox.h>
Finds all valid vertices of the mesh that are inside or on the surface of given box
| xf | points-to-center transformation, if not specified then identity transformation is assumed |
| void MR::findPointsInBox | ( | const PointCloud & | pointCloud, |
| const Box3f & | box, | ||
| const FoundPointCallback & | foundCallback, | ||
| const AffineXf3f * | xf = nullptr ) |
#include <MRMesh/MRPointsInBox.h>
Finds all valid points of pointCloud that are inside or on the surface of given box
| xf | points-to-center transformation, if not specified then identity transformation is assumed |
|
nodiscard |
#include <MRMesh/MRMeshProject.h>
computes the closest point on mesh (or its region) to given point
| upDistLimitSq | upper limit on the distance in question, if the real distance is larger then the function exits returning upDistLimitSq and no valid point |
| xf | mesh-to-point transformation, if not specified then identity transformation is assumed |
| loDistLimitSq | low limit on the distance in question, if a point is found within this distance then it is immediately returned without searching for a closer one |
| validFaces | if provided then only faces from there will be considered as projections |
| validProjections | if provided then only projections passed this test can be returned |
| PolylineProjectionResult3 MR::findProjectionOnMeshEdges | ( | const Line3f & | ln, |
| const Mesh & | mesh, | ||
| const AABBTreePolyline3 & | tree, | ||
| float | upDistLimitSq = FLT_MAX, | ||
| AffineXf3f * | xf = nullptr, | ||
| float | loDistLimitSq = 0 ) |
#include <MRMesh/MRPolylineProject.h>
computes the closest point on the mesh edges (specified by the tree) to given straight line
| upDistLimitSq | upper limit on the distance in question, if the real distance is larger then the function exists returning upDistLimitSq and no valid point or edge |
| xf | polyline-to-point transformation, if not specified then identity transformation is assumed |
| loDistLimitSq | low limit on the distance in question, if a point is found within this distance then it is immediately returned without searching for a closer one |
| PolylineProjectionResult3 MR::findProjectionOnMeshEdges | ( | const Vector3f & | pt, |
| const Mesh & | mesh, | ||
| const AABBTreePolyline3 & | tree, | ||
| float | upDistLimitSq = FLT_MAX, | ||
| AffineXf3f * | xf = nullptr, | ||
| float | loDistLimitSq = 0 ) |
#include <MRMesh/MRPolylineProject.h>
computes the closest point on the mesh edges (specified by the tree) to given point
| upDistLimitSq | upper limit on the distance in question, if the real distance is larger then the function exists returning upDistLimitSq and no valid point or edge |
| xf | polyline-to-point transformation, if not specified then identity transformation is assumed |
| loDistLimitSq | low limit on the distance in question, if a point is found within this distance then it is immediately returned without searching for a closer one |
|
nodiscard |
#include <MRMesh/MRPointsProject.h>
computes the closest point on AABBTreePoints to given point
| upDistLimitSq | upper limit on the distance in question, if the real distance is larger then the function exits returning upDistLimitSq and no valid point |
| xf | pointcloud-to-point transformation, if not specified then identity transformation is assumed |
| loDistLimitSq | low limit on the distance in question, if a point is found within this distance then it is immediately returned without searching for a closer one |
| region | if not nullptr, all points not from the given region will be ignored |
| skipCb | callback to discard VertId projection candidate |
|
nodiscard |
#include <MRMesh/MRPointsProject.h>
computes the closest point on point cloud to given point
| upDistLimitSq | upper limit on the distance in question, if the real distance is larger then the function exits returning upDistLimitSq and no valid point |
| xf | pointcloud-to-point transformation, if not specified then identity transformation is assumed |
| loDistLimitSq | low limit on the distance in question, if a point is found within this distance then it is immediately returned without searching for a closer one |
| skipCb | callback to discard VertId projection candidate |
| PolylineProjectionResult3 MR::findProjectionOnPolyline | ( | const Line3f & | ln, |
| const Polyline3 & | polyline, | ||
| float | upDistLimitSq = FLT_MAX, | ||
| AffineXf3f * | xf = nullptr, | ||
| float | loDistLimitSq = 0 ) |
#include <MRMesh/MRPolylineProject.h>
computes the closest point on polyline to given straight line
| upDistLimitSq | upper limit on the distance in question, if the real distance is larger then the function exists returning upDistLimitSq and no valid point or edge |
| xf | polyline-to-point transformation, if not specified then identity transformation is assumed |
| loDistLimitSq | low limit on the distance in question, if a point is found within this distance then it is immediately returned without searching for a closer one |
| PolylineProjectionResult3 MR::findProjectionOnPolyline | ( | const Vector3f & | pt, |
| const Polyline3 & | polyline, | ||
| float | upDistLimitSq = FLT_MAX, | ||
| AffineXf3f * | xf = nullptr, | ||
| float | loDistLimitSq = 0 ) |
#include <MRMesh/MRPolylineProject.h>
computes the closest point on polyline to given point
| upDistLimitSq | upper limit on the distance in question, if the real distance is larger then the function exists returning upDistLimitSq and no valid point or edge |
| xf | polyline-to-point transformation, if not specified then identity transformation is assumed |
| loDistLimitSq | low limit on the distance in question, if a point is found within this distance then it is immediately returned without searching for a closer one |
| PolylineProjectionResult2 MR::findProjectionOnPolyline2 | ( | const Vector2f & | pt, |
| const Polyline2 & | polyline, | ||
| float | upDistLimitSq = FLT_MAX, | ||
| AffineXf2f * | xf = nullptr, | ||
| float | loDistLimitSq = 0 ) |
#include <MRMesh/MRPolylineProject.h>
computes the closest point on polyline to given point
| upDistLimitSq | upper limit on the distance in question, if the real distance is larger then the function exists returning upDistLimitSq and no valid point or edge |
| xf | polyline-to-point transformation, if not specified then identity transformation is assumed |
| loDistLimitSq | low limit on the distance in question, if a point is found within this distance then it is immediately returned without searching for a closer one |
| Polyline2ProjectionWithOffsetResult MR::findProjectionOnPolyline2WithOffset | ( | const Vector2f & | pt, |
| const Polyline2 & | polyline, | ||
| const Vector< float, UndirectedEdgeId > & | offsetPerEdge, | ||
| float | upDistLimit = FLT_MAX, | ||
| AffineXf2f * | xf = nullptr, | ||
| float | loDistLimit = 0 ) |
#include <MRMesh/MRPolylineProject.h>
computes the closest point on polyline to given point, respecting each edge offset
| offsetPerEdge | offset for each edge of polyline |
| upDistLimit | upper limit on the distance in question, if the real distance is larger then the function exists returning upDistLimit and no valid point or edge |
| xf | polyline-to-point transformation, if not specified then identity transformation is assumed |
| loDistLimit | low limit on the distance in question, if a point is found within this distance then it is immediately returned without searching for a closer one |
| PolylineProjectionWithOffsetResult3 MR::findProjectionOnPolylineWithOffset | ( | const Vector3f & | pt, |
| const Polyline3 & | polyline, | ||
| const Vector< float, UndirectedEdgeId > & | offsetPerEdge, | ||
| float | upDistLimit = FLT_MAX, | ||
| AffineXf3f * | xf = nullptr, | ||
| float | loDistLimit = 0 ) |
#include <MRMesh/MRPolylineProject.h>
computes the closest point on polyline to given point, respecting each edge offset
| offsetPerEdge | offset for each edge of polyline |
| upDistLimit | upper limit on the distance in question, if the real distance is larger then the function exists returning upDistLimit and no valid point or edge |
| xf | polyline-to-point transformation, if not specified then identity transformation is assumed |
| loDistLimit | low limit on the distance in question, if a point is found within this distance then it is immediately returned without searching for a closer one |
|
nodiscard |
#include <MRMesh/MRMeshProject.h>
computes the closest point on mesh (or its region) to given point
| tree | explicitly given BVH-tree for whole mesh or part of mesh we are searching projection on, |
| upDistLimitSq | upper limit on the distance in question, if the real distance is larger then the function exits returning upDistLimitSq and no valid point |
| xf | mesh-to-point transformation, if not specified then identity transformation is assumed |
| loDistLimitSq | low limit on the distance in question, if a point is found within this distance then it is immediately returned without searching for a closer one |
| validFaces | if provided then only faces from there will be considered as projections |
| validProjections | if provided then only projections passed this test can be returned |
| std::vector< EdgePointPair > MR::findSelfCollidingEdgePairs | ( | const Polyline2 & | polyline | ) |
#include <MRMesh/MRPolyline2Collide.h>
finds all pairs of colliding edges from 2d polyline
| std::vector< UndirectedEdgeUndirectedEdge > MR::findSelfCollidingEdges | ( | const Polyline2 & | polyline | ) |
#include <MRMesh/MRPolyline2Collide.h>
finds all pairs of colliding edges from 2d polyline
| UndirectedEdgeBitSet MR::findSelfCollidingEdgesBS | ( | const Polyline2 & | polyline | ) |
#include <MRMesh/MRPolyline2Collide.h>
finds the union of all self-intersecting edges
| std::vector< EdgeTri > MR::findSelfCollidingEdgeTrisPrecise | ( | const MeshPart & | mp, |
| ConvertToIntVector | conv, | ||
| bool | anyIntersection = false, | ||
| const AffineXf3f * | rigidB2A = nullptr, | ||
| int | aVertSizes = 0 ) |
#include <MRMesh/MRMeshCollidePrecise.h>
finds all pairs of colliding edges and triangle within one mesh
| anyIntersection | if true then the function returns as fast as it finds any intersection |
| rigidB2A | rigid transformation from B-mesh space to A mesh space, nullptr considered as identity transformation, might be useful to obtain same result as in boolean operation would for mesh B |
| aVertsSize | used in float to int conversion, might be useful to obtain same result as in boolean operation would for mesh B |
|
nodiscard |
#include <MRMesh/MRMeshCollide.h>
finds all pairs of colliding triangles from one mesh or a region
if true then treat touching faces as self-intersections too
| regionMap | if regionMap is provided then only self-intersections within a region are returned |
|
nodiscard |
#include <MRMesh/MRMeshCollide.h>
finds all pairs (or the fact of any self-collision) of colliding triangles from one mesh or a region
if true then treat touching faces as self-intersections too
| outCollidingPairs | if nullptr then the algorithm returns with true as soon as first collision is found |
| regionMap | if regionMap is provided then only self-intersections within a region are returned |
|
nodiscard |
#include <MRMesh/MRMeshCollide.h>
the same findSelfCollidingTriangles but returns the union of all self-intersecting faces
if true then treat touching faces as self-intersections too
| regionMap | if regionMap is provided then only self-intersections within a region are returned |
| MeshMeshSignedDistanceResult MR::findSignedDistance | ( | const MeshPart & | a, |
| const MeshPart & | b, | ||
| const AffineXf3f * | rigidB2A = nullptr, | ||
| float | upDistLimitSq = FLT_MAX ) |
#include <MRMesh/MRMeshMeshDistance.h>
computes minimal distance between two meshes
| rigidB2A | rigid transformation from B-mesh space to A mesh space, nullptr considered as identity transformation |
| upDistLimitSq | upper limit on the positive distance in question, if the real distance is larger then the function exists returning upDistLimitSq and no valid points |
|
nodiscard |
#include <MRMesh/MRMeshProject.h>
computes the closest point on mesh (or its region) to given point, and finds the distance with sign to it (positive - outside, negative - inside the mesh)
| upDistLimitSq | upper limit on the distance in question, if the real distance is larger then the function exits returning nullopt |
| loDistLimitSq | low limit on the distance in question, if the real distance smaller then the function exits returning nullopt |
| void MR::findTrisInBall | ( | const MeshPart & | mp, |
| const Ball3f & | ball, | ||
| const FoundTriCallback & | foundCallback, | ||
| const FacePredicate & | validFaces = {} ) |
#include <MRMesh/MRMeshProject.h>
enumerates all triangles within the ball until callback returns Stop; the ball during enumeration can shrink (new ball is always within the previous one) but never expand
|
nodiscard |
#include <MRMesh/MRPointsProject.h>
finds two closest points (first id < second id) in whole point cloud
|
inline |
#include <MRMesh/MRAABBTreeMaker.h>
returns the number of nodes in the binary tree with given number of leaves
|
inline |
#include <MRMesh/MRAABBTreePoints.h>
returns the number of nodes in the binary tree with given number of points
| CoordinateConverters MR::getVectorConverters | ( | const MeshPart & | a | ) |
#include <MRMesh/MRMeshCollidePrecise.h>
creates simple converters from Vector3f to Vector3i and back in mesh part area range
| CoordinateConverters MR::getVectorConverters | ( | const MeshPart & | a, |
| const MeshPart & | b, | ||
| const AffineXf3f * | rigidB2A = nullptr ) |
#include <MRMesh/MRMeshCollidePrecise.h>
creates simple converters from Vector3f to Vector3i and back in mesh parts area range
| rigidB2A | rigid transformation from B-mesh space to A mesh space, nullptr considered as identity transformation |
|
default |
#include <MRMesh/MRIntersectionPrecomputes.h>
|
inline |
#include <MRMesh/MRIntersectionPrecomputes.h>
|
nodiscard |
#include <MRMesh/MRMeshCollide.h>
checks that arbitrary mesh part A is inside of closed mesh part B
| rigidB2A | rigid transformation from B-mesh space to A mesh space, nullptr considered as identity transformation |
| bool MR::isInside | ( | const Polyline2 & | a, |
| const Polyline2 & | b, | ||
| const AffineXf2f * | rigidB2A = nullptr ) |
#include <MRMesh/MRPolyline2Collide.h>
checks that arbitrary 2d polyline A is inside of closed 2d polyline B
| rigidB2A | rigid transformation from B-polyline space to A polyline space, nullptr considered as identity transformation |
|
nodiscard |
#include <MRMesh/MRMeshCollide.h>
checks that arbitrary mesh A part (whole part is represented by one face partFace) is inside of closed mesh part B The version of isInside without collision check; it is user's responsibility to guarantee that the meshes don't collide
| rigidB2A | rigid transformation from B-mesh space to A mesh space, nullptr considered as identity transformation |
|
nodiscard |
#include <MRMesh/MRMeshCollide.h>
checks that arbitrary mesh part A is inside of closed mesh part B The version of isInside without collision check; it is user's responsibility to guarantee that the meshes don't collide
| rigidB2A | rigid transformation from B-mesh space to A mesh space, nullptr considered as identity transformation |
|
nodiscard |
#include <MRMesh/MRPolyline2Intersect.h>
detect if given point is inside polyline, by counting ray intersections
| polyline | input polyline |
| point | input point |
| AABBTreeNodeVec< T > MR::makeAABBTreeNodeVec | ( | Buffer< BoxedLeaf< T > > | boxedLeaves | ) |
#include <MRMesh/MRAABBTreeMaker.h>
| void MR::multiRayMeshIntersect | ( | const MeshPart & | meshPart, |
| const std::vector< Vector3f > & | origins, | ||
| const std::vector< Vector3f > & | dirs, | ||
| const MultiRayMeshIntersectResult & | result, | ||
| float | rayStart = 0.0f, | ||
| float | rayEnd = FLT_MAX, | ||
| bool | closestIntersect = true, | ||
| const FacePredicate & | validFaces = {} ) |
#include <MRMesh/MRMeshIntersect.h>
Finds intersections between a mesh and multiple rays in parallel (in float-precision). rayStart and rayEnd define the interval on all rays to detect an intersection. vadidFaces if given then all faces for which false is returned will be skipped
| meshPart | input: mesh (or its part) to find intersections with |
| origins | origin point of every ray |
| dirs | direction of every ray |
| result | output data for every ray |
| rayStart | advanced options: |
| closestIntersect | whether to search for the closest intersection to ray origin (line param=0), or any intersection |
| validFaces | if given then all faces for which false is returned will be skipped |
#include <MRMesh/MRMeshCollidePrecise.h>
| void MR::planeMeshIntersect | ( | const MeshPart & | meshPart, |
| const Plane3f & | plane, | ||
| FaceBitSet * | fs, | ||
| UndirectedEdgeBitSet * | ues, | ||
| VertBitSet * | vs, | ||
| std::vector< FaceId > * | fsVec = nullptr ) |
#include <MRMesh/MRMeshIntersect.h>
given mesh part and arbitrary plane, outputs
| fs | triangles from boxes crossed or touched by the plane |
| ues | edges of these triangles |
| vs | vertices of these triangles |
| fsVec | triangles from boxes crossed or touched by the plane in unspecified order |
| void MR::processCloseTriangles | ( | const MeshPart & | mp, |
| const Triangle3f & | t, | ||
| float | rangeSq, | ||
| const TriangleCallback & | call ) |
#include <MRMesh/MRMeshDistance.h>
invokes given callback for all triangles from given mesh part located not further than given squared distance from t-triangle
|
nodiscard |
#include <MRMesh/MRMeshIntersect.h>
Finds ray and mesh intersection in double-precision. rayStart and rayEnd define the interval on the ray to detect an intersection. prec can be specified to reuse some precomputations (e.g. for checking many parallel rays). vadidFaces if given then all faces for which false is returned will be skipped Finds the closest intersection to ray origin (line param=0) or any intersection for better performance if !closestIntersect.
|
nodiscard |
#include <MRMesh/MRMeshIntersect.h>
Finds ray and mesh intersection in float-precision. rayStart and rayEnd define the interval on the ray to detect an intersection. prec can be specified to reuse some precomputations (e.g. for checking many parallel rays). vadidFaces if given then all faces for which false is returned will be skipped Finds the closest intersection to ray origin (line param=0) or any intersection for better performance if !closestIntersect.
| void MR::rayMeshIntersectAll | ( | const MeshPart & | meshPart, |
| const Line3d & | line, | ||
| MeshIntersectionCallback | callback, | ||
| double | rayStart = 0.0, | ||
| double | rayEnd = DBL_MAX, | ||
| const IntersectionPrecomputes< double > * | prec = nullptr ) |
#include <MRMesh/MRMeshIntersect.h>
Same as rayMeshIntersectAllF, but use double precision.
| void MR::rayMeshIntersectAll | ( | const MeshPart & | meshPart, |
| const Line3f & | line, | ||
| MeshIntersectionCallback | callback, | ||
| float | rayStart = 0.0f, | ||
| float | rayEnd = FLT_MAX, | ||
| const IntersectionPrecomputes< float > * | prec = nullptr ) |
#include <MRMesh/MRMeshIntersect.h>
|
nodiscard |
#include <MRMesh/MRMeshIntersect.h>
Same as rayMultiMeshAnyIntersectF, but use double precision.
|
nodiscard |
#include <MRMesh/MRMeshIntersect.h>
Intersects ray with many meshes. Finds any intersection (not the closest)
|
nodiscard |
#include <MRMesh/MRPolyline2Intersect.h>
Finds ray and polyline intersection in double-precision. rayStart and rayEnd define the interval on the ray to detect an intersection. prec can be specified to reuse some precomputations (e.g. for checking many parallel rays). Finds the closest intersection to ray origin (line param=0) or any intersection for better performance if !closestIntersect.
|
nodiscard |
#include <MRMesh/MRPolyline2Intersect.h>
Finds ray and polyline intersection in float-precision. rayStart and rayEnd define the interval on the ray to detect an intersection. prec can be specified to reuse some precomputations (e.g. for checking many parallel rays). Finds the closest intersection to ray origin (line param=0) or any intersection for better performance if !closestIntersect.
| void MR::rayPolylineIntersectAll | ( | const Polyline2 & | polyline, |
| const Line2d & | line, | ||
| const PolylineIntersectionCallback2d & | callback, | ||
| double | rayStart = 0.0, | ||
| double | rayEnd = DBL_MAX, | ||
| const IntersectionPrecomputes2< double > * | prec = nullptr ) |
#include <MRMesh/MRPolyline2Intersect.h>
Intersects 2D ray and polyline in double-precision. Reports all intersections via given callback with the tendency to do it from ray start to ray end, but without guarantee of exact order.
| void MR::rayPolylineIntersectAll | ( | const Polyline2 & | polyline, |
| const Line2f & | line, | ||
| const PolylineIntersectionCallback2f & | callback, | ||
| float | rayStart = 0.0f, | ||
| float | rayEnd = FLT_MAX, | ||
| const IntersectionPrecomputes2< float > * | prec = nullptr ) |
#include <MRMesh/MRPolyline2Intersect.h>
Intersects 2D ray and polyline in single-precision. Reports all intersections via given callback with the tendency to do it from ray start to ray end, but without guarantee of exact order.
|
nodiscard |
#include <MRMesh/MRMeshDistance.h>
computes signed distance from point (p) to mesh part (mp) following options (op); returns std::nullopt if distance is smaller than op.minDist or larger than op.maxDist (except for op.signMode == HoleWindingRule)
| void MR::xyPlaneMeshIntersect | ( | const MeshPart & | meshPart, |
| float | zLevel, | ||
| FaceBitSet * | fs, | ||
| UndirectedEdgeBitSet * | ues, | ||
| VertBitSet * | vs, | ||
| std::vector< FaceId > * | fsVec = nullptr ) |
#include <MRMesh/MRMeshIntersect.h>
given mesh part and plane z=zLevel, outputs
| fs | triangles crossed or touched by the plane |
| ues | edges of these triangles |
| vs | vertices of these triangles |
| fsVec | triangles crossed or touched by the plane in unspecified order |
| int MR::IntersectionPrecomputes< T >::idxX = 0 |
| int MR::IntersectionPrecomputes< T >::idxY = 1 |
| Vector3<T> MR::IntersectionPrecomputes< T >::invDir |
{1 / dir}
| int MR::IntersectionPrecomputes< T >::maxDimIdxZ = 2 |
[0]max, [1]next, [2]next-next f.e. {1,2,-3} => {2,1,0}
| Vector3i MR::IntersectionPrecomputes< T >::sign |
stores signs of direction vector;
| T MR::IntersectionPrecomputes< T >::Sx |
precomputed factors
| T MR::IntersectionPrecomputes< T >::Sy |
| T MR::IntersectionPrecomputes< T >::Sz |