DeformationPath Constructors
Main.DeformationPaths.DeformationPath — Type
DeformationPath(G, motion_samples[; tol])
DeformationPath(G, flex_mult, num_steps, type[; step_size, tol, random_flex, symmetric_newton, start_point])
DeformationPath(F, flex_mult, num_steps[; random_flex, kwargs...])Class for constructing approximate deformation paths.
Attributes
G::ConstraintSystem: The geometric constraint system for which the deformation is computes.step_size::Real: The step size of the deformation path.motion_samples::Vector{<:Vector{<:Real}}: Points in the configuration space representing the approximate motion.motion_matrices::Vector{<:Matrix{<:Real}}: The points inmotion_samplesas distributed into realizations given bydxnmatrices for the dimensiondand the number of verticesn.flex_mult::Vector{<:Real}: The initial infinitesimal flex as a linear combination of the nontrivial infinitesimal flexes at the realization provided by the underlying geometric constraint system._contacts::Vector: In some cases (such as sphere packings), the contacts can change during the deformation. This is reflected by this attribute.
Arguments
G::ConstraintSystem: The underlying geometric constraint system.motion_samples::Vector{<:Vector{<:Real}}: List of previously computed realizations in array format.flex_mult::Vector: The initial infinitesimal flex as a linear combination of the nontrivial infinitesimal flexes at the realization provided by the underlying geometric constraint system.num_steps::Int: Number of steps the algorithm is supposed to take.type::DataType: Type of the geometric constraint system for computing the trivial infinitessimal flexes. Possible values:"framework","angularframework","frameworkonsurface","hypergraph","polytope","diskpacking","bodyhinge","bodybar"and"sphericaldiskpacking".step_size::Real: Step size of the deformation path.tol::Real(optional): Numerical tolerance for the approximation that is used for asserting the correctness of the approximation. Default value:1e-8.random_flex::Bool(optional): Ifflex_multis not provided (e.g. as[]), we can instead provide a random linear combination (true) or it is uniformly chosen as[1,...,1](false). Default value:false.symmetric_newton::Bool(optional): It is possible to use the slightly more efficient symmetric Newton method (true) that uses fewer evaluations of the Jacobian, but may take more iterations. Alternatively, the standard Newton's method is used. Default value:false.start_point::Union{Nothing, Vector{<:Real}}(optional): Either, we can explicitly and manually provide a start point for the deformation path or the realization inGis automatically selected. Default value:nothing.
Examples
julia> F = Framework([(1,2)], [0 0; 1 0;])
julia> motion_samples = [[0,0,cos(θ),sin(θ)] for θ in 0:0.025:pi/2]
julia> DeformationPath(F.G, motion_samples)
Deformation Path:
Constraint System:
Vertices: [1, 2]
Equations: [-1.0 + (x₁₋₁ - x₁₋₂)^2 + (x₂₋₁ - x₂₋₂)^2]
Realization: 0.0 1.0
0.0 0.0
Motion: [
[0.0, 0.0, 1.0, ...],
[0.0, 0.0, 0.9996875162757026, ...],
[0.0, 0.0, 0.9987502603949663, ...],
[0.0, 0.0, 0.9971888181122075, ...],
...]
julia> F = Framework([(1,2),(2,3),(3,4),(4,1)], Matrix([0 0; 1 0; 1 1; 0 1;]'))
julia> DeformationPath(F.G, [], 4, typeof(F); step_size=0.1)
Deformation Path:
Constraint System:
Vertices: [1, 2, 3, 4]
Equations: [-1.0 + (x₁₋₁ - x₁₋₂)^2 + (x₂₋₁ - x₂₋₂)^2, -1.0 + (x₁₋₂ - x₁₋₃)^2 + (x₂₋₂ - x₂₋₃)^2, ...]
Realization: 0.0 0.0
1.0 0.0
1.0 1.0
0.0 1.0
Motion: [
[0.0, 0.0, 1.0, ...],
[0.03651261273911354, 0.03651261273911352, 1.0340219488467464, ...],
[0.07533400807826349, 0.07533400807826351, 1.0653837593220445, ...],
[0.11627080392220492, 0.11627080392220503, 1.0939292079679943, ...],
...]
Step Size: 0.1
Flex Selector: [1.0]
julia> F = BodyHinge([[1,2,3],[1,3,4],[1,4,5],[1,5,2]], Matrix([0 0 1; 1 -1 0; 1 1 0; -1 1 0; -1 -1 0;]'))
julia> DeformationPath(F, [], 5; step_size=0.01)
Deformation Path:
Constraint System:
Vertices: [1, 2, 3, 4, 5]
Equations: [-4.0 + (x₁₋₄ - x₁₋₅)^2 + (x₂₋₄ - x₂₋₅)^2 + (x₃₋₄ - x₃₋₅)^2, -3.0 + (x₁₋₁ - x₁₋₂)^2 + (x₂₋₁ - x₂₋₂)^2 + (x₃₋₁ - x₃₋₂)^2, ...]
Realization: 0.0 0.0 1.0
1.0 -1.0 0.0
1.0 1.0 0.0
-1.0 1.0 0.0
Motion: [
[0.0, 0.0, 1.0, ...],
[4.508862520636648e-17, 9.98697453244557e-18, 1.0001664436067044, ...],
[-1.4097240946269324e-17, 4.145853894815855e-17, 1.0006643327504479, ...],
[-5.097629777228046e-17, 3.7479573223418395e-17, 1.0014893737348445, ...],
...]
Step Size: 0.05
Flex Selector: [1.0]
Main.DeformationPaths.DeformationPath_EdgeContraction — Method
DeformationPath_EdgeContraction(F::Polytope, edge_for_contraction, contraction_target[; kwargs...])Create an approximate continuous motion from a Polytope object induced by continuously perturbing a single edge given by edge_for_contraction from its original length to the length contraction_target.
Arguments
F::Polytope: The underlying polytope.edge_for_contraction::Union{Tuple{Int,Int},Vector{Int}}: The edge inFthat is supposed to be contracted.contraction_target::Real: To what length ratio the edge is suppsed to be contracted.step_size::Real(optional): Step size of the deformation path.tol::Real(optional): Numerical tolerance for the approximation that is used for asserting the correctness of the approximation. Default value:1e-8.
Main.DeformationPaths.DeformationPath_EdgeContraction — Method
DeformationPath_EdgeContraction(F::Polytope, edge_for_contraction, contraction_target, contraction_start[; kwargs...])Create an approximate continuous motion from a Polytope object induced by continuously perturbing a single edge given by edge_for_contraction from the length contraction_start to contraction_target.
Arguments
F::Polytope: The underlying polytope.edge_for_contraction::Union{Tuple{Int,Int},Vector{Int}}: The edge inFthat is supposed to be contracted.contraction_target::Real: To what length ratio the edge is suppsed to be contracted.contraction_start::Real: The edge length where the induced deformation path begins.
For additional keywords, see DeformationPath_EdgeContraction(F::Polytope, edge_for_contraction::Union{Tuple{Int,Int},Vector{Int}}, contraction_target::Real).
Main.DeformationPaths.resolve_singularity — Function
resolve_singularity(G, motion_samples, failure_to_converge, motion_matrices, K_n, prev_flex, step_size[; tol, time_penalty, symmetric_newton])Attempts to resolve a singularity at motion_samples[end].
Main.DeformationPaths.stich_deformation_paths — Function
stich_deformation_paths(D1, D2)Combine the motion_samples of the two deformation paths D1 and D2.
We assume that both deformation paths start in the same configuration. The reversed=true keyword then reverses the first deformation path and deletes the first motion_sample of the second deformation path. In the case that reversed=false, the last realization of the first deformation path needs to be the first realization of the second deformation path.
Arguments
D1::DeformationPath: FirstDeformationPath.D2::DeformationPath: SecondDeformationPath.reversed::Bool(optional): Determines whether the first deformation path is reversed or not. Default value:true.