@rulecad/cad 0.7.56 → 0.7.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +103 -1
- package/CHANGELOG.md +241 -0
- package/EXAMPLES.md +782 -2
- package/README.md +719 -8
- package/TUTORIAL.md +2 -0
- package/bin/cad.mjs +135 -29
- package/lib/assembly.mjs +83 -17
- package/lib/beams.mjs +46 -13
- package/lib/bought.mjs +41 -5
- package/lib/buildpage.mjs +8 -3
- package/lib/edit.mjs +10 -4
- package/lib/fasten.mjs +279 -47
- package/lib/fittings.mjs +313 -0
- package/lib/framebuild.mjs +463 -0
- package/lib/framecheck.mjs +831 -0
- package/lib/framegen.mjs +111 -0
- package/lib/frameheat.mjs +94 -0
- package/lib/frameprint.mjs +277 -0
- package/lib/frames.mjs +5 -3
- package/lib/framesize.mjs +261 -0
- package/lib/guides.mjs +354 -0
- package/lib/jigs.mjs +240 -0
- package/lib/joins.mjs +263 -0
- package/lib/kit.mjs +190 -0
- package/lib/links.mjs +11 -3
- package/lib/list.mjs +28 -8
- package/lib/loads.mjs +12 -4
- package/lib/measured.mjs +86 -17
- package/lib/motors.mjs +7 -3
- package/lib/optimise.mjs +18 -3
- package/lib/order.mjs +28 -14
- package/lib/panels.mjs +220 -0
- package/lib/plates.mjs +37 -16
- package/lib/services.mjs +132 -0
- package/lib/sheet.mjs +15 -1
- package/lib/slotnuts.mjs +159 -0
- package/lib/task.mjs +43 -3
- package/lib/wires.mjs +2 -1
- package/package.json +6 -6
- package/schemas/assembly.schema.json +34 -9
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"title": "rulecad assembly",
|
|
5
5
|
"description": "Objects placed together: a fit check (fits between them, joints and poses) or a plate (everything printed at once).",
|
|
6
6
|
"type": "object",
|
|
7
|
-
"required": ["items"],
|
|
7
|
+
"anyOf": [{ "required": ["items"] }, { "required": ["frame"], "properties": { "frame": { "required": ["kind"] } } }],
|
|
8
8
|
"additionalProperties": false,
|
|
9
9
|
"properties": {
|
|
10
10
|
"$schema": { "type": "string" },
|
|
@@ -12,20 +12,23 @@
|
|
|
12
12
|
"description": { "type": "string" },
|
|
13
13
|
"note": { "type": "string" },
|
|
14
14
|
"kind": { "enum": ["fit", "plate"] },
|
|
15
|
-
"packed": { "type": "object", "description": "Written by cad plates: which assembly this plate is for, its filament and gap, and each part's build hash, so a changed part re-packs only its plate", "required": ["of", "filament", "gap", "parts"], "additionalProperties": false, "properties": { "of": { "type": "string" }, "filament": { "type": "string" }, "gap": { "type": "number" }, "parts": { "type": "object" } } },
|
|
15
|
+
"packed": { "type": "object", "description": "Written by cad plates: which assembly this plate is for, its filament, its material (each plate is one plastic: the project's, or a printed beam's own) and gap, and each part's build hash, so a changed part re-packs only its plate", "required": ["of", "filament", "gap", "parts"], "additionalProperties": false, "properties": { "of": { "type": "string" }, "filament": { "type": "string" }, "material": { "type": "string" }, "gap": { "type": "number" }, "parts": { "type": "object" } } },
|
|
16
16
|
"uses": { "type": "array", "items": { "type": "string" } },
|
|
17
17
|
"requires": { "type": "object", "additionalProperties": { "type": "string" }, "description": "object → semver range" },
|
|
18
18
|
"items": { "type": "array", "items": { "$ref": "#/$defs/item" } },
|
|
19
19
|
"fits": { "type": "array", "items": { "$ref": "#/$defs/fit" } },
|
|
20
20
|
"fasten": { "type": "array", "description": "Screwed joints: each names its screw, the parts it passes through in order, and the part it ends in. The holes are read from the parts as drawn and each screw followed along one axis; a fasten holds its parts as a fit that fastens does, lines their holes up as a holes fit does, and puts its screws on the shopping list. Draw the holes with v.fixings, and name the screw with no length: the check chooses one", "items": { "$ref": "#/$defs/fasten" }, "defaultSnippets": [{ "label": "fasten", "description": "A screwed joint", "body": [{ "screw": "${1:M3 cap}", "through": ["${2:bracket}"], "into": "${3:base}", "at": ["${4:bracket.h1}", "${5:bracket.h2}"] }] }] },
|
|
21
|
+
"joins": { "type": "array", "description": "How beams are joined: each names an end of one beam (a) and a place on another (b), and its kind. A join puts its operations on both beams (a tap in a's end, an access or clearance hole across b), its screws into fasten, and a spring for the frame's solve; join.geometry checks the end meets the face square and flush where b says", "items": { "$ref": "#/$defs/join" }, "defaultSnippets": [{ "label": "join", "description": "A blind join: a's end tapped, its screw's head in b's slot", "body": [{ "kind": "${1:blind}", "a": "${2:y1.a}", "b": "${3:x1.back@120}" }] }] },
|
|
22
|
+
"guides": {"type": "array", "description": "Linear motion on a beam. A rail: a miniature rail screwed down on a beam's slotted face into slot nuts at its hole pitch, its carriages each riding its own share of the rail on a sliding joint with its true travel (<id>-1, <id>-2 ..; poses <id>-a and <id>-b put them at either end), their loads held to their ratings as joint.moment. Wheels: a printed plate (<id>-carriage-1) over a beam's face on V-wheels (<id>-wheel-1 ..) in the V tracks of the faces either side, rolling on a sliding joint (<id>-1) through the stretch from..from + length; refused on a face with no V track. A slider: a printed slider (<id>-carriage-1) in or over a slot, on a sliding joint through its stretch. Rods: two smooth rods along a face in printed holders at the stretch's ends (<id>-holder-a, <id>-holder-b, saddles screwed into the slots either side), a printed carriage (<id>-carriage-1) on two linear bearings on a sliding joint; an endstop's printed mount at a side face's address and a flag on the carriage set the joint's home. A screw: a lead screw driving a rods guide's carriage from a printed motor plate (<id>-plate) at its end a, the motor (<id>-motor) a motor item whose lead screw comes from the screw's set, a coupler, the screw, its bearings in the holders and the lead nut on the carriage", "items": {"type": "object", "required": ["kind"], "additionalProperties": false, "properties": {"id": {"type": "string", "description": "Its name (default g1, g2 ..): the rail item takes it"}, "kind": {"enum": ["rail", "wheels", "slider", "rods", "screw"], "description": "rail (a miniature linear rail, which needs rail), wheels (a plate on V-wheels in a V-slot's tracks), slider (a printed slider in or over a slot), rods (two rods in printed holders and a printed carriage on linear bearings) or screw (a lead screw and its motor driving a rods guide, which needs guide and motor); every kind but screw needs on and length; a belt follows"}, "rail": {"type": "string", "description": "The rail's rule set: rail-mgn7, rail-mgn9, rail-mgn12, rail-mgn15"}, "carriage": {"type": "string", "description": "The carriage, a variant of the rail's set: MGN12C (standard, the default) or MGN12H (long)"}, "on": {"type": "string", "description": "A rail's or a slider's slotted face (x1.top, x1.top.2); for wheels, the face the plate lies over (x1.top), its wheels in the slots either side"}, "from": {"$ref": "#/$defs/expr", "description": "Where the rail or the stretch starts, mm from the beam's end a (default 0)"}, "length": {"$ref": "#/$defs/expr", "description": "The rail as it is cut, mm; for wheels and a slider, the stretch of the beam it runs along, mm"}, "carriages": {"type": "integer", "minimum": 1, "maximum": 8, "description": "How many carriages ride it (default 1)"}, "nut": {"type": "string", "description": "A rail or rods: the slot nuts' kind (slide-in, drop-in, roll-in, square, hammer, t-bolt), for the rail's screws, or the rods' holders, motor plate and endstop mount; between two joins that close a slot at both ends, a slide-in nut is shut in (frame.nut), so give drop-in. A screw: the lead nut's rule set (t8-nut, the default)"}, "note": {"type": "string"}, "wheel": {"type": "string", "description": "Wheels: the V-wheel's rule set, v-wheel-solid (the default) or v-wheel-mini"}, "wheels": {"enum": [3, 4], "description": "Wheels: 4 (two a side, the default) or 3 (one on an eccentric)"}, "pitch": {"$ref": "#/$defs/expr", "description": "Wheels: their spacing along the beam, mm (default a wheel's diameter and 15 mm, rounded up to 5)"}, "load": {"$ref": "#/$defs/expr", "description": "Wheels or a slider: the printed part's design load, N (default 50 for a plate, 20 for a slider)"}, "mode": {"enum": ["over", "in"], "description": "A slider: over the slot (a shoe on the face, keyed into the opening; the default) or in it (a block held under its lips)"}, "size": {"$ref": "#/$defs/expr", "description": "A slider: its own length along the beam, mm (default 30)"}, "rod": {"type": "string", "description": "Rods: the rods' rule set (rod-8, the default)"}, "bearing": {"type": "string", "description": "Rods: the linear bearings' rule set (lm8uu, the default, or lm8luu)"}, "spacing": {"$ref": "#/$defs/expr", "description": "Rods: their distance apart across the face, mm (default room for the bearings and a lead nut's flange between)"}, "height": {"$ref": "#/$defs/expr", "description": "Rods: the rods' and screw's height over the face, mm (default the least that clears the carriage, the nut, the screw's bearing, the coupler and the motor)"}, "endstop": {"type": "object", "required": ["at"], "additionalProperties": false, "description": "Rods: an endstop on a printed mount; its lever meets a flag on the carriage, and the joint homes there", "properties": {"at": {"type": "string", "description": "An address on a face beside the rods: x1.front@80"}, "switch": {"type": "string", "description": "The switch's rule set (endstop-10t85, the default)"}}}, "guide": {"type": "string", "description": "A screw: the id of the rods guide whose carriage it drives"}, "screw": {"type": "string", "description": "A screw: the lead screw's rule set (t8-screw, the default)"}, "support": {"type": ["string", "null"], "description": "A screw: the ball bearing each holder takes the screw in (bearing-608, the default), or null for none"}, "coupler": {"type": "string", "description": "A screw: the coupler from the motor's shaft to the screw (coupler-5-8, the default)"}, "motor": {"type": "object", "required": ["model"], "description": "A screw: the motor item's spec ({ \"model\": \"28byj48\", \"microsteps\": 1 }): its drives and leadscrew come from the guide"}, "friction": {"$ref": "#/$defs/expr", "description": "A screw: the nut's friction on the screw (default the screw's set's, an estimate)"}}}, "defaultSnippets": [{"label": "rail", "description": "An MGN12 rail on a beam's top face", "body": [{"kind": "rail", "rail": "${1:rail-mgn12}", "on": "${2:x1.top}", "from": 0, "length": "${3:300}"}]}, {"label": "wheels", "description": "A plate on four V-wheels over a V-slot beam's top face", "body": [{"kind": "wheels", "wheel": "${1:v-wheel-solid}", "on": "${2:x1.top}", "from": 0, "length": "${3:400}"}]}, {"label": "rods and a screw", "description": "Two 8 mm rods on a beam's top face, a carriage on LM8UUs, driven by a 28BYJ-48 through a T8 screw", "body": [{"kind": "rods", "on": "${1:x1.top}", "from": "${2:60}", "length": "${3:120}"}, {"kind": "screw", "guide": "g1", "screw": "t8-screw", "motor": {"model": "${4:28byj48}"}}]}]},
|
|
21
23
|
"joints": { "type": "array", "items": { "$ref": "#/$defs/joint" } },
|
|
22
24
|
"loops": { "type": "array", "items": { "$ref": "#/$defs/loop" } },
|
|
23
25
|
"planetary": { "type": "array", "items": { "$ref": "#/$defs/planetary" } },
|
|
24
26
|
"task": { "type": "object", "required": ["tool"], "additionalProperties": false, "description": "What the machine is for: the tool, where it works, how fast and how accurately", "properties": { "tool": { "type": "string", "description": "An anchor, <item>.<anchor>" }, "sheet": { "type": "object", "required": ["at"], "additionalProperties": false, "properties": { "size": {}, "width": { "type": "number" }, "height": { "type": "number" }, "landscape": { "type": "boolean" }, "at": { "$ref": "#/$defs/vec3" }, "normal": { "$ref": "#/$defs/vec3" }, "u": { "$ref": "#/$defs/vec3" } } }, "region": { "type": "object" }, "volume": { "type": "object" }, "speed": { "$ref": "#/$defs/expr", "description": "mm/s" }, "accuracy": { "$ref": "#/$defs/expr", "description": "mm" }, "accel": { "$ref": "#/$defs/expr", "description": "mm/s², for planning" }, "elbow": { "enum": ["left", "right"] }, "deflection": { "$ref": "#/$defs/expr", "description": "mm of link deflection at the tool, an estimate; else worked out from the parts when there is a payload" }, "payload": { "$ref": "#/$defs/expr", "description": "kg at the tool" }, "grip": { "type": "object", "description": "A compliant gripper on a servo: { servo, horn, leaf: { length, thickness, width }, travel, friction, lever, margin }" }, "pen": { "type": "object", "description": "Servo angles for the pen: { up, down }" } } },
|
|
25
27
|
"gait": { "type": "object", "required": ["legs", "pattern", "stride", "lift", "period", "height", "mass"], "additionalProperties": false, "description": "Poses in time: the feet by anchor, a pattern, and the body", "properties": { "legs": { "type": "array", "items": { "type": "string" } }, "pattern": {}, "stride": { "$ref": "#/$defs/expr" }, "lift": { "$ref": "#/$defs/expr" }, "period": { "$ref": "#/$defs/expr" }, "height": { "$ref": "#/$defs/expr" }, "mass": { "$ref": "#/$defs/expr" }, "steps": { "$ref": "#/$defs/expr" }, "com": { "$ref": "#/$defs/vec3" }, "clearance": { "$ref": "#/$defs/expr" } } },
|
|
26
28
|
"power": { "type": "object", "additionalProperties": false, "properties": { "margin": { "type": "number" } } },
|
|
27
|
-
"wires": { "type": "array", "description": "Wires between anchors, their length measured through every pose", "items": { "type": "object", "required": ["from", "to"], "additionalProperties": false, "properties": { "id": { "type": "string" }, "from": { "type": "string" }, "to": { "type": "string" }, "via": { "type": "array", "items": { "type": "string" }, "description": "Anchors
|
|
29
|
+
"wires": { "type": "array", "description": "Wires between anchors, their length measured through every pose", "items": { "type": "object", "required": ["from", "to"], "additionalProperties": false, "properties": { "id": { "type": "string" }, "from": { "type": "string" }, "to": { "type": "string" }, "via": { "type": "array", "items": { "anyOf": [{ "type": "string" }, { "type": "object", "required": ["along", "from", "to"], "additionalProperties": false, "description": "A run along a beam's slot: the wire follows the slot from one distance to another, held by printed cable clips at a pitch", "properties": { "along": { "type": "string", "description": "A beam's slotted face: rail.top" }, "from": { "$ref": "#/$defs/expr", "description": "mm from the beam's end a" }, "to": { "$ref": "#/$defs/expr" }, "pitch": { "$ref": "#/$defs/expr", "description": "The most between clips, mm (default 100)" }, "cable": { "$ref": "#/$defs/expr", "description": "The bundle the clips hold, mm (default 6)" } } }] }, "description": "Anchors, path joints or runs along a slot that the wire is routed by" }, "gauge": { "type": "string", "description": "awg22" }, "colour": { "type": "string" }, "conductors": { "type": "number" }, "connectors": { "type": "array", "items": { "type": "string" } }, "current": { "type": "number", "description": "A: else a motor's rated current at either end, or a signal's" }, "note": { "type": "string" } } } },
|
|
28
30
|
"gravity": { "$ref": "#/$defs/vec3", "description": "Which way down is, for masses in loads (default [0, 0, -1])" },
|
|
31
|
+
"frame": { "type": "object", "additionalProperties": false, "description": "The frame: what it is (a generator, kind with inside or outside, which expands into beams, joins and their ends before anything is built, as cad frame --expand writes out), and how its beams and joins are solved for frame.deflection, frame.stress, frame.buckling, frame.rack and frame.frequency, which beams could be printed (beam.printable), and how it is cut and heated for frame.square and frame.heat. Left out, it stands on its feet: the beam ends that carry a foot, a levelling foot, a castor plate or a stacking foot, or else the lowest beam ends, each held from moving (pinned)", "properties": {"kind": {"enum": ["box", "portal", "table", "gantry", "shelf"], "description": "A frame generated from a size: box (four posts and a ring of beams at the bottom and top), portal (two legs and a beam across: inside and outside are [width, height]; it lies in one plane and tips over on its feet alone, so it is refused until supports says its feet are held down, as z1.a and z2.a fixed), table (four legs and a ring at the top), gantry (a box without its top beams across, and a beam riding along the two top side beams on a sliding joint) or shelf (a box with rings between, shelves of them). Its beams are z1 .. (upright), x1 .. and y1 .. (along x and y, by ring from the bottom), g (a gantry's moving beam); its corner arrangement follows the join"}, "inside": {"type": "array", "minItems": 2, "maxItems": 3, "items": {"$ref": "#/$defs/expr"}, "description": "The clear volume the frame encloses, [width (x), depth (y), height (z)] in mm (a portal: [width, height]); the beams go round it. Give inside or outside"}, "outside": {"type": "array", "minItems": 2, "maxItems": 3, "items": {"$ref": "#/$defs/expr"}, "description": "The volume the whole frame must fit in, [width, depth, height] in mm (a portal: [width, height]); the beams go within it"}, "profile": {"type": "string", "description": "Every beam's profile, a square one (2020-misumi-hfs5, 3030-generic, 4040-item-8)"}, "join": {"description": "How the beams meet at each corner: a kind (blind, end-tap, bracket, gusset, hidden, anchor: the upright beams run through and the others butt against their faces, each shorter by the profile's width at each end; cube: every beam butts into a corner node, each as long as the inside), or { kind, fitting, screw } as a join takes them", "oneOf": [{"type": "string"},{"type": "object", "additionalProperties": false, "required": ["kind"], "properties": {"kind": {"type": "string"}, "fitting": {"type": "string"}, "screw": {"type": "string"}}}]}, "feet": {"type": ["string", "null"], "description": "What stands under the upright beams' lower ends: foot, levelling, castor or stacking (printed), or a bought foot's set by name (fitting-motedis-foot-m6-d19); left out, an end cap"}, "caps": {"type": ["string", "boolean"], "description": "The ends no join covers: printed end caps (true, the default), a bought end cap's set by name, or false for none (join.end then names them)"}, "braces": {"type": "array", "items": {"enum": ["front", "back", "left", "right"]}, "description": "The upright sides whose corners are stiffened against racking: each join in that side becomes a bracket join with a printed corner bracket in the corner, on drop-in nuts"}, "panels": {"type": "object", "additionalProperties": false, "required": ["sheet", "thickness"], "description": "Panels closing the upright sides, each cut to its bay with its clips (a box, a shelf, a gantry's two sides)", "properties": {"sheet": {"type": "string", "description": "The sheet's material: acrylic, polycarbonate, aluminium, plywood, mdf"}, "thickness": {"$ref": "#/$defs/expr", "description": "mm"}, "sides": {"type": "array", "items": {"enum": ["front", "back", "left", "right"]}, "description": "Which sides (default every side that has a bay)"}}}, "shelves": {"type": "integer", "minimum": 1, "maximum": 20, "description": "A shelf: how many rings stand between the bottom and the top, spacing its height into equal clear bays (default 1)"}, "supports": {"type": "object", "description": "Where the frame is held, by beam end (\"z1.a\") or a place on a beam (\"x1.bottom@50%\"): pinned holds it from moving and lets it turn, fixed holds it from turning too, resting holds it from moving and from twisting about the beam's own length (a beam lying across a round bar, as the beam coupon does; for a beam along x, y or z). Given, these are the only supports", "additionalProperties": {"enum": ["pinned", "fixed", "resting"]}}, "limit": {"$ref": "#/$defs/expr", "description": "The sag allowed in every frame.deflection finding, in mm: at each load's point, each named point and along each guide whose rail gives no parallelism of its own (default: the task's accuracy, else the span of the beam it is on over 360)"}, "points": {"type": "array", "description": "Places on beams to report the sag at, beside each load's point and every guide (\"x1.top@50%\")", "items": {"type": "string"}}, "cut": {"type": "object", "additionalProperties": false, "description": "How the beams are cut in this workshop, where it differs from the profile's set and the kit's defaults: frame.square, frame.cut and the cut list read it", "properties": {"tolerance": {"$ref": "#/$defs/expr", "description": "How far a cut length may be from the length asked, either way, in mm (default: the profile's cut_tolerance, else 0.5)"}}}, "heat": {"type": "object", "additionalProperties": false, "description": "frame.heat: the temperatures the frame works at. The beams grow with the air in the enclosure; each printed fitting is held to its plastic's softening point", "properties": {"air": {"$ref": "#/$defs/expr", "description": "The air round the frame when it runs, in degrees C (inside its enclosure)"}, "built": {"$ref": "#/$defs/expr", "description": "The air it was built and squared in, in degrees C (default 20)"}, "heaters": {"type": "array", "description": "Hot things near the frame: what is within reach of one is taken at its temperature", "items": {"type": "object", "required": ["at", "temperature", "reach"], "additionalProperties": false, "properties": {"name": {"type": "string"}, "at": {"$ref": "#/$defs/vec3", "description": "Its middle, in the assembly's frame, mm"}, "temperature": {"$ref": "#/$defs/expr", "description": "Degrees C at its surface"}, "reach": {"$ref": "#/$defs/expr", "description": "How far from its middle a part is taken at that temperature, mm"}}}}}}, "printed": {"description": "beam.printable: each beam tried printed in this plastic (the kit's printable profile of its size, lying down or standing up), the frame solved again and held to its own limits: its sags, stress, buckling, creep and lowest mode; the beams that can be printed are listed, and printed together solved once more. A plastic's set by name (\"petg\"), or how it prints", "oneOf": [{"type": "string"},{"type": "object", "additionalProperties": false, "required": ["material"], "properties": {"material": {"type": "string", "description": "The plastic's set: pla, petg"}, "walls": {"type": "integer", "minimum": 1, "description": "Walls round every outline, in lines (3)"}, "infill": {"type": "number", "minimum": 0, "maximum": 1, "description": "The share of the inside the infill fills (0.4)"}, "pose": {"enum": ["lying", "standing"], "description": "Only this way up (both are tried where left out)"}}}]}, "size": {"type": "object", "additionalProperties": false, "description": "frame.size: each group of beams that must match given the lightest profile from a list that meets the frame's own limits (the sag at each load, point and guide, each beam's stress and buckling with frame.margin to spare, and the lowest mode against the task's moves), solved in every pose; a table of each group's profile, the limit that set it and its margin, and cad frame --size --write writes the profiles in", "properties": {"profiles": {"type": "array", "minItems": 1, "items": {"type": "string"}, "description": "The profiles to choose from, by set (default MISUMI's HFS5, HFS6 and HFS8 series from 2020 to 4080). One that is not square is tried lying as drawn and turned a quarter. Choose one family whose joins fit each other: the join checks of the written frame say where they do not"}, "groups": {"type": "object", "description": "Beams that must take one profile, by group name (\"rails\": [\"x1\", \"x2\"]); the rest are grouped by themselves: one profile, one direction, lengths within 0.5 mm", "additionalProperties": {"type": "array", "minItems": 1, "items": {"type": "string"}}}, "limits": {"type": "object", "additionalProperties": false, "description": "Limits in place of the frame checks' own", "properties": {"deflection": {"$ref": "#/$defs/expr", "description": "The sag allowed at every load, named point and guide, mm"}, "stress": {"$ref": "#/$defs/expr", "description": "How many times under its alloy's strength each beam stays (default frame.margin, 2)"}, "buckling": {"$ref": "#/$defs/expr", "description": "How many times its load the frame, and each grouped beam by Euler's load, must carry before it buckles (default frame.margin, 2)"}, "frequency": {"$ref": "#/$defs/expr", "description": "The lowest mode's floor, Hz (default twice what the task's moves shake it at; none without a task)"}}}, "by": {"enum": ["mass", "cost"], "description": "What is made least (mass: no profile set in the kit gives a price per metre yet)"}}}, "rack": {"type": "object", "additionalProperties": false, "description": "frame.rack: the side push at the frame's top and the sway allowed", "properties": {"load": {"$ref": "#/$defs/expr", "description": "The side push in N, shared among the top corners (default 20, an estimate)"}, "limit": {"$ref": "#/$defs/expr", "description": "The sway allowed at the top, in mm (default: the task's accuracy, else the height over 400)"}}}} },
|
|
29
32
|
"loads": { "type": "array", "description": "What the assembly has to do: a torque (N m) or force (N) on a joint, or a mass (kg) carried at an anchor", "items": { "type": "object", "additionalProperties": false, "properties": { "joint": { "type": "string" }, "torque": { "$ref": "#/$defs/expr" }, "force": { "$ref": "#/$defs/expr" }, "mass": { "$ref": "#/$defs/expr" }, "at": { "$ref": "#/$defs/anchorRef" }, "note": { "type": "string" } } } },
|
|
30
33
|
"poses": { "type": "object", "description": "Named sets of joint values ({ \"hinge\": 90 }), and of items' variables (\"action.travel\": 25: a flexure drawn bent in that pose, printed as drawn)", "additionalProperties": { "type": "object", "additionalProperties": { "$ref": "#/$defs/values" } } },
|
|
31
34
|
"pose": { "type": "string" }
|
|
@@ -44,10 +47,13 @@
|
|
|
44
47
|
"object": { "type": "string" },
|
|
45
48
|
"assembly": { "type": "string" },
|
|
46
49
|
"motor": { "type": "object", "required": ["model"], "additionalProperties": false, "description": "A motor from @rulecad/motors: bought, not printed; its shaft turns the joint it drives", "properties": { "model": { "type": "string" }, "drives": { "type": "string" }, "set": { "type": "object", "description": "Figures that differ from the catalogue's, by name" }, "speed": { "$ref": "#/$defs/expr", "description": "The motor's speed, rpm (default: what it does comfortably)" }, "margin": { "$ref": "#/$defs/expr", "description": "How many times over the torque must be (default 2)" }, "duty": { "$ref": "#/$defs/expr", "description": "The share of the time it runs, 0 to 1 (default 1), for its heat" }, "screw": { "type": "string", "description": "The screws through a motor's plain holes, if not the size they take: M3" }, "driver": { "type": "string", "description": "The bought driver item this motor plugs into" }, "leadscrew": { "type": "object", "additionalProperties": false, "required": ["lead"], "properties": { "lead": { "$ref": "#/$defs/expr" }, "diameter": { "$ref": "#/$defs/expr" }, "friction": { "$ref": "#/$defs/expr" } } }, "belt": { "type": "object", "additionalProperties": false, "required": ["teeth"], "properties": { "teeth": { "$ref": "#/$defs/expr" }, "pitch": { "$ref": "#/$defs/expr" }, "stiffness": { "$ref": "#/$defs/expr", "description": "N per mm of strain, per mm of belt width" }, "width": { "$ref": "#/$defs/expr" }, "length": { "$ref": "#/$defs/expr" }, "load": { "$ref": "#/$defs/expr" } } }, "current": { "type": "number", "description": "A per coil, as set on the driver (default its rated current)" }, "cooled": { "type": "boolean", "description": "The driver has a heat sink and moving air" }, "microsteps": { "type": "number", "description": "Steps to a full step (default 16): resolution, not accuracy" } } },
|
|
47
|
-
"bought": { "type": "string", "description": "A part from a rule set (\"608\", \"drv8825\"): bought, not printed; drawn faint from its figures, with anchors from what it is" },
|
|
50
|
+
"bought": { "type": "string", "description": "A part from a rule set (\"608\", \"drv8825\", \"fitting-motedis-end-cap-20-b6\"): bought, not printed; drawn faint from its figures, with anchors from what it is. A frame's bought fitting (an end cap, a levelling foot, a hinge) placed at a beam's address is checked against that beam's profile, and its price goes on cad list" },
|
|
48
51
|
"variant": { "type": "string" },
|
|
49
52
|
"set": { "type": "object" },
|
|
50
|
-
"
|
|
53
|
+
"fitting": { "type": "object", "required": ["kind"], "additionalProperties": false, "description": "A printed fitting from @rulecad/frames, drawn from a profile's and its slot nuts' rules and sized from a named load (a join with \"fitting\": \"printed\" adds one for itself; a panel adds its clips, a door its hinges, handle and catch). A bracket, gusset or splice is sized by finite elements; the others by beam formulas, each reporting its grams and margin. In its fitted frame: a bracket's x along b's face away from a, y up a, z across; a plate's x along b, y along a, its contact face at z = 0", "properties": { "kind": { "enum": ["bracket", "gusset", "splice", "panel-clip", "panel-corner", "slot-cover", "panel-edge", "gasket-strip", "hinge", "handle", "latch", "magnet-catch", "end-cap", "foot", "levelling-foot", "castor-plate", "stacking-foot", "device-mount", "fan-mount", "drag-chain-end", "din-rail", "cable-clip", "tie-anchor", "spool-holder", "rail-jig", "wheel-plate", "slider", "rod-holder", "rod-carriage", "motor-plate", "endstop-mount", "nut-carrier"], "description": "A nut-carrier is a printed block that slides in a slot holding a hex nut or a heat-set insert (face, thread, holds, length, count, pitch, load)" }, "profile": { "type": "string", "description": "The profile the base leg or the plate lies on" }, "other": { "type": "string", "description": "A bracket's: the profile its upright leg lies on, where not the same" }, "face": { "type": "string", "description": "The face of the profile it lies on (top, top.2): its slot sizes the tongue and the nut" }, "otherFace": { "type": "string" }, "shape": { "enum": ["L", "T", "cross", "splice"], "description": "A gusset's shape" }, "brace": { "type": "boolean", "description": "A bracket's brace across its inside corner" }, "load": { "type": "number", "description": "The design load in N, across beam a at the fitting's screw (default 100)" }, "count": { "type": "number", "description": "A plate's screws on each arm (default 2)" }, "thread": { "type": "string" }, "head": { "enum": ["cap", "button"] }, "part": { "type": "string", "description": "A hinge's leaf (frame, door) or a levelling foot's part (body, pad): an item each" }, "sheet": { "type": "number", "description": "The panel's or door's thickness, in mm" }, "length": { "type": "number", "description": "A strip's length, in mm" }, "standoff": { "type": "number", "description": "A latch's or catch's: the door's inner face over the beam's face (a hinge's standoff)" }, "edge": { "type": "number" }, "magnet": { "type": "array", "items": { "type": "number" } }, "stud": { "type": "string" }, "holds": { "enum": ["nut", "insert"], "description": "A nut-carrier's: a hex nut slid in from the side (the default) or a heat-set insert pressed in from below" }, "range": { "type": "number" }, "holes": { "type": "array", "items": { "type": "number" } }, "end": { "enum": ["a", "b"] }, "depth": { "type": "number" }, "grip": { "type": "number" }, "span": { "type": "number" }, "gap": { "type": "number" }, "squeeze": { "type": "number" }, "pin": { "type": "string" }, "screw": { "type": "string" }, "thickness": { "type": "number" }, "nut": { "type": "string" }, "material": { "type": "string" }, "device": { "type": "string", "description": "A device mount's: the rule set its holes are read from (supply-24v, cnc-shield-v3)" }, "variant": { "type": "string", "description": "A device mount's: the device's variant" }, "turn": { "enum": [0, 90, 180, 270], "description": "A device mount's: the device's x from the slot's line, degrees" }, "offset": { "type": "number", "description": "A device mount's: the device's middle across the slot, mm" }, "deviceHead": { "enum": ["cap", "button"] }, "size": { "type": "number", "description": "A fan mount's fan, mm: 40, 60, 80, 92 or 120" }, "side": { "enum": [1, -1] }, "flange": { "type": "number" }, "cable": { "type": "number", "description": "A cable clip's bundle, mm" }, "width": { "type": "number" }, "tie": { "type": "array", "items": { "type": "number" } }, "spool": { "type": "object" }, "rod": { "type": "string", "description": "A rod holder's or carriage's: the rods' rule set" }, "bearing": { "type": "string", "description": "A carriage's linear bearings' rule set" }, "spacing": { "type": "number" }, "height": { "type": "number" }, "leadNut": { "type": "string", "description": "A rod holder's or carriage's: the lead nut's rule set" }, "support": { "type": ["string", "null"], "description": "A rod holder's: the screw's ball bearing's rule set" }, "flag": { "type": "object", "description": "A carriage's endstop flag: where its tip reaches, { y, z }" }, "motor": { "type": "string", "description": "A motor plate's: the motor's rule set (28byj48, nema14, nema17)" }, "coupler": { "type": "object", "description": "A motor plate's: the coupler's { length, D }" }, "switch": { "type": "string", "description": "An endstop mount's: the switch's rule set" }, "toward": { "enum": [1, -1], "description": "An endstop mount's: which way across the face its lever reaches" }, "pose": { "enum": ["fit", "print"], "description": "fit (the default): in its place, as the item's at and rotate put it; print: laid as it prints, for a plate (cad plates writes it so)" } } },
|
|
54
|
+
"panel": { "type": "object", "required": ["sheet", "thickness", "bay", "out"], "additionalProperties": false, "description": "A panel from @rulecad/frames: a sheet cut to the bay of four beams it closes, on their faces that look along out, held by printed clips at a pitch; with door, a door on printed hinges that turns on a joint", "properties": { "sheet": { "enum": ["acrylic", "polycarbonate", "aluminium"] }, "thickness": { "$ref": "#/$defs/expr" }, "bay": { "type": "array", "items": { "type": "string" }, "minItems": 4, "maxItems": 4, "description": "The four beam items round it, in order" }, "out": { "type": "array", "items": { "$ref": "#/$defs/expr" }, "minItems": 3, "maxItems": 3, "description": "The way its face looks, square to the bay" }, "pitch": { "$ref": "#/$defs/expr" }, "nut": { "type": "string" }, "load": { "$ref": "#/$defs/expr" }, "door": { "type": "object", "required": ["hinge"], "additionalProperties": false, "properties": { "hinge": { "type": "string", "description": "The beam of the bay its hinges go on" }, "open": { "$ref": "#/$defs/expr" }, "handle": { "type": "boolean" }, "catch": { "type": "boolean" }, "latch": { "type": "boolean" }, "load": { "$ref": "#/$defs/expr" } } } } },
|
|
55
|
+
"mount": { "type": "object", "required": ["on"], "additionalProperties": false, "description": "A bought board's or supply's printed mount on a beam (@rulecad/frames' deviceMountModel), its holes read from the item's rule set: the mount goes at a slotted face's address, the item on it, and the screws into the slot and into the device are fastens", "properties": { "on": { "type": "string", "description": "An address on a beam's slotted face: rail.top@200" }, "turn": { "enum": [0, 90, 180, 270], "description": "The device's x from the beam's line, degrees" }, "offset": { "$ref": "#/$defs/expr", "description": "The device's middle across the slot, mm" }, "standoff": { "$ref": "#/$defs/expr", "description": "A board's least standoff, mm" }, "load": { "$ref": "#/$defs/expr", "description": "N on the device at its farthest hole (default 50)" }, "nut": { "type": "string" }, "head": { "enum": ["cap", "button"] }, "screw": { "type": "string", "description": "A board's screws, where not the largest its holes pass" } } },
|
|
56
|
+
"beam": { "type": "object", "required": ["profile"], "additionalProperties": false, "description": "A length of a profile from @rulecad/frames: bought and cut to length, faint in previews, or printed; placed by its ends (from, to, roll) or by at and rotate", "properties": { "profile": { "type": "string", "description": "A profile's name: 2020-misumi-hfs5, profile-4040-item-8, or a set in this workspace's rules/" }, "length": { "$ref": "#/$defs/expr", "description": "mm from end a to end b; may be left out when from and to are both given" }, "printed": { "description": "A printed beam (@rulecad/frames printed beams): true, or how it prints. A printed beam is a printed part, weighed by the plastic laid, on a plate, off the cut list; a bought one is false, the default", "oneOf": [{ "type": "boolean" }, { "type": "object", "additionalProperties": false, "properties": { "pose": { "enum": ["lying", "standing"], "description": "lying (the default): on its bottom face, its layers along it; standing: on end a, its section the layer" }, "walls": { "type": "integer", "minimum": 1, "description": "Walls round every outline, in lines (3)" }, "infill": { "type": "number", "minimum": 0, "maximum": 1, "description": "The share of the inside the infill fills (0.4)" }, "end": { "enum": ["insert", "nut"], "description": "What a tapped end becomes in print: a heat-set insert (the default) or a captive nut" }, "pull": { "type": "number", "exclusiveMinimum": 0, "description": "A slot nut's design pull in N (100)" } } }] }, "laid": { "type": "boolean", "description": "A printed beam drawn as it prints, for a plate (cad plates writes it so)" }, "material": { "type": "string", "description": "A material set in place of the profile's alloy: al6063-t5, or a plastic" }, "ops": { "type": "array", "items": { "$ref": "#/$defs/beamOp" }, "description": "Operations on the beam, each a line on its sheet and a cut in its solid, placed by an address on the beam and dimensioned from end a" } } },
|
|
51
57
|
"at": { "anyOf": [{ "$ref": "#/$defs/vec3" }, { "$ref": "#/$defs/address" }] },
|
|
52
58
|
"rotate": { "$ref": "#/$defs/vec3" },
|
|
53
59
|
"to": { "$ref": "#/$defs/vec3", "description": "A beam's end b, with from its end a" },
|
|
@@ -104,7 +110,7 @@
|
|
|
104
110
|
"at": { "$ref": "#/$defs/beamAddress" },
|
|
105
111
|
"thread": { "type": "string", "description": "A thread by name (M5): sizes the hole, the tap or the seat through @rulecad/fixings" },
|
|
106
112
|
"kind": { "enum": ["clearance", "close", "loose", "tap"], "description": "A drilled hole's kind" },
|
|
107
|
-
"head": { "type": "string", "description": "A counterbore's head: cap, button, hex or pan" },
|
|
113
|
+
"head": { "type": "string", "description": "A counterbore's head: cap, button, hex or pan; an access hole's, the head its hex key turns: cap (the default), button or countersunk" },
|
|
108
114
|
"diameter": { "$ref": "#/$defs/expr", "description": "mm, in place of a thread's figure" },
|
|
109
115
|
"depth": { "$ref": "#/$defs/expr", "description": "mm from the face or the end" },
|
|
110
116
|
"through": { "enum": ["wall", "beam"], "description": "A drilled hole through one wall (the default) or right through the beam" },
|
|
@@ -116,6 +122,25 @@
|
|
|
116
122
|
"radius": { "$ref": "#/$defs/expr", "description": "A pocket's corner radius, mm" },
|
|
117
123
|
"length": { "$ref": "#/$defs/expr", "description": "A notch's length along the beam, mm" } } },
|
|
118
124
|
"address": { "type": "string", "pattern": "^[a-z][\\w-]*(\\.[\\w-]+)+(@-?\\d+(\\.\\d+)?%?)?$", "description": "An anchor by name, <item>.<anchor>; on a beam an end (x1.a, x1.b), an end bore (x1.a.1), or a face with a distance from end a (x1.top@120), from end b (x1.top@-20) or a share of the length (x1.top@50%), the second slot of a face x1.top.2@120" },
|
|
125
|
+
"join": {
|
|
126
|
+
"type": "object",
|
|
127
|
+
"description": "Two beams joined: an end of one (a), a place on the other (b), and how (kind)",
|
|
128
|
+
"required": ["kind", "a", "b"],
|
|
129
|
+
"additionalProperties": false,
|
|
130
|
+
"properties": {
|
|
131
|
+
"kind": { "enum": ["blind", "end-tap", "bracket", "gusset", "cube", "hidden", "anchor", "mitre", "pivot", "splice", "printed"], "description": "blind: a's end tapped, a button-head screw's head in b's slot, an access hole across b. end-tap: a's end tapped, a cap screw through a hole drilled across b. bracket, gusset and splice with \"fitting\": \"printed\" add a printed fitting and its screws; bracket, gusset, splice, hidden and anchor with a bought fitting's set by name add that fitting, its screws and the holes it needs. The rest (cube, mitre's key, pivot, printed) are checked where they meet and stiffen the frame by an estimate; their fittings come in later releases" },
|
|
132
|
+
"a": { "type": "string", "description": "A beam's end: y1.a, or one bore of it where the end has several (y1.a.2)" },
|
|
133
|
+
"b": { "type": "string", "description": "A place on the other beam where a's end (its bore's axis) meets it: a face with a distance from its end a (x1.back@120, x1.top@-20, x1.top@50%), or an end (x1.b) for a splice, mitre or corner" },
|
|
134
|
+
"fitting": { "type": "string", "minLength": 1, "description": "For a kind with a fitting: printed, or a bought fitting's rule set by name (fitting-motedis-bracket-20-b6), or bought to be told which sets there are. Printed, a bracket, gusset or splice join adds the fitting as an item, placed from where the beams are, its screws into slot nuts in both beams as fastens, and its own stiffness by finite elements. A bought set on a bracket, gusset, splice, hidden or anchor join adds its item (a reference, listed with its price), its screws into the set's nuts as fastens, the hole a beam needs for it, and its set's stiffness, an estimate until the joint rig measures it" },
|
|
135
|
+
"brace": { "type": "boolean", "description": "A printed bracket's brace across its inside corner" },
|
|
136
|
+
"face": { "type": "string", "description": "A printed gusset's: the face of b it lies on (front, back.2), one of the two square to a; left out, the one its frame from the beams' directions gives. A generated frame names the face looking out of the frame" },
|
|
137
|
+
"shape": { "enum": ["L", "T"], "description": "A printed gusset's shape: L (one arm along each beam) or T (a bar along b on both sides of a, where b has room). Left out, a T where b has room for its bar, else an L. A generated gantry gives L at its top side beams, where a T's bar would rise beside the post into the moving beam's path" },
|
|
138
|
+
"load": { "type": "number", "description": "A printed fitting's design load in N, across beam a at its screw (default 100): it is sized to about twice the margin at it" },
|
|
139
|
+
"nut": { "enum": ["slide-in", "drop-in", "roll-in", "hammer", "square", "t-bolt"], "description": "A printed fitting's slot nuts' kind (default: the strongest made for the slot)" },
|
|
140
|
+
"screw": { "type": "string", "description": "For blind and end-tap: the screw by thread and head (M5 button), where not the end bore's thread with the kind's head" },
|
|
141
|
+
"note": { "type": "string" }
|
|
142
|
+
}
|
|
143
|
+
},
|
|
119
144
|
"fasten": {
|
|
120
145
|
"type": "object",
|
|
121
146
|
"description": "A screwed joint: the screw by thread and head, the parts it passes in order, the part it ends in, and where the screws go (at, an anchor each, or holes, a part's own holes)",
|
|
@@ -128,10 +153,10 @@
|
|
|
128
153
|
"properties": {
|
|
129
154
|
"screw": { "type": "string", "description": "The screw, by its thread and head: M3 cap, M4 button, M3x12 countersunk, 6-32 UNC cap (the names @rulecad/fixings reads). With no length in the name, the shortest sold length that fits is chosen" },
|
|
130
155
|
"through": { "type": "array", "items": { "type": "string" }, "description": "The parts the screw passes through, in order from under its head: items (bracket) or item.part (bracket.body). Each needs a clearance hole for the thread" },
|
|
131
|
-
"into": { "type": "string", "description": "The part the screw ends in: a pilot, a tapped or printed thread, an insert's hole or a nut's seat there, or a clearance hole with nut" },
|
|
156
|
+
"into": { "type": "string", "description": "The part the screw ends in: a pilot, a tapped or printed thread, an insert's hole or a nut's seat there, or a clearance hole with nut. Or a slot on a beam (x1.top, x1.top.2, x1.top@120): the screw ends in a slot nut under the slot's lips, the one made for that slot and thread (nut chooses its kind), and each screw lies over a slot's centre line (fasten.slot)" },
|
|
132
157
|
"at": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/anchorRef" }, "description": "One screw at each anchor: a point on its axis (bracket.h1), the anchor's axis along the screw" },
|
|
133
158
|
"holes": { "type": "string", "description": "In place of at: a part whose holes are the screws' places, found in the part as drawn (a circuit board: its mounting holes)" },
|
|
134
|
-
"nut": { "anyOf": [{ "type": "boolean" }, { "type": "string" }], "description": "What holds the screw where the part it ends in does not: true or hex, square, lock. It sits on that part's far face, or in a nut's seat drawn there" },
|
|
159
|
+
"nut": { "anyOf": [{ "type": "boolean" }, { "type": "string" }], "description": "What holds the screw where the part it ends in does not: true or hex, square, lock. It sits on that part's far face, or in a nut's seat drawn there. Into a beam's slot, the slot nut's kind: slide-in, drop-in, roll-in, hammer, square or t-bolt (left out, the strongest made for the slot). A slide-in or square nut enters only from an open end of the slot (frame.nut, frame.preload)" },
|
|
135
160
|
"washer": { "type": "boolean", "description": "A plain washer under the head" },
|
|
136
161
|
"length": { "$ref": "#/$defs/expr", "description": "The screw's length in mm, where the name gives none: checked for reaching, bottoming out and standing proud" },
|
|
137
162
|
"torque": { "$ref": "#/$defs/expr", "description": "The tightening torque, N m: the pressure under the head is then held against the material it sits on (fasten.seat)" },
|
|
@@ -158,7 +183,7 @@
|
|
|
158
183
|
"min": { "$ref": "#/$defs/values" },
|
|
159
184
|
"max": { "$ref": "#/$defs/values" },
|
|
160
185
|
"value": { "$ref": "#/$defs/values" },
|
|
161
|
-
"support": { "type": "object", "additionalProperties": false, "description": "What takes this joint's tipping load: bought bearings, or printed clips (read by FE)", "properties": { "bearings": { "type": "array", "items": { "type": "string" } }, "clips": { "type": "array", "items": { "type": "string" } }, "pitch": { "$ref": "#/$defs/expr", "description": "Diameter the clips stand on, mm" }, "cell": { "$ref": "#/$defs/expr", "description": "FE cell, mm" } } },
|
|
186
|
+
"support": { "type": "object", "additionalProperties": false, "description": "What takes this joint's tipping load: bought bearings, or printed clips (read by FE)", "properties": { "bearings": { "type": "array", "items": { "type": "string" } }, "clips": { "type": "array", "items": { "type": "string" } }, "pitch": { "$ref": "#/$defs/expr", "description": "Diameter the clips stand on, mm" }, "cell": { "$ref": "#/$defs/expr", "description": "FE cell for the clips, mm (0.8 by default)" }, "linkCell": { "$ref": "#/$defs/expr", "description": "FE cell for the link bent beyond this joint (link.deflection), mm (by default a third of the link's thinnest side, 1 to 4)" } } },
|
|
162
187
|
"errors": { "type": "object", "description": "What this joint adds to the error at the tool, degrees, by name (play, twist, bearing): an expression reading a rule, so a measurement moves it", "additionalProperties": { "$ref": "#/$defs/expr" } },
|
|
163
188
|
"home": { "type": "object", "additionalProperties": false, "required": ["endstop"], "description": "How this joint finds zero", "properties": { "endstop": { "type": "string", "description": "An item.anchor at the switch" }, "direction": { "enum": [1, -1] } } },
|
|
164
189
|
"brake": { "type": "string", "description": "What holds this joint with the power off (a ratchet, a detent): counted by motor.holds" },
|