From 38d08f0196313c6f0593a1b3bbe0a01bdf22fe26 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Wed, 2 Dec 2026 17:47:42 +0100 Subject: [PATCH] live kitbash_hose: a 1 mm plate between two rolls, the coarsest step, a second bundle at the default step, a straight only verify measures; CLEAR and KEPT by the margin rule; docs (cut kit-hose, h2) CLEAR 0.017: shipped worst 0.032, mutant H4b (verify refuses nothing) 0.0089. KEPT 0.019: shipped 0.028, C1 0.013. Co-Authored-By: Claude Fable 5.2 --- surfaces/blender/docs/kitbash.md | 68 +++++--- surfaces/blender/tests/live/kitbash_hose.py | 114 ++++++++++++-- .../tests/live/kitbash_hose.result.json | 145 +++++++++++++----- 3 files changed, 252 insertions(+), 75 deletions(-) diff --git a/surfaces/blender/docs/kitbash.md b/surfaces/blender/docs/kitbash.md index 2a322b1..cc40f17 100644 --- a/surfaces/blender/docs/kitbash.md +++ b/surfaces/blender/docs/kitbash.md @@ -599,14 +599,27 @@ pulled taut. The legs joined are one polyline, and each corner is rounded by the allows: the arc stands within `radius * (1 - cos(turn / 2))` of its two tangent segments, so with that much room beyond the clearance measured along them it keeps the clearance. Where two arcs would overlap on a segment both shrink in proportion. The floor is `bend` outside diameters for the innermost hose (the centre line's is half the -bundle's spread more); a corner that gets less is refused, naming its point, the radius it got and the floor. The -finished curve is measured once more against every mesh before anything is written. +bundle's spread more). The finished curve is measured once more against every mesh before anything is written. -A corner that wraps an edge stands about 0.87 of a voxel beyond the clearance, and that is its room: the radius it -can get is `0.87 * step / (1 - cos(turn / 2))`. When a bend round an edge is refused under the floor, raise `step` -(the hose then swings wider), lower `clearance` or `bend`, or give the hose a clamp to steer it. A 90 degree bend -straight out of a fitting needs `0.29 * floor` of room at the lead's end, which a bundle of three at the default -clearance of 0.01 does not have: 0.005 does. +**Measured, not sampled.** Every line the route trusts (a sight line of the pull, a tangent segment's room, the +finished curve, each side at each roll) is measured by `route.measure`: a reading answers for the piece of line +around it, less half the piece's length, because a distance to obstacles changes by no more than the distance +moved. A piece that this proves clear is done, one that reads under the need is refused, and any other is halved, +down to 1 mm. So a plate thinner than any spacing cannot stand unseen between two readings, and no measurement +depends on `step`: `step` sets only how fine the search for a way is. The price is half a millimetre: a line that +keeps the clearance by less than that cannot be proven and is refused as too near. + +**Room for the bends.** A line pulled taut at the clearance alone grazes whatever it wraps, and the corner there +has no room for an arc; how much it happened to keep changed with `step`, so a bundle could route at 0.02 and at +0.03 and be refused at 0.0125. Each leg is therefore searched and pulled with room for its bends first: 0.29 of the +floor beyond the clearance, what the arc of a quarter turn at the floor takes (within twice that of a leg's end +the pull asks half the distance from the end instead, since an end stands where it is given). A leg with no way +that roomy (a clamp stands nearer its seat than that, and so does a gap the bundle only just passes) is searched +again without, and the hose is longer where the roomy way goes round. A corner under the floor is refused by what +limits it: the bundle too stiff for the route (the corner's segments are shorter than its tangent at the floor), +an obstacle too near the corner's segments for the arc (both distances named), or two corners that cannot share +the segment between them. The remedies are a lower `bend`, thinner or fewer hoses, waypoints further apart (a +larger `standoff`), or a clamp that leads the hose wide; a different `step` is not one. **Slack.** `sag` (outside diameters, default 1) lowers the middle of each free span's longest segment along world -z, by less where the span runs steeply, and never by more than half the room measured along it: both halves then @@ -623,17 +636,30 @@ between clamps, and a later clamp's strap follows the bundle as it arrives. `joint` names a socket on that pin's axis whose z runs along it (the free end face of the pin: a strut's `end_a_back`), a `standoff` and the pin's roll `range`. The hose passes through the point `standoff` beyond that socket, on the axis, as a robot's dress pack does: the straights on each side then move with their own part and -only the bend at that point changes with the roll. Every roll from `lo` to `hi` in steps of 5 degrees is measured -without posing anything: the child's side of the polyline is turned about the axis, the corner at the pin point is -rounded again, and each side is measured against the other side's parts where that roll puts them. A roll that -fails is refused by name (`roll 50: the hose's child's side stands 0.02384 m from the parts on the other side of -the pin`). `lengthChange` is the centre line's longest less its shortest over the range, as each roll rounds the +only the bend at that point changes with the roll. The whole range is measured without posing anything, not a +list of rolls in it. Each roll from `lo` to `hi` in steps of 5 degrees answers for the rolls nearer it than any +other: within such a bin of half width w a point that stands rho from the pin's axis moves at most `rho * w` +against the other side's parts, so its reading against them counts for that much less. The bend at the pin has one +radius through a bin, the largest that fits at the bin's sharpest turn, and its two tangent segments are measured +for the clearance and the arc's dip more. A bin that falls short is halved and measured again at each half's +middle, down to 0.3 degrees of half width, so a range that is clear costs 9 rolls for 40 degrees and one that +passes near a part costs more only there (`rolls` reports how many were measured). A range that fails is refused +by roll, side and point (`roll 49.22: the hose's child's side reads 0.02653 m from the parts about the pin at +[-0.2107, -0.2043, 0.7271], counting the 0.0005832 m it can move against the other side's through the 0.156 degrees +either side of it: under the 0.0266 m the bundle needs`); when the sagged route and the taut one both fail the +refusal names both. `worstClearance` is the least reading over the range, each less what its point can move within +its bin. `lengthChange` is the centre line's longest less its shortest over the rolls measured, as each rounds the bend. Two pins between the ends are refused: end the hose on a part between them. +Another hose through the same pin bends with it and belongs to neither side. A route keeps clear of it where it +stands, and across the rolls each hose is measured against the parts of the two sides, not against where the other +hose stood: give two hoses through one pin different standoffs, and their clearance from each other holds at the +pose they were routed at. + **What it writes.** One mesh object, a child of the start's object under identity matrices, with no modifier and no material: each hose, two ferrule collars at each of its ends, and the clamps, all swept by `core.sweep`. -`kit_hose` on it is the request as JSON, a record nothing reads back. Other hoses are obstacles like any mesh, so -route the stiffest first. The hose is a bake of the scene at the call: after a part moves or rolls, run `hose` +`kit_hose` on it is the request as JSON; the one thing read back from it is which two parts a hose joins, by a +later hose that crosses the same pin. Other hoses are obstacles like any mesh, so route the stiffest first. The hose is a bake of the scene at the call: after a part moves or rolls, run `hose` again with the same `object_name` and it is rebuilt in place. A hose that crosses a pin stays one object. In the exported mesh it is skinned geometry, meant to be weighted @@ -646,7 +672,7 @@ names no object, no such socket, or a socket of the wrong type; a bundle wider t part that is scaled or that Blender does not evaluate; a pin crossed with no `joint`, a `joint` with no pin, two pins, a `joint` socket off the pin's axis, the current roll outside `range`; a search box over 524288 voxels, naming a step that fits; an end nearer an obstacle than the bundle needs; no way through; a corner under the -floor; a roll that fails. +floor, by what limits it; a curve not proven to keep the clearance, naming the point; a roll that fails. **Cost.** Probes in Blender 5.3 on Starfire, medians of 3 interleaved repetitions: a nearest-face query on a tree of 81,920 faces takes 100 to 123 us uncapped and 3.4 us capped at 0.06 m, so every query is capped; on a grid of @@ -654,13 +680,13 @@ floor; a roll that fails. a knee of five boxes (96,565 voxels at 0.02 m) the occupancy took 0.46 s uncapped, the search 0.19 s, the pull, the fillet and the verification under 2 ms together, 27 rolls 0.056 s and the sweep of three hoses 4 ms. The live knee of `tests/live/kitbash_hose.py` (two struts, two actuators and a plate; two legs of 79,488 and 53,406 -voxels at roll 0, timed at roll 10; three hoses of 3,378 faces, 9 rolls) took 0.50 s a call, median of 3 each after one report action: 0.28 s of it -the occupancy (55 percent), 0.05 s the wavefront, 0.04 s the rolls, 0.02 s the fillet and its room, 0.01 s the -pull and the verification, and the rest the trees, the sweep and the write. The same call read 0.47 to 1.1 s -across runs while other Blenders were rendering on the machine. +voxels at roll 0, timed at roll 10; three hoses, 9 rolls) took 0.80 s a call, median of 3 each after one report +action, where it took 0.50 s when lines were sampled at half a voxel and each leg was searched once: the occupancy +is read to a larger cap and the room, the curve and the rolls are measured to 1 mm near what they pass. -`tests/test_route.py` proves the path without Blender (the half-diagonal rule, the fillet's tangency, sharing, room -and floor, the sag's bound, the frames against the double reflection method, the rolls), and +`tests/test_route.py` proves the path without Blender (the half-diagonal rule, a plate between two readings, a leg's +room where it wraps, the fillet's tangency, sharing, room and floor, the sag's bound, the frames against the double +reflection method, the rolls and a plate between two of them, the bend at the pin's room), and `tests/live/kitbash_hose.py` the action in Blender. ## Expressions diff --git a/surfaces/blender/tests/live/kitbash_hose.py b/surfaces/blender/tests/live/kitbash_hose.py index 0355a38..b9a74ca 100644 --- a/surfaces/blender/tests/live/kitbash_hose.py +++ b/surfaces/blender/tests/live/kitbash_hose.py @@ -68,20 +68,19 @@ LEAD = 8.0 * RADIUS FLOOR = 4.0 * 2.0 * RADIUS + SPREAD # of the centre line: the innermost hose keeps 4 outside diameters BUNDLE = {"count": COUNT_HOSES, "radius": RADIUS, "clearance": CLEARANCE} # Metres between a hose's surface and the nearest other mesh, read on the hose's own vertices further than the lead -# from both its ports (the least is the worst). The action promises the clearance asked for, 0.005, beyond the -# bundle's envelope, and a vertex of a 12-sided tube swept over chords of a 24th of a radian stands inside its circle -# by under 0.0002: the bound is that promise less the faceting. Shipped worst 0.030 (the second hose beside the -# first). No mutant of the cut's list lowers this reading: H10 (other hoses no obstacles) dies where a third hose is -# refused at a port a hose already holds, H4 (no verification) at tests/test_kitbash.py's count of route.verify, and -# H3 and H12 at tests/test_route.py; the reading is claimed by none of them and stands as the action's own promise. -CLEAR = 0.0048 +# from both its ports (the least is the worst), over every hose this suite makes. Shipped worst 0.032. Least claimed +# mutant 0.0089: H4b (route.verify measures and refuses nothing) accepts the hose past the plate beside a port's +# straight, section "verify", and the ring of it nearest the plate reads that; shipped refuses it and makes no hose. +# The geometric mean, separation 1.9 each side. +CLEAR = 0.017 # Metres a clamped hose's ring vertices stand off the radius about its own line over a clamp (the line through the # clamp point along the socket's y, offset across the bundle), over the 24 nearest; 1 when a hose has no 24 vertices # there. Shipped worst 4.6e-08 (float32 meshes); least claimed mutant 1 (C2, the straight laid along the socket's x: -# the route is refused, or no ring stands on the line); the geometric mean, separation 4700 each side. C1 (no -# straight kept at a clamp) reads 0.013 on `kept`, the least distance along the line from a clamp point to a ring, -# where shipped reads 0.028 and the promise is 0.024, two outside diameters. +# the route is refused, or no ring stands on the line); the geometric mean, separation 4700 each side. CLAMPED = 2.1e-4 +# Metres along a clamped hose's line from a clamp point to the nearest ring of a bend. Shipped 0.028; least claimed +# mutant 0.013 (C1, no straight kept at a clamp); the geometric mean, separation 1.47 each side. +KEPT = 0.019 def check(name, ok, detail=None): R["checks"].append({"name": name, "ok": bool(ok), "detail": None if ok else detail}) @@ -236,7 +235,7 @@ try: receipt, report = send("brokkr_kitbash.hose", **FEED) R["reports"]["feed"] = report check("hose-behind-armour: three hoses route from the thigh's ram to the shin's, round the plate and through the pin point", - receipt["status"] == "accepted" and report["hoses"] == 3 and not report["rebuilt"] and report["nonManifoldEdges"] == 0 and report["rolls"] == 9 + receipt["status"] == "accepted" and report["hoses"] == 3 and not report["rebuilt"] and report["nonManifoldEdges"] == 0 and report["rolls"] >= 9 and report["clearance"] >= CLEARANCE and report["worstClearance"] >= CLEARANCE and report["radii"]["least"] >= FLOOR * (1 - 1e-6) and len(report["voxels"]) == 2, [receipt["status"], receipt["message"], report]) feed = bpy.data.objects["Feed"] @@ -261,12 +260,61 @@ try: _, again = send("brokkr_kitbash.hose", **FEED) check("a rebuild at the same pose reports what the first call did", {**again, "rebuilt": False} == report and len(bpy.data.meshes) == len(state[1]) + 1, again) check("hose-through-range: the range passes and reports the length's change", report["lengthChange"] is not None and report["lengthChange"] >= 0 and report["worstRoll"] is not None, report) - refused("a range that swings the shin's hose into the thigh's parts", {**FEED, "joint": json.dumps({**JOINT, "range": [-20, 90]})}, - "roll 50: the hose's child's side stands 0.02384 m from the parts on the other side of the pin, under the 0.0266 m the bundle needs") + refused("a range that swings the shin's hose into the thigh's parts, naming the sagged attempt and the taut one", {**FEED, "joint": json.dumps({**JOINT, "range": [-20, 90]})}, + "sagged: roll 49.22: the hose's child's side reads 0.02653 m from the parts about the pin at [-0.2107, -0.2043, 0.7271], counting the 0.0005832 m it can move against the other side's " + "through the 0.156 degrees either side of it: under the 0.0266 m the bundle needs; taut: roll 50.78: the hose's child's side reads 0.0264 m") + receipt, _ = send("brokkr_kitbash.hose", **{**FEED, "joint": json.dumps({**JOINT, "range": [-20, 90]})}) + check("the refusal names both attempts, each by its roll and its side", "sagged: roll " in str(receipt["message"]) and "; taut: roll " in str(receipt["message"]) + and str(receipt["message"]).count("the hose's child's side reads") == 2, receipt["message"]) + section("thin plate") + # A plate 1 mm thick, 4 cm square, on the thigh, where a point of the shin's side of a single hose stands at roll + # -17.5: between two of the rolls 5 degrees apart. At -20 and at -15 the hose keeps its need from it. + SINGLE = {**FEED, "object_name": "Single", "start": "ActT:port_rod", "end": "ActS:port_rod", "count": 1, "joint": json.dumps({**JOINT, "standoff": 0.24})} + _, single = send("brokkr_kitbash.hose", **SINGLE) + line = world_points(bpy.data.objects["Single"]) + pivot = frame(shin, "end_a_back") + origin, axis = pivot[:3, 3], pivot[:3, 2] + beyond = line[(line[:, 2] > origin[2] + 0.1) & (np.linalg.norm(line - frame(lower, "port_rod")[:3, 3], axis=1) > 0.15)] + far_point = beyond[np.argmax(np.linalg.norm(np.cross(beyond - origin, axis), axis=1))] + turn = math.radians(-17.5) + rel = far_point - origin + at = origin + rel * math.cos(turn) + np.cross(axis, rel) * math.sin(turn) + axis * float(rel @ axis) * (1.0 - math.cos(turn)) + way = np.cross(axis, at - origin) + way /= np.linalg.norm(way) + out = np.cross(way, axis) + corners = [at + axis * a * 0.02 + out * b * 0.02 + way * c * 0.0005 for c in (-1, 1) for a in (-1, 1) for b in (-1, 1)] + thin = bpy.data.objects.new("Thin", bpy.data.meshes.new("Thin")) + thin.data.from_pydata([tuple(v) for v in corners], [], [(0, 1, 3, 2), (4, 6, 7, 5), (0, 4, 5, 1), (1, 5, 7, 3), (3, 7, 6, 2), (2, 6, 4, 0)]) + bpy.context.scene.collection.objects.link(thin) + bpy.context.view_layer.update() + thin.parent = thigh + thin.matrix_parent_inverse = thigh.matrix_world.inverted() + bpy.context.view_layer.update() + check("the plate stands in the single hose's swing, over 0.03 from where it stands now", single is not None and float(np.linalg.norm(line - at, axis=1).min()) > 0.03, float(np.linalg.norm(line - at, axis=1).min())) + refused("range-sampled-not-swept: a 1 mm plate the hose crosses between two rolls 5 degrees apart", SINGLE, "roll -1") + receipt, _ = send("brokkr_kitbash.hose", **SINGLE) + named = [float(part.split(":")[0]) for part in str(receipt["message"]).split("roll ")[1:]] + check("the refusal names a roll between -20 and -15 for each attempt", len(named) >= 1 and all(-20.0 < roll < -15.0 for roll in named), receipt["message"]) + receipt, narrow = send("brokkr_kitbash.hose", **{**SINGLE, "joint": json.dumps({**JOINT, "standoff": 0.24, "range": [-10, 20]})}) + check("short of the plate the same hose passes its range", receipt["status"] == "accepted" and narrow["rolls"] >= 7, receipt["message"]) + for name in ("Thin", "Single"): + gone = bpy.data.objects[name] + mesh = gone.data + bpy.data.objects.remove(gone) + bpy.data.meshes.remove(mesh) + bpy.context.view_layer.update() + section("coarse step") + # coarse-step-cuts-thin-plate: no measurement of a hose depends on the search's step. At the coarsest step the + # single taut hose of the finding and the bundle both keep the clearance from the 2 cm armour plate. + for label, extra in (("one taut hose", {"count": 1, "sag": 0.0}), ("the bundle", {})): + receipt, coarse = send("brokkr_kitbash.hose", **{**FEED, "step": 0.2, **extra}) + check(f"at step 0.2 {label} routes and keeps the clearance from every other mesh", receipt["status"] == "accepted" and coarse["rebuilt"] and coarse["clearance"] >= CLEARANCE + and reading("clear", surface_clearance(feed, ports), least=True) >= CLEAR, [receipt["message"], R["readings"]]) + section("range") send("brokkr_kitbash.roll", object_name="Shin", roll=10.0) bpy.context.view_layer.update() receipt, rolled = send("brokkr_kitbash.hose", **FEED) - check("after a roll the hose rebuilds in place on its name", receipt["status"] == "accepted" and rolled["rebuilt"] and bpy.data.objects["Feed"] == feed and rolled["rolls"] == 9, receipt["message"]) + check("after a roll the hose rebuilds in place on its name", receipt["status"] == "accepted" and rolled["rebuilt"] and bpy.data.objects["Feed"] == feed and rolled["rolls"] >= 9, receipt["message"]) check("the rebuilt hose keeps the clearance at the new pose", reading("clear", surface_clearance(feed, [frame(upper, "port_cap")[:3, 3], frame(lower, "port_cap")[:3, 3]]), least=True) >= CLEAR, R["readings"]) mesh = feed.data bpy.data.objects.remove(feed) @@ -277,10 +325,16 @@ try: check("hose-through-range: roll then rebuild gives the same report as a fresh hose", receipt["status"] == "accepted" and {**rolled, "rebuilt": False} == fresh, [rolled, fresh]) R["seconds"]["hose on the knee, median of 3"] = round(timed(FEED), 3) section("second hose") - RETURN = {"object_name": "Return", "start": "ActT:port_rod", "end": "ActS:port_rod", **BUNDLE, "step": 0.03, "joint": json.dumps({**JOINT, "standoff": 0.24})} # round the plate's edge a voxel of 0.02 leaves a bend under the floor + RETURN = {"object_name": "Return", "start": "ActT:port_rod", "end": "ActS:port_rod", **BUNDLE, "joint": json.dumps({**JOINT, "standoff": 0.24})} # the pin point further out than the first hose's, at the default step receipt, back = send("brokkr_kitbash.hose", **RETURN) R["reports"]["return"] = back - check("a second hose routes through the same knee", receipt["status"] == "accepted" and back["nonManifoldEdges"] == 0, [receipt["status"], receipt["message"]]) + check("second-bundle: a second hose routes through the same knee at the default step, its range measured against the parts and not against where the first hose stood", + receipt["status"] == "accepted" and back["nonManifoldEdges"] == 0 and back["rolls"] >= 9 and abs(json.loads(bpy.data.objects["Return"]["kit_hose"])["step"] - 0.02) < 1e-6, [receipt["status"], receipt["message"]]) + for step in (0.0125, 0.03, 0.04): # feasibility does not turn on the step: a leg is searched with room for its bends + receipt, _ = send("brokkr_kitbash.hose", **{**FEED, "step": step}) + check(f"the first hose's route also stands at step {step}, beside the second", receipt["status"] == "accepted", receipt["message"]) + send("brokkr_kitbash.hose", **FEED) + refused("a bundle too stiff for the knee, by what limits its bend", {**FEED, "bend": 16.0}, "under the floor 0.2076: ") rod_ports = [frame(upper, "port_rod")[:3, 3], frame(lower, "port_rod")[:3, 3]] check("hose-behind-armour: the second hose keeps the clearance from the first", reading("clear", surface_clearance(bpy.data.objects["Return"], rod_ports), least=True) >= CLEAR, R["readings"]) refused("a pin point another hose already passes", {**RETURN, "object_name": "Third"}, "from an obstacle") @@ -310,7 +364,7 @@ try: reading("clamped", near.max() if len(near) == 24 else 1.0) reading("kept", np.abs(along[off < 1e-5]).min() if (off < 1e-5).any() else 0.0, least=True) check("hose-clamps-ports: each hose passes each clamp point straight along the socket's y", R["readings"]["clamped"] <= CLAMPED, R["readings"]) - check("the bundle runs straight for two outside diameters each side of a clamp point: no ring of a bend stands nearer", R["readings"]["kept"] >= 4.0 * RADIUS * (1 - 1e-6), R["readings"]) + check("the bundle runs straight for two outside diameters each side of a clamp point: no ring of a bend stands nearer", R["readings"]["kept"] >= KEPT, R["readings"]) check("the clamped hose reports the clearance it keeps (its pads stand on their seats)", line["clearance"] >= CLEARANCE and surface_clearance(hose, [frame(tank, "port_b")[:3, 3], frame(ram, "port_cap")[:3, 3]]) < 1e-6, line["clearance"]) refused("a bundle wider than the port", {**LINE, "object_name": "Wide", "count": 5}, "a bundle of 5 hoses is 0.0744 m wide, over socket 'Ram:port_cap' (hose, size 0.048)") @@ -320,6 +374,32 @@ try: bpy.context.view_layer.update() receipt, loose = send("brokkr_kitbash.hose", object_name="Loose", start="Tank:port_a", end="Tip", radius=0.02) check("a hose runs from a flange to an empty", receipt["status"] == "accepted" and loose["hoses"] == 1 and shells(bpy.data.objects["Loose"]) == (5, 0), [receipt["status"], receipt["message"]]) + section("verify") + # h4-claimable-live: a straight hose from a ram's port to an empty in line with it has no corner and no pin, and + # its leg starts beyond the plate that stands 0.008 under its first straight: route.verify is the only thing that + # measures that straight, and refuses it. With verify refusing nothing (H4b) the hose is made and reads under CLEAR. + solo = place("Solo", "actuator", RAM, [10.0, 0.0, 0.0]) + bpy.context.view_layer.update() + mouth = frame(solo, "port_cap")[:3, 3] + stub = bpy.data.objects.new("Stub", None) + bpy.context.scene.collection.objects.link(stub) + stub.location, stub.rotation_euler = (float(mouth[0]) + 0.5, float(mouth[1]), float(mouth[2])), (0.0, -math.pi / 2, 0.0) # its z back along the line toward the port + box("Beside", (mouth[0] + 0.06, mouth[1] - 0.05, mouth[2] - 0.06), (mouth[0] + 0.08, mouth[1] + 0.05, mouth[2] - 0.008)) + bpy.context.view_layer.update() + PAST = {"object_name": "Past", "start": "Solo:port_cap", "end": "Stub", "radius": RADIUS, "clearance": CLEARANCE, "sag": 0.0} + state = scene_state() + receipt, _ = send("brokkr_kitbash.hose", **PAST) + past = bpy.data.objects.get("Past") + if past is not None: + reading("clear", surface_clearance(past, [mouth, np.array(stub.location)]), least=True) + check("h4: the straight past the plate is refused by route.verify, naming the point; nothing changed", + receipt["status"] != "accepted" and "the hose stands 0.008 m from an obstacle at [" in str(receipt["message"]) and "under the 0.011 m the bundle needs" in str(receipt["message"]) + and scene_state() == state, [receipt["status"], receipt["message"]]) + check("h4: no hose this suite made stands nearer another mesh than CLEAR", R["readings"]["clear"] >= CLEAR, R["readings"]) + bpy.data.objects["Beside"].location = (0.0, 0.0, -0.01) # 0.018 under the straight: the same call routes + bpy.context.view_layer.update() + receipt, past = send("brokkr_kitbash.hose", **PAST) + check("with the plate 0.018 under it the same straight is made", receipt["status"] == "accepted" and (past["radii"]["least"] is None or past["radii"]["least"] > 1e3) and abs(past["clearance"] - 0.012) < 1e-4, [receipt["message"], past]) section("refusals") refused("a name taken by a mesh that is no hose", {**FEED, "object_name": "Thigh"}, "An object named 'Thigh' exists and is no hose") refused("a socket the part does not have", {**FEED, "start": "ActT:nope"}, "start: 'ActT' (a actuator) has no socket 'nope'; its sockets: base, base_back, rod_end, rod_end_back, port_cap, port_rod") diff --git a/surfaces/blender/tests/live/kitbash_hose.result.json b/surfaces/blender/tests/live/kitbash_hose.result.json index a42ebae..5f50176 100644 --- a/surfaces/blender/tests/live/kitbash_hose.result.json +++ b/surfaces/blender/tests/live/kitbash_hose.result.json @@ -62,7 +62,42 @@ "detail": null }, { - "name": "refused, scene unchanged: a range that swings the shin's hose into the thigh's parts", + "name": "refused, scene unchanged: a range that swings the shin's hose into the thigh's parts, naming the sagged attempt and the taut one", + "ok": true, + "detail": null + }, + { + "name": "the refusal names both attempts, each by its roll and its side", + "ok": true, + "detail": null + }, + { + "name": "the plate stands in the single hose's swing, over 0.03 from where it stands now", + "ok": true, + "detail": null + }, + { + "name": "refused, scene unchanged: range-sampled-not-swept: a 1 mm plate the hose crosses between two rolls 5 degrees apart", + "ok": true, + "detail": null + }, + { + "name": "the refusal names a roll between -20 and -15 for each attempt", + "ok": true, + "detail": null + }, + { + "name": "short of the plate the same hose passes its range", + "ok": true, + "detail": null + }, + { + "name": "at step 0.2 one taut hose routes and keeps the clearance from every other mesh", + "ok": true, + "detail": null + }, + { + "name": "at step 0.2 the bundle routes and keeps the clearance from every other mesh", "ok": true, "detail": null }, @@ -82,7 +117,27 @@ "detail": null }, { - "name": "a second hose routes through the same knee", + "name": "second-bundle: a second hose routes through the same knee at the default step, its range measured against the parts and not against where the first hose stood", + "ok": true, + "detail": null + }, + { + "name": "the first hose's route also stands at step 0.0125, beside the second", + "ok": true, + "detail": null + }, + { + "name": "the first hose's route also stands at step 0.03, beside the second", + "ok": true, + "detail": null + }, + { + "name": "the first hose's route also stands at step 0.04, beside the second", + "ok": true, + "detail": null + }, + { + "name": "refused, scene unchanged: a bundle too stiff for the knee, by what limits its bend", "ok": true, "detail": null }, @@ -131,6 +186,21 @@ "ok": true, "detail": null }, + { + "name": "h4: the straight past the plate is refused by route.verify, naming the point; nothing changed", + "ok": true, + "detail": null + }, + { + "name": "h4: no hose this suite made stands nearer another mesh than CLEAR", + "ok": true, + "detail": null + }, + { + "name": "with the plate 0.018 under it the same straight is made", + "ok": true, + "detail": null + }, { "name": "refused, scene unchanged: a name taken by a mesh that is no hose", "ok": true, @@ -220,7 +290,7 @@ "hostErrors": [], "readings": { "clamped": 4.6e-08, - "clear": 0.03, + "clear": 0.032, "kept": 0.028, "slack": 0.021 }, @@ -229,33 +299,33 @@ "object": "Feed", "rebuilt": false, "hoses": 3, - "length": 1.64165, - "lengthChange": 0.030219, + "length": 1.646929, + "lengthChange": 0.029095, "floor": 0.0636, - "clearance": 0.005763, + "clearance": 0.024995, "capped": 0.1522, "voxels": [ 79488, 53406 ], "sag": [ - 0.001609, + 0.001879, 0.009076 ], "rolls": 9, "worstRoll": -20.0, - "worstClearance": 0.057408, + "worstClearance": 0.025029, "faces": 3378, - "volume": 0.000577078, + "volume": 0.000578788, "nonManifoldEdges": 0, "radii": { - "least": 0.123768, + "least": 0.122563, "corners": [ - 0.248224, - 0.123768, - 30.12343, - 0.218148, - 3.812707, + 0.297307, + 0.122563, + 31.156603, + 0.207446, + 3.895369, 0.129781 ] } @@ -264,33 +334,34 @@ "object": "Return", "rebuilt": false, "hoses": 3, - "length": 1.678891, - "lengthChange": 0.034002, + "length": 1.691847, + "lengthChange": 0.024737, "floor": 0.0636, - "clearance": 0.021671, - "capped": 0.1622, + "clearance": 0.026695, + "capped": 0.1522, "voxels": [ - 26040, - 28560 + 82110, + 92820 ], "sag": [ - 0.006276, + 0.008745, 0.00844 ], "rolls": 9, - "worstRoll": 20.0, - "worstClearance": 0.034016, - "faces": 4926, - "volume": 0.000589144, + "worstRoll": -20.0, + "worstClearance": 0.027636, + "faces": 5430, + "volume": 0.000593342, "nonManifoldEdges": 0, "radii": { - "least": 0.071383, + "least": 0.070247, "corners": [ - 0.073199, - 7.398753, - 0.071383, - 0.118904, - 10.830696, + 0.070247, + 4.795067, + 0.124489, + 0.24111, + 0.07885, + 10.851944, 0.095513 ] } @@ -299,10 +370,10 @@ "object": "Line", "rebuilt": false, "hoses": 3, - "length": 2.10108, + "length": 2.10125, "lengthChange": null, "floor": 0.0636, - "clearance": 0.011, + "clearance": 0.010962, "capped": 0.1522, "voxels": [ 49815, @@ -318,14 +389,14 @@ "worstRoll": null, "worstClearance": null, "faces": 2510, - "volume": 0.000777433, + "volume": 0.000777488, "nonManifoldEdges": 0, "radii": { - "least": 0.09689, + "least": 0.091455, "corners": [ 0.097757, 4.439012, - 0.09689, + 0.091455, 1.734649, 2.898844, 1.734649,