Joint dialog: Find Limits fills the limits from where parts collide (#5968) (#7047)

* claim: #5968

* Joint dialog: Find Limits fills the limits from where parts collide (#5968)

joint.find_limits sweeps each value of a joint both ways from where it is,
on a copy and with its own limits left out, and answers where the parts it
moves first touch another part, where a closed loop stops closing, or that
nothing is met within a turn (angles) or the parts' reach (distances).
Edit Joint's Limits section gets a Find Limits button that runs it on the
joint as the dialog has it, off the window thread, and fills the rows.

joint.sweep now tells touching bodies apart from the other bodies of the
same two parts: on the Hinge Assembly sample the pins touch where it starts,
and the plates used to pass through each other unnoticed.

* find_limits: read the session only

* find_limits: a joint with nothing to meet, edits during a search, tiny ranges

* find_limits: keep touching at the start per pair of parts

Per body, the Hinge Assembly sample's plates, which only come flush in
the end plane the two leaves share, stopped the search. The leaves never
pass into each other: the sample's answer is a whole turn.

* find_limits: touching boxes cost no collision work; stale results and rounding

* find_limits: each pair of bodies of resting parts held to its own depth; loops without bodies

* find_limits: a 32-bit budget it can pass, a repaint with the result, a bad form says so first

* find_limits: each pair of resting bodies gets its own margin

* find_limits: Arabic, Hebrew and Vietnamese strings (complete catalogs on main)

* find_limits: search the joint with Edit Joint's side picks

Edit Joint now keeps the joint's sides as picks in its inputs, and its OK
commands compare them with what it opened on. Built without them, the
commands Find Limits applies first asked for the sides again, so every
search failed.

---------

Co-authored-by: MateuszSychXpl <151755914+MateuszSychXpl@users.noreply.github.com>
This commit is contained in:
Mateusz Sych
2026-11-02 18:28:28 +00:00
committed by GitHub
parent ca4796921f
commit dadefec702
12 changed files with 1195 additions and 99 deletions
+19
View File
@@ -383,6 +383,25 @@ listed in `touching_at_start` and stop the sweep only once they pass into each o
they start. The sweep runs on a copy (closed loops follow, contact sets don't stop it) and
leaves the design as it was unless `apply` is true.
**Find Limits.** In **Edit Joint**, the **Limits** section's **Find Limits** button fills in each
value's Minimum and Maximum from where the parts the joint moves first touch another part,
turning or sliding each way from where the joint is now, and ticks its limits. It searches the
joint as the dialog has it (a type, flip or offset changed but not yet applied included), on a
copy: nothing changes until **OK**, so the values can still be rounded or edited. They are
rounded toward the joint's value (a tenth of a degree, a hundredth of the length unit) so they
stay clear, and a line under each value says what stopped each side. An angle is searched a turn
each way: a side that meets nothing is set a turn from the other side, or half a turn each way
when nothing is met at all. A distance is searched as far as the parts reach; a side that meets
nothing there keeps what it had, and the limits stay off until both sides are found. Parts
already in each other where the joint is now are named, and stop the search only once they go
deeper. The search runs while the window goes on (Cancel drops it). `joint.find_limits {joint,
index?, refine?, step?, occurrences?, against?, contact_sets?}` answers the same: for each value
its `min` and `max` (`null` where a distance meets nothing), what stopped each side (`min_by`,
`max_by`: the two parts and where they touch, or `"loop"`, `"limit"` (the limit of
another of its values, or of another joint through a motion link), `"turn"` or `"range"`), the `range` searched, and the parts `touching_at_start`
and `overlapping_at_start` (with `depth_mm`). The joint's own limits are left out of the search,
closed loops follow, and each side is bisected to `refine` as `joint.sweep` does.
**Insert Design** (`component.insert_design {path, translate?}`, on the **ASSEMBLE** panel and
in the **File** menu) adds a component linked to another saved design, so each part can live in
its own document. When other designs are open in tabs, the button first lists them under