WIP: Manipulate the assembly #29
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "tangent-space"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Find the tangent space of the solution variety and use it to interactively deform the assembly.
Tangent space
Implementation
The structure
engine::ConfigSubspace
represents a subspace of the configuration vector space\operatorname{Hom}(\mathbb{R}^n, \mathbb{R}^5)
. It holds a basis for the subspace which is orthonormal with respect to the Euclidean inner product. The methodConfigSubspace::symmetric_kernel
takes an endomorphism of the configuration vector space, which must be symmetric with respect to the Euclidean inner product, and returns its approximate kernel in the form of aConfigSubspace
.At the end of
engine::realize_gram
, we use the computed Hessian to find the tangent space of the solution variety, and we return it alongside the realization. Since altering the constraints can change the tangent space without changing the solution, we compute the tangent space even when the guess passed to the realization routine is already a solution.After
Assembly::realize
callsengine::realize_gram
, it saves the returned tangent space in the assembly'stangent
signal.Automated testing
The test
engine::tests::tangent_test
builds a simple assembly with a known tangent space, runs the realization routine, and checks the returned tangent space against a hand-computed basis.Limitations
The method
ConfigSubspace::symmetric_kernel
approximates the kernel by taking all the eigenspaces whose eigenvalues are smaller than a hard-coded threshold size. We may need a more flexible system eventually.Since a
ConfigSubspace
stores motions in matrix form, the tangent space saved byAssembly::realize
only makes sense as long as the number of elements in the assembly and the elements' column indices stay the same. The column indices aren't designed to be used like this: they were originally only meant to be read and written withinAssembly::realize
. If we really want to use the column indices betweenAssembly::realize
calls, we should work harder to keep them valid between calls.For the zero subspace,
ConfigSubspace.proj
panics, rather than returning zero as its name suggests it should.Deformation
Implementation
The main purpose of this implementation is to confirm that deformation works as we'd hoped. The code is messy, and the deformation routine has at least one numerical quirk.
For simplicity, the keyboard commands that manipulate the assembly are handled by the display, just like the keyboard commands that control the camera. Deformation happens at the beginning of the animation loop.
The function
Assembly::deform
works like this:v
of the whole assemblyv
realize
to bring the assembly back onto the solution varietyManual testing
To manipulate the assembly:
x
translationy
translationz
translationLimitations
Because the manipulation commands are handled by the display, you can only manipulate the assembly when the display has focus.
Since our test assemblies only include spheres, we assume in
Assembly::deform
that every element is a sphere.When the tangent space is zero,
Assembly::deform
does nothing except print "The assembly is rigid" to the console.During a deformation, the curvature and co-curvature components of a sphere's vector representation can exhibit weird discontinuous "swaps" that don't visibly affect how the sphere is drawn. [I'll write more about this in an issue.]
symmetric_kernel
for non-WASM targets 90834fbb93Manipulate the assemblyto WIP: Manipulate the assemblyCheckout
From your project repository, check out a new branch and test the changes.