ConvexBodyProximityQueries.closest_points
— Methodclosest_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_detection
— Methodcollision_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.findsimplex
— Methodfindsimplex(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_distance
— Methodminimum_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.nearestfromsimplex
— Methodnearestfromsimplex(psimplex, qsimplex, dir2origin)
Compute the nearest points between two simplexes given the direction to in origin in the Minkowski difference space
ConvexBodyProximityQueries.proj
— Methodproj(u, v)
Compute the vector projection of vector v
onto vector u
.
ConvexBodyProximityQueries.support
— Methodsupport(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_verification
— Methodtolerance_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