Predicates
This section lists predicates that can be used to check properties of geometric objects, both of themselves and relative to other geometric objects.
One important note to make is that these predicates are not necessarily exact. For example, rather than checking if a point p
is exactly in a sphere of radius r
centered at c
, we check if norm(p-c) ≈ r
with an absolute tolerance depending on the point type, so p
might be slightly outside the sphere but still be considered as being inside. This absolute tolerance can be adjusted in specific scopes as discussed in the Tolerances section.
Robust predicates are often expensive to apply and approximations typically suffice. If needed, consider ExactPredicates.jl or AdaptivePredicates.jl.
isparametrized
Meshes.isparametrized
— Functionisparametrized(object)
Tells whether or not the geometric object
is parametrized, i.e. can be called as object(u₁, u₂, ..., uₙ)
with local coordinates (u₁, u₂, ..., uₙ) ∈ [0,1]ⁿ
where n
is the parametric dimension.
See also paramdim
.
Meshes.paramdim
— Functionparamdim(geometry)
Return the number of parametric dimensions of the geometry
. For example, a sphere embedded in 3D has 2 parametric dimensions (polar and azimuthal angles).
See also isparametrized
.
paramdim(polytope)
Return the parametric dimension or rank of the polytope.
paramdim(connectivity)
Return the parametric dimension of the connectivity
.
paramdim(domain)
Return the number of parametric dimensions of the domain
as the number of parametric dimensions of its elements.
isperiodic
Meshes.isperiodic
— Functionisperiodic(topology)
Tells whether or not the topology
is periodic along each parametric dimension.
isperiodic(geometry)
Tells whether or not the geometry
is periodic along each parametric dimension.
isperiodic(grid)
Tells whether or not the grid
is periodic along each parametric dimension.
issimplex
Meshes.issimplex
— Functionissimplex(geometry)
Tells whether or not the geometry
is a simplex.
issimplex(connectivity)
Tells whether or not the connectivity
is a simplex.
isclosed
Meshes.isclosed
— Functionisclosed(chain)
Tells whether or not the chain
is closed.
A closed chain
is also known as a ring.
isconvex
Meshes.isconvex
— Functionisconvex(geometry)
Tells whether or not the geometry
is convex.
issimple
Meshes.issimple
— Functionissimple(polygon)
Tells whether or not the polygon
is simple. See https://en.wikipedia.org/wiki/Simple_polygon.
issimple(chain)
Tells whether or not the chain
is simple.
A chain is simple when all its segments only intersect at end points.
hasholes
Meshes.hasholes
— Functionhasholes(geometry)
Tells whether or not the geometry
contains holes.
point₁ ≤ point₂
Base.:<
— Method<(A::Point, B::Point)
The lexicographical order of points A
and B
(<
).
A < B
if the tuples of coordinates satisfy (a₁, a₂, ...) < (b₁, b₂, ...)
.
Base.:>
— Method>(A::Point, B::Point)
The lexicographical order of points A
and B
(>
).
A > B
if the tuples of coordinates satisfy (a₁, a₂, ...) > (b₁, b₂, ...)
.
Base.:≤
— Method≤(A::Point, B::Point)
The lexicographical order of points A
and B
(\le
).
A ≤ B
if the tuples of coordinates satisfy (a₁, a₂, ...) ≤ (b₁, b₂, ...)
.
Base.:≥
— Method≥(A::Point, B::Point)
The lexicographical order of points A
and B
(\ge
).
A ≥ B
if the tuples of coordinates satisfy (a₁, a₂, ...) ≥ (b₁, b₂, ...)
.
point₁ ⪯ point₂
Meshes.:≺
— Method≺(A::Point, B::Point)
The product order of points A
and B
(\prec
).
A ≺ B
if aᵢ < bᵢ
for all coordinates aᵢ
and bᵢ
.
Meshes.:≻
— Method≻(A::Point, B::Point)
The product order of points A
and B
(\succ
).
A ≻ B
if aᵢ > bᵢ
for all coordinates aᵢ
and bᵢ
.
Meshes.:⪯
— Method⪯(A::Point, B::Point)
The product order of points A
and B
(\preceq
).
A ⪯ B
if aᵢ ≤ bᵢ
for all coordinates aᵢ
and bᵢ
.
Meshes.:⪰
— Method⪰(A::Point, B::Point)
The product order of points A
and B
(\succeq
).
A ⪰ B
if aᵢ ≥ bᵢ
for all coordinates aᵢ
and bᵢ
.
point ∈ geometry
Base.in
— Methodpoint ∈ geometry
Tells whether or not the point
is in the geometry
.
geometry₁ ⊆ geometry₂
Base.issubset
— Methodgeometry₁ ⊆ geometry₂
Tells whether or not geometry₁
is contained in geometry₂
.
intersects
Meshes.intersects
— Functionintersects(geometry₁, geometry₂)
Tells whether or not geometry₁
and geometry₂
intersect.
References
- Gilbert, E., Johnson, D., Keerthi, S. 1988. A fast Procedure for Computing the Distance Between Complex Objects in Three-Dimensional Space
Notes
- The fallback algorithm works with any geometry that has a well-defined
supportfun
.
Meshes.supportfun
— Functionsupportfun(geometry, direction)
Support function of geometry
for given direction
.
References
- Gilbert, E., Johnson, D., Keerthi, S. 1988. A fast Procedure for Computing the Distance Between Complex Objects in Three-Dimensional Space
outer = [(0,0),(1,0),(1,1),(0,1)]
hole1 = [(0.2,0.2),(0.4,0.2),(0.4,0.4),(0.2,0.4)]
hole2 = [(0.6,0.2),(0.8,0.2),(0.8,0.4),(0.6,0.4)]
poly = PolyArea([outer, hole1, hole2])
ball1 = Ball((0.5,0.5), 0.05)
ball2 = Ball((0.3,0.3), 0.05)
ball3 = Ball((0.7,0.3), 0.05)
ball4 = Ball((0.3,0.3), 0.15)
intersects(poly, ball1)
true
intersects(poly, ball2)
true
intersects(poly, ball3)
true
intersects(poly, ball4)
true
iscollinear
Meshes.iscollinear
— Functioniscollinear(A, B, C)
Tells whether or not the points A
, B
and C
are collinear.
iscoplanar
Meshes.iscoplanar
— Functioniscoplanar(A, B, C, D)
Tells whether or not the points A
, B
, C
and D
are coplanar.