Points
Meshes.Point
— TypePoint{Dim,T}
A point in Dim
-dimensional space with coordinates of type T
.
The coordinates of the point are given with respect to the canonical Euclidean basis, and Integer
coordinates are converted to Float64
.
Examples
# 2D points
A = Point(0.0, 1.0) # double precision as expected
B = Point(0f0, 1f0) # single precision as expected
C = Point(0, 0) # Integer is converted to Float64 by design
D = Point2(0, 1) # explicitly ask for double precision
E = Point2f(0, 1) # explicitly ask for single precision
# 3D points
F = Point(1.0, 2.0, 3.0) # double precision as expected
G = Point(1f0, 2f0, 3f0) # single precision as expected
H = Point(1, 2, 3) # Integer is converted to Float64 by design
I = Point3(1, 2, 3) # explicitly ask for double precision
J = Point3f(1, 2, 3) # explicitly ask for single precision
Notes
- Type aliases are
Point1
,Point2
,Point3
,Point1f
,Point2f
,Point3f
Integer
coordinates are not supported because most geometric processing algorithms assume a continuous space. The conversion toFloat64
avoidsInexactError
and other unexpected results.
Meshes.embeddim
— Methodembeddim(point)
Return the number of dimensions of the space where the point
is embedded.
embeddim(domain)
Return the number of dimensions of the space where the domain
is embedded.
embeddim(geometry)
Return the number of dimensions of the space where the geometry
is embedded.
Meshes.coordtype
— Methodcoordtype(point)
Return the machine type of each coordinate used to describe the point
.
coordtype(domain)
Return the machine type of each coordinate used to describe the domain
.
coordtype(geometry)
Return the machine type of each coordinate used to describe the geometry
.
Meshes.coordinates
— Methodcoordinates(A::Point)
Return the coordinates of the point with respect to the canonical Euclidean basis.
Base.:-
— Method-(A::Point, B::Point)
Return the Vec
associated with the direction from point B
to point A
.
Base.:+
— Method+(A::Point, v::Vec)
+(v::Vec, A::Point)
Return the point at the end of the vector v
placed at a reference (or start) point A
.
Base.:-
— Method-(A::Point, v::Vec)
-(v::Vec, A::Point)
Return the point at the end of the vector -v
placed at a reference (or start) point A
.
Base.isapprox
— Methodisapprox(A::Point, B::Point)
Tells whether or not the coordinates of points A
and B
are approximately equal.