MeshLib Documentation
Loading...
Searching...
No Matches
MRTriDist.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRVector3.h"
4
5/*************************************************************************\
6
7 Copyright 1999 The University of North Carolina at Chapel Hill.
8 All Rights Reserved.
9
10 Permission to use, copy, modify and distribute this software and its
11 documentation for educational, research and non-profit purposes, without
12 fee, and without a written agreement is hereby granted, provided that the
13 above copyright notice and the following three paragraphs appear in all
14 copies.
15
16 IN NO EVENT SHALL THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL BE
17 LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR
18 CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE
19 USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY
20 OF NORTH CAROLINA HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH
21 DAMAGES.
22
23 THE UNIVERSITY OF NORTH CAROLINA SPECIFICALLY DISCLAIM ANY
24 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
26 PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
27 NORTH CAROLINA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
28 UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
29
30 The authors may be contacted via:
31
32 US Mail: E. Larsen
33 Department of Computer Science
34 Sitterson Hall, CB #3175
35 University of N. Carolina
36 Chapel Hill, NC 27599-3175
37
38 Phone: (919)962-1749
39
40 EMail: geom@cs.unc.edu
41
42
43\**************************************************************************/
44
45namespace MR
46{
47
58MRMESH_API float TriDist( Vector3f & p, Vector3f & q, const Vector3f s[3], const Vector3f t[3] );
59
62 // if both closest points are in segment endpoints, then directed from closest point 1 to closest point 2,
63 // if both closest points are inner to the segments, then its orthogonal to both segments and directed from 1 to 2,
64 // otherwise it is orthogonal to the segment with inner closest point and rotated toward/away the other closest point in endpoint
65 Vector3f & VEC,
66 Vector3f & X, Vector3f & Y, // closest points
67 const Vector3f & P, const Vector3f & A, // seg 1 origin, vector
68 const Vector3f & Q, const Vector3f & B);// seg 2 origin, vector
69
70} // namespace MR
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
Definition MRCameraOrientationPlugin.h:8
MRMESH_API float TriDist(Vector3f &p, Vector3f &q, const Vector3f s[3], const Vector3f t[3])
computes the closest points on two triangles, and returns the squared distance between them.
MRMESH_API void SegPoints(Vector3f &VEC, Vector3f &X, Vector3f &Y, const Vector3f &P, const Vector3f &A, const Vector3f &Q, const Vector3f &B)
Returns closest points between an segment pair.