ConvexBodyProximityQueries.closest_pointsMethod
closest_points(p, q, dir; max_iter=100, atol=0.0)

Compute the closest points between convex objects p and q if they are not colliding within some tolerance. Provide an initial search direction dir in the space of the problem.

Return result of type Tuple with StaticArrays of the two closest points on each object.

Examples

julia> using StaticArrays
julia> p = SMatrix{2,3}([0.0 0.0 1.0; 0.0 2.0 1.0])
julia> q = SMatrix{2,3}([2.0 2.0 3.0; 0.0 2.0 1.0])
julia> dir = SVector{2}(1.0, 0.0)
julia> closest_points(p, q, dir)
([1.0, 1.0], [2.0, 1.0])
ConvexBodyProximityQueries.collision_detectionMethod
collision_detection(p, q, dir; max_iter=100)

Compute if the convex objects p and q are colliding. Provide an initial search direction dir in the space of the problem.

Examples

julia> using StaticArrays
julia> p = SMatrix{2,3}([0.0 0.0 1.0; 0.0 2.0 1.0])
julia> q = SMatrix{2,3}([2.0 2.0 3.0; 0.0 2.0 1.0])
julia> dir = SVector{2}(1.0, 0.0)
julia> collision_detection(p, q, dir)
false
ConvexBodyProximityQueries.findsimplexMethod
findsimplex(simplex)

Compute the new simplices from a pair of given simplices. Return the new search direction. Return a collision flag if the origin was enclosed by the Minkowski simplex.

ConvexBodyProximityQueries.minimum_distanceMethod
minimum_distance(p, q, dir; max_iter=100, atol=0.0)

Compute the minimum seperating distance between convex objects p and q within some tolerance. Provide an initial search direction dir in the space of the problem.

Examples

julia> using StaticArrays
julia> p = SMatrix{2,3}([0.0 0.0 1.0; 0.0 2.0 1.0])
julia> q = SMatrix{2,3}([2.0 2.0 3.0; 0.0 2.0 1.0])
julia> dir = SVector{2}(1.0, 0.0)
julia> minimum_distance(p, q, dir)
1.0
ConvexBodyProximityQueries.supportMethod
support(cvxpoly, dir)

Compute the point of contact between a convex object and its supporting hyperplane defined by the given normal direction as a StaticArray.

ConvexBodyProximityQueries.tolerance_verificationMethod
tolerance_verification(p, q, dir, τ; max_iter=100, atol=0.0)

Compute if the convex objects p and q are at least τ tolerance apart within some tolerance. Provide an initial search direction dir in the space of the problem.

Examples

julia> using StaticArrays
julia> p = SMatrix{2,3}([0.0 0.0 1.0; 0.0 2.0 1.0])
julia> q = SMatrix{2,3}([2.0 2.0 3.0; 0.0 2.0 1.0])
julia> dir = SVector{2}(1.0, 0.0)
julia> tolerance_verification(p, q, dir, 0.25)
true