33#include <NDEVR/Polygon.h>
34#include <NDEVR/PolyLine.h>
35#include <NDEVR/Plane.h>
36#include <NDEVR/Intersection.h>
45 template<u
int01 t_dims,
class t_type,
class t_vertex>
49 for (
uint01 dim = 0; dim < t_dims; ++dim)
51 if (vertex[dim] < bounds[
MIN][dim])
53 t_type val = bounds[
MIN][dim] - vertex[dim];
56 else if (vertex[dim] > bounds[
MAX][dim] )
58 t_type val = vertex[dim] - bounds[
MAX][dim];
64 template<u
int01 t_dims,
class t_type,
class t_vertex>
71 template<u
int01 t_dims,
class t_type,
class t_vertex_a,
class t_vertex_b>
78 for (
uint01 i = 0; i < t_dims; ++i)
87 t_type p1 =
getMax(t_type(0), t1.template dimensionalValue<MIN>(), t2.template dimensionalValue<MIN>());
88 t_type p2 =
getMax(t_type(0),
getMin(t1.template dimensionalValue<MAX>(), t2.template dimensionalValue<MAX>()));
91 val = p + v * t - val;
95 template<u
int01 t_dims,
class t_type,
class t_vertex_a,
class t_vertex_b>
101 template<u
int01 t_dims,
class t_type,
class t_vertex>
105 for (
uint01 dim = 0; dim < t_dims; ++dim)
107 if (a[
MAX][dim] < b[
MIN][dim])
109 t_type val = b[
MIN][dim] - a[
MAX][dim];
112 else if(a[
MIN][dim] < b[
MAX][dim])
114 t_type val = a[
MIN][dim] - b[
MAX][dim];
120 template<u
int01 t_dims,
class t_type,
class t_vertex>
123 return left.template closestPoints<t_type>(right, epsilon).
lengthSquared();
129 template<u
int01 t_dims,
class t_type,
class t_vertex>
134 template<u
int01 t_dims,
class t_type,
class t_vertex>
139 template<u
int01 t_dims,
class t_type,
class t_vertex>
149 return getMin(dist_a, dist_b, dist_c);
151 template<u
int01 t_dims,
class t_type,
class t_vertex>
158 template<u
int01 t_dims,
class t_type,
class t_vertex>
164 template<u
int01 t_dims,
class t_type,
class t_vertex>
170 template<
class epsilon_type, u
int01 t_dims,
class t_type,
class t_vertex>
175 template<
class t_type,
class t_other_type>
178 auto object = original_object.template as<2, t_type>();
197 template<
class t_type,
class t_other_type>
203 template<u
int01 t_dims,
class t_type,
class t_other_type>
221 template<u
int01 t_dims,
class t_type,
class t_other_type>
226 template<
class t_precision, u
int01 t_dims,
class t_type,
class t_vertex>
232 template<u
int01 t_dims,
class t_type,
class t_vertex>
237 template<
class t_precision, u
int01 t_dims,
class t_type,
class t_vertex>
#define lib_assert(expression, message)
Definition LibAssert.h:61
A specification of upper and lower bounds in N-dimensions.
Definition Bounds.hpp:52
constexpr bool contains(const t_type &value) const
Query if this object contains the given value. t_allow_bounds - whether or not to allow boundary case...
Definition Bounds.hpp:237
constexpr bool doesIntersect(t_type distance_a, t_type distance_b, const t_vertex &origin, const Vector< t_dims, t_type > &ray, uint01 exclusion_axis) const
Checks for intersection of the ray from a given distance, excluding one axis.
Definition Bounds.hpp:577
Dummy class for including distance functions.
Definition Distance.hpp:44
A line segment represented by two vertices, a start and end.
Definition Line.hpp:49
constexpr t_vertex ray() const
Definition Line.hpp:120
constexpr const t_vertex & vertex(uint01 index) const
Definition Line.hpp:152
constexpr t_type lengthSquared() const
Definition Line.hpp:463
Logic for a given plane or N-dimensions. Planes are coordinate systems of one less dimension than the...
Definition Geometry.h:41
t_type d
Definition Plane.hpp:223
Ray< t_dims, t_type > normal
Definition Plane.hpp:222
An N-sided polygon.
Definition Polygon.hpp:53
LineSegment< 2, t_type, t_vertex > edge(uint04 index) const
Definition Polygon.hpp:174
uint04 vertexCount() const
Definition Polygon.hpp:204
A polyline which stores vertex information for many points along a given path.
Definition CoordinateProjectionManager.h:44
uint04 vertexCount() const
Definition PolyLine.hpp:191
LineSegment< t_dims, t_type, t_vertex > segment(uint04 index) const
Definition PolyLine.hpp:161
const t_vertex & vertex(uint04 index) const
Definition PolyLine.hpp:143
A triangle is a polygon with three edges and three vertices. It is one of the basic shapes in geometr...
Definition Triangle.hpp:138
constexpr LineSegment< t_dims, t_type, t_vertex > edge(uint01 triangle_node_a, uint01 triangle_node_b) const
Definition Triangle.hpp:256
A fixed-size array with better performance compared to dynamic containers.
Definition Vector.hpp:60
constexpr t_type magnitudeSquared() const
Definition Vector.hpp:426
A vertex or point. A specific type of Vector used primarily for spacial location information.
Definition Vertex.hpp:48
constexpr t_type getMax(const t_type &left, const t_type &right)
Finds the max of the given arguments using the > operator The only requirement is that t_type have > ...
Definition BaseFunctions.hpp:94
t_type dot(const Vector< t_dims, t_type > &v1, const Vector< t_dims, t_type > &v2)
Definition VectorFunctions.hpp:1030
@ MIN
Definition BaseValues.hpp:196
@ MAX
Definition BaseValues.hpp:197
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:80
t_type distanceSquared(const Bounds< t_dims, t_type, t_vertex > &bounds, const Vector< t_dims, t_type > &vertex)
Definition Distance.hpp:46
@ outside
Definition BaseValues.hpp:211
IntersectionTypes classify(const Vector< t_dims, t_type > &v1, const Vector< t_dims, t_type > &v2)
Definition Intersection.hpp:329
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96
t_type sqrt(const t_type &value)
Definition VectorFunctions.hpp:1225
constexpr t_to cast(const Angle< t_from > &value)
Definition Angle.h:375
constexpr t_type distance(const t_vertex &vertex, const LineSegment< t_dims, t_type, t_vertex > &line)
Definition Distance.hpp:171
constexpr Vector< t_dims, t_type > ClosestPoint(const Triangle< t_dims, t_type, t_vertex > &tri, const t_vertex &point)
Definition Triangle.hpp:857
constexpr Angle< t_angle_type > abs(const Angle< t_angle_type > &value)
Changes an input with a negative sign, to a positive sign.
Definition AngleFunctions.h:645
@ B
Definition BaseValues.hpp:170
@ A
Definition BaseValues.hpp:168
@ C
Definition BaseValues.hpp:172
constexpr t_type getMin(const t_type &left, const t_type &right)
Finds the minimum of the given arguments based on the < operator Author: Tyler Parke Date: 2017-11-05...
Definition BaseFunctions.hpp:56
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...
Definition BaseValues.hpp:233