Repository navigation
fix(hypergraph): keep a slider's line through from_mechanism, count pairs in indeterminacy - #61
Merged
Merged
Conversation
…airs in indeterminacy Three loose ends from #56 (PR #60). from_mechanism dropped the slide line of a PrismaticJoint, which has line_point and axis but no joints on the line to hang a hyperedge on, so slider_crank() → from_mechanism → to_mechanism failed with "Could not determine solve order". It now writes the encoding to_mechanism reads: a hyperedge over the slider and two ground nodes on the line. Ground joints already on the line are reused, and missing ones are added as <id>_rail0 / <id>_rail1 at line_point and one axis length along. The round trip reproduces the original simulation and a second pass adds no node. to_mechanism built a prismatic driver node — a LinearActuator — as a rotary crank without a word. Mechanism has no linear driver link, so it now raises NotImplementedError. Mechanism.indeterminacy() counted every joint as a kinematic pair. A joint on k links joins them with k − 1 pairs: a ground joint that only marks a point of the frame, or a coupler point, is no pair, and a PrismaticJoint adds the prismatic pair with the frame its slide line stands for. The round-tripped slider-crank reported −1, a four-bar with a coupler point and a frame mark −3; both are 1 now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #60 / #56 — the three gaps noted there.
from_mechanismkeeps aPrismaticJoint's slide line. APrismaticJointhasline_pointandaxisbut no joints on the line, so nothing was emitted for it andslider_crank()→from_mechanism→to_mechanismfailed with "Could not determine solve order". It now writes the encodingto_mechanismreads: a hyperedge over the slider and two ground nodes on the line. Ground joints already on the line are reused (the motor pivot ofslider_crank()is one), and missing ones are added as<id>_rail0/<id>_rail1atline_pointand one axis length along. The round trip reproduces the original to ~1e-15 for horizontal, slanted and vertical rails, and a second pass adds no node.to_mechanismrefuses a prismatic driver node. ALinearActuatorwas silently built as a rotary crank.Mechanismhas no linear driver link, so this is now aNotImplementedErrorwith the reason — adding aLinearDriverLinkis a feature (step, derivatives, builder, serialization, numba path) and out of scope here.Mechanism.indeterminacy()counts pairs, not joints. A joint onklinks joins them withk − 1pairs: a ground joint that only marks a point of the frame, or a coupler point, is no pair, and aPrismaticJointadds the prismatic pair with the frame its slide line stands for. The round-tripped slider-crank reported −1, a four-bar with a coupler point and a frame mark −3; both report 1 now.fourbar()andslider_crank()are unchanged at 1.