docs/kitbash.md: Rams and linkages: a zone's bounds, the proof between samples and what it costs, ram.Signed and the ray count's fixture
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
parent
f97beab77e
commit
f1d479b3a1
1 changed files with 39 additions and 15 deletions
|
|
@ -837,14 +837,32 @@ keeps (radius, gap, half the spacing). Its depth says how the member stands to t
|
|||
plate stacked on the pin, the bracket or horn the pin stands in. The member's axis then stays outside the part, so
|
||||
a pin whose place along the axis is inside what it claims to stand beside is refused: the gate does not take the
|
||||
record's x on trust. The pin's radius is for the pin through the member's eye, half the plate's thickness for the
|
||||
member's own plate, let over its length. Two plates stacked on a pin cross like scissors; the zone that lets one
|
||||
link by the other's plate reaches as far as the two part, (half width + what a link keeps) / sin of the least
|
||||
angle they cross at.
|
||||
member's own plate, which is zoned about both of the member's pins. Two plates stacked on a pin cross like
|
||||
scissors; the zone that lets one link by the other's plate reaches as far as the two part, (half width + what a
|
||||
link keeps) / sin of the least angle they cross at, and no further than the link is long. Two zones of one pair
|
||||
that both reach a sample let it the deeper of the two.
|
||||
|
||||
A zone is bounded by its member. Its radius and its depth are finite and no more than the member's length from pin
|
||||
to pin: a bar's length between its pins, and for the barrel and the rod the base's and the eye's distances from
|
||||
the centre the eye turns about, added. A `Mechanism` refuses a zone past that from its pins alone. Its depth is
|
||||
also no more than the member's eye on that pin (`Ram.eye`: `e_a` at the base, `e_b` at the rod's eye, `link_r` on
|
||||
a bar), which `from_record` and the gate refuse, so a world's answer is held to it as well. The record holds no
|
||||
plate widths, so the radius has no tighter bound than the length.
|
||||
|
||||
Between two samples of which either is in a zone the gate does not rely on the spacing. A distance changes by no
|
||||
more than the way between two points, so along a segment it is at least (g(a) + g(b) - length) / 2. Where that
|
||||
does not show the segment keeps `-depth`, the gate halves it and reads the midpoint, down to spacing / 64. A
|
||||
segment still unproved there against a part the axis is held outside (depth 0) is refused: the part is within
|
||||
spacing / 128 of the axis, crossed or touched, whatever its thickness. Against a part the axis may enter, the
|
||||
samples' readings stand, so a burial is read to spacing / 128. This asks of the oracle that it never reads more
|
||||
than the true distance.
|
||||
|
||||
What it gives up: inside a zone the gate holds only the member's axis `depth` from the part, not its surface a
|
||||
gap from it, so a link may graze the plate it scissors with anywhere within the stated radius, and a depth stated
|
||||
deeper than the eye lets the axis into the part that far. Both are numbers in the record, to be read. The members
|
||||
are round bars; a plate's flat sides are not modelled, which is why stacked plates need a zone at all.
|
||||
gap from it, so a link may graze the plate it scissors with anywhere within the stated radius. The members are
|
||||
round bars; a plate's flat sides are not modelled, which is why stacked plates need a zone at all. The proof
|
||||
between samples costs oracle calls: a depth stated with no slack over the burial (a bar's own plates at `link_r`)
|
||||
is halved to the floor along the whole zone. And it is along the axis at each checked angle; between two angles
|
||||
nothing is proved.
|
||||
|
||||
The oracle is `distance(part, points) -> distances`, `points` in the rest frame of the part's body. Each member is
|
||||
sampled along its axis at most `spacing` apart (default the barrel's radius) and carried into each body's rest
|
||||
|
|
@ -861,7 +879,8 @@ about R, and `d` about R for a bell crank, the eye standing at `a`'s place along
|
|||
least arm; a miss returns the tally by gate and the nearest miss. Clearance takes `world(m) -> (parts, touch,
|
||||
distance)`: a linkage's brackets and links are the candidate's own, so each candidate that reaches the gate is met
|
||||
with the parts its own pins place. What `world` returns is read as a record's: anything but the three, a part on
|
||||
no body of the kind, or a zone that is not a part, a pin the member rides, a radius and a depth is refused.
|
||||
no body of the kind, a zone that is not a part, a pin the member rides, a radius and a depth, or a zone wider or
|
||||
deeper than its member is refused.
|
||||
`swept` gives the ram's swept surface in any body's frame, for a recess.
|
||||
|
||||
### The record
|
||||
|
|
@ -872,7 +891,8 @@ It holds what is authored; barrel, closed length and link lengths are derived by
|
|||
reserved for a load-path ram's settle (stiffness, damping, travel); version 1 writes it null and solves none. A
|
||||
record of another schema or version (the integer 1: 1.0 and true are not it), with a key version 1 does not know or
|
||||
without one it does (at the top, in `ram`, `hinge`, `pins` or a zone), with a compliance block, or with a value
|
||||
that is not its field's (a finite number, the bore over 0, three numbers for a point) is refused whole, as a
|
||||
that is not its field's (a finite number, the bore over 0, three numbers for a point), or with a zone wider or
|
||||
deeper than its member is refused whole, as a
|
||||
`RamError` that names the field: a reader never reads past what it cannot solve. A `Ram` built by hand refuses the
|
||||
same numbers.
|
||||
|
||||
|
|
@ -882,9 +902,12 @@ Bore 0.042, range 0..-125. The kinematic rows are tests/test_ram.py's. The clear
|
|||
`tests/live/ram_knee.py`'s, Blender 5.3 (`ram_knee.result.json` is the last run): the knee as closed meshes the
|
||||
test generates (thigh with its front plate, shin with caps and armour, the bracket that carries R, the horn that
|
||||
carries `c`, twin link plates stacked 5 mm apart at x 0.31..0.345 and 0.35..0.385, pins through the knee's width,
|
||||
collars at the eye and a base clevis whose foot runs 0.01 into the thigh; 12 parts) and a signed BVH oracle: the
|
||||
nearest face for the depth, the crossing parity of three rays, by majority, for the side. One ray that grazes an
|
||||
edge miscounts and signs an isolated sample inside a plate it stands clear of.
|
||||
collars at the eye and a base clevis whose foot runs 0.01 into the thigh; 12 parts) and the package's signed BVH
|
||||
oracle, `ram.Signed(shells, cap)`: the nearest face for the depth, the crossing parity of three rays, by majority,
|
||||
for the side. One ray that runs through an edge or a vertex miscounts and signs a sample inside a plate it stands
|
||||
clear of. `tests/fixtures/ram_rays.json` holds the ray count: the rocker plates as the joint library builds them
|
||||
and 24 points between the plates, each on the first ray short of an edge or a vertex. One ray signs all 24
|
||||
inside; three sign none. Three rays are not a proof: of 146 such points one ray missigned, two rays missigned 16.
|
||||
|
||||
| drive | reading |
|
||||
| --- | --- |
|
||||
|
|
@ -896,10 +919,11 @@ edge miscounts and signs an isolated sample inside a plate it stands clear of.
|
|||
| bell-crank search on the meshes | 13,824 candidates, each world built from the candidate's pins: 78 pass the gates before clearance, 21 of them are refused on their own parts, the 22nd fits (arm 0.090, swing 99.9, pin load 0.73) and holds at 251 steps |
|
||||
|
||||
Cost on Starfire, Python 3.13, 100 repetitions paired and interleaved: one candidate's gates before clearance at
|
||||
49 steps took 1.07 ms median on the bell crank; its clearance against the analytic parts (50 pairs, 23,520
|
||||
points) added 56 ms (5th to 95th percentile 16 to 73, other work on the machine). A search without a world ran 1.6 to 1.8 ms a candidate over 3,456, so `limit`
|
||||
(20,000) is 30 to 40 s. On the meshes the bell crank's 60 pairs at 49 steps took 0.67 to 0.84 s capped, in a Python loop
|
||||
of BVH queries with three rays a sample, and the 13,824-candidate search with its 22 worlds 41 to 49 s.
|
||||
49 steps took 0.79 ms median on the bell crank; its clearance against the analytic parts (50 pairs) took 42 ms
|
||||
(5th to 95th percentile 38 to 57) over 97,875 points, of which 23,520 are the samples and the rest the halving in
|
||||
zones (the own plates, stated with no slack, to the floor); the samples alone took 11 ms. A search without a world ran 1.6 to 1.8 ms a candidate over 3,456, so `limit`
|
||||
(20,000) is 30 to 40 s. On the meshes the bell crank's 60 pairs at 49 steps took 1.95 to 2.12 s capped (two runs), in a
|
||||
Python loop of BVH queries with three rays a sample, and the 13,824-candidate search with its 22 worlds 43 s (one run).
|
||||
|
||||
## The actions
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue