Документация Engee

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

isparametrized(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.

paramdim(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

isperiodic(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

issimplex(geometry)

Tells whether or not the geometry is a simplex.

issimplex(connectivity)

Tells whether or not the connectivity is a simplex.

isclosed

isclosed(chain)

Tells whether or not the chain is closed.

A closed chain is also known as a ring.

isconvex

isconvex(geometry)

Tells whether or not the geometry is convex.

issimple

issimple(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

hasholes(geometry)

Tells whether or not the geometry contains holes.

point₁ ≤ point₂

<(A::Point, B::Point)

The lexicographical order of points A and B (<).

A < B if the tuples of coordinates satisfy (a₁, a₂, ...) < (b₁, b₂, ...).

>(A::Point, B::Point)

The lexicographical order of points A and B (>).

A > B if the tuples of coordinates satisfy (a₁, a₂, ...) > (b₁, b₂, ...).

≤(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₂, ...).

≥(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₂

≺(A::Point, B::Point)

The product order of points A and B (\prec).

A ≺ B if aᵢ < bᵢ for all coordinates aᵢ and bᵢ.

≻(A::Point, B::Point)

The product order of points A and B (\succ).

A ≻ B if aᵢ > bᵢ for all coordinates aᵢ and bᵢ.

⪯(A::Point, B::Point)

The product order of points A and B (\preceq).

A ⪯ B if aᵢ ≤ bᵢ for all coordinates aᵢ and bᵢ.

⪰(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

point ∈ geometry

Tells whether or not the point is in the geometry.

geometry₁ ⊆ geometry₂

geometry₁ ⊆ geometry₂

Tells whether or not geometry₁ is contained in geometry₂.

intersects

intersects(geometry₁, geometry₂)

Tells whether or not geometry₁ and geometry₂ intersect.

References

Notes

  • The fallback algorithm works with any geometry that has a well-defined supportfun.

supportfun(geometry, direction)

Support function of geometry for given direction.

References

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

iscollinear(A, B, C)

Tells whether or not the points A, B and C are collinear.

iscoplanar

iscoplanar(A, B, C, D)

Tells whether or not the points A, B, C and D are coplanar.