@rulecad/cad 0.8.0 → 0.10.0
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 +45 -16
- package/CHANGELOG.md +724 -0
- package/EXAMPLES.md +61 -54
- package/README.md +376 -98
- package/TUTORIAL.md +2 -2
- package/bin/cad.mjs +2664 -541
- package/lib/animate.mjs +173 -49
- package/lib/assembly.mjs +1883 -435
- package/lib/beams.mjs +256 -52
- package/lib/belts.mjs +66 -15
- package/lib/board-work.mjs +12 -0
- package/lib/bought.mjs +309 -53
- package/lib/buildpage.mjs +179 -29
- package/lib/cache-file.mjs +105 -0
- package/lib/carried.mjs +201 -0
- package/lib/clone.mjs +194 -42
- package/lib/code-text.mjs +28 -0
- package/lib/design-imports.mjs +127 -0
- package/lib/design.mjs +871 -147
- package/lib/designshapes.mjs +142 -0
- package/lib/drive.mjs +187 -63
- package/lib/edit.mjs +922 -192
- package/lib/errors.mjs +16 -3
- package/lib/estimates.mjs +51 -0
- package/lib/explain.mjs +62 -13
- package/lib/fasten.mjs +2708 -507
- package/lib/fe-key.mjs +29 -0
- package/lib/fittings.mjs +721 -122
- package/lib/fixings.mjs +38 -13
- package/lib/framebuild.mjs +790 -175
- package/lib/framecheck.mjs +1901 -368
- package/lib/framegen.mjs +108 -22
- package/lib/frameheat.mjs +225 -42
- package/lib/frameprint.mjs +513 -108
- package/lib/frames.mjs +86 -18
- package/lib/framesize.mjs +719 -120
- package/lib/frametip.mjs +235 -0
- package/lib/gait.mjs +135 -23
- package/lib/grip.mjs +62 -13
- package/lib/guides.mjs +1403 -230
- package/lib/host.mjs +129 -23
- package/lib/inplace.mjs +171 -36
- package/lib/jigs.mjs +360 -78
- package/lib/joins.mjs +697 -118
- package/lib/jsonedit.mjs +88 -26
- package/lib/kept.mjs +84 -0
- package/lib/kit.mjs +439 -69
- package/lib/layout.mjs +2 -1
- package/lib/links.mjs +149 -42
- package/lib/list.mjs +334 -64
- package/lib/live-guard.mjs +68 -0
- package/lib/live-shape.mjs +96 -24
- package/lib/live.mjs +189 -59
- package/lib/loads.mjs +597 -136
- package/lib/machine.mjs +372 -74
- package/lib/magnets.mjs +162 -44
- package/lib/measured.mjs +1080 -117
- package/lib/mesh.mjs +526 -119
- package/lib/meshcmd.mjs +215 -60
- package/lib/motors.mjs +1002 -214
- package/lib/motorsvg.mjs +114 -32
- package/lib/names.mjs +18 -1
- package/lib/optimise.mjs +991 -287
- package/lib/order.mjs +515 -114
- package/lib/panels.mjs +482 -94
- package/lib/parts.mjs +81 -23
- package/lib/pins.mjs +163 -44
- package/lib/plates.mjs +223 -35
- package/lib/player.mjs +37 -9
- package/lib/power.mjs +64 -13
- package/lib/preview.mjs +83 -16
- package/lib/profilemeasure.mjs +572 -129
- package/lib/rules.mjs +17 -6
- package/lib/sandbox-hooks.mjs +179 -27
- package/lib/sandbox-lock.mjs +225 -0
- package/lib/sandbox-preload.mjs +2 -2
- package/lib/sandbox-run.mjs +122 -25
- package/lib/sandbox.mjs +667 -75
- package/lib/schema.mjs +42 -11
- package/lib/seats.mjs +227 -49
- package/lib/services.mjs +261 -52
- package/lib/sheet.mjs +963 -179
- package/lib/slotnuts.mjs +213 -34
- package/lib/targets/gist.mjs +4 -1
- package/lib/targets.mjs +22 -4
- package/lib/task.mjs +376 -79
- package/lib/versions.mjs +285 -39
- package/lib/wires.mjs +228 -45
- package/lib/workspace.mjs +200 -14
- package/package.json +19 -19
- package/schemas/assembly.schema.json +2 -2
- package/schemas/project.schema.json +6 -0
- package/templates/coupons/MEASURE.md +109 -0
- package/templates/coupons/assemblies/fixings-test.json +20 -0
- package/templates/coupons/assemblies/slot-test.json +11 -0
- package/templates/coupons/objects/fixings-coupon.js +88 -0
- package/templates/coupons/objects/fixings-coupon.json +26 -0
- package/templates/coupons/objects/holds-coupon.js +130 -0
- package/templates/coupons/objects/holds-coupon.json +42 -0
- package/templates/coupons/objects/slot-coupon.js +89 -0
- package/templates/coupons/objects/slot-coupon.json +29 -0
- package/templates/coupons/project.json +10 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rulecad/cad",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "The cad command: JSCAD designs from traceable rules, checked for printing and fit, versioned by what fits, shared as links and exported as Bambu 3MF.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"cli"
|
|
47
47
|
],
|
|
48
48
|
"engines": {
|
|
49
|
-
"node": ">=
|
|
49
|
+
"node": ">=22.13"
|
|
50
50
|
},
|
|
51
51
|
"repository": {
|
|
52
52
|
"type": "git",
|
|
@@ -58,27 +58,27 @@
|
|
|
58
58
|
"url": "https://github.com/JoniBach/rulecad/issues"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@rulecad/variables": "^0.
|
|
62
|
-
"@rulecad/keyboard-layout": "^0.
|
|
63
|
-
"@rulecad/printcheck": "^0.
|
|
64
|
-
"@rulecad/fit": "^0.
|
|
65
|
-
"@rulecad/model-link": "^0.
|
|
66
|
-
"@rulecad/versions": "^0.
|
|
67
|
-
"@rulecad/shapes": "^0.
|
|
68
|
-
"@rulecad/rules": "^0.
|
|
61
|
+
"@rulecad/variables": "^0.4.0",
|
|
62
|
+
"@rulecad/keyboard-layout": "^0.2.0",
|
|
63
|
+
"@rulecad/printcheck": "^0.4.1",
|
|
64
|
+
"@rulecad/fit": "^0.5.0",
|
|
65
|
+
"@rulecad/model-link": "^0.4.0",
|
|
66
|
+
"@rulecad/versions": "^0.3.0",
|
|
67
|
+
"@rulecad/shapes": "^0.6.0",
|
|
68
|
+
"@rulecad/rules": "^0.5.0",
|
|
69
69
|
"@jscad/modeling": "^2.12.0",
|
|
70
70
|
"three": "^0.186.1",
|
|
71
|
-
"@rulecad/fea": "^0.
|
|
72
|
-
"@rulecad/topopt": "^0.
|
|
73
|
-
"@rulecad/flexures": "^0.
|
|
74
|
-
"@rulecad/gears": "^0.
|
|
75
|
-
"@rulecad/motors": "^0.1
|
|
76
|
-
"@rulecad/fixings": "^0.
|
|
77
|
-
"@rulecad/robots": "^0.
|
|
78
|
-
"@rulecad/frames": "^0.
|
|
71
|
+
"@rulecad/fea": "^0.4.0",
|
|
72
|
+
"@rulecad/topopt": "^0.4.1",
|
|
73
|
+
"@rulecad/flexures": "^0.7.0",
|
|
74
|
+
"@rulecad/gears": "^0.4.0",
|
|
75
|
+
"@rulecad/motors": "^0.2.1",
|
|
76
|
+
"@rulecad/fixings": "^0.3.0",
|
|
77
|
+
"@rulecad/robots": "^0.2.0",
|
|
78
|
+
"@rulecad/frames": "^0.3.0"
|
|
79
79
|
},
|
|
80
80
|
"peerDependencies": {
|
|
81
|
-
"@rulecad/pcb": "^0.
|
|
81
|
+
"@rulecad/pcb": "^0.7.1"
|
|
82
82
|
},
|
|
83
83
|
"peerDependenciesMeta": {
|
|
84
84
|
"@rulecad/pcb": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"power": { "type": "object", "additionalProperties": false, "properties": { "margin": { "type": "number" } } },
|
|
30
30
|
"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" } } } },
|
|
31
31
|
"gravity": { "$ref": "#/$defs/vec3", "description": "Which way down is, for masses in loads (default [0, 0, -1])" },
|
|
32
|
-
"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, and at least one is named", "minProperties": 1, "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. A design is only tried where every join of a grouped beam still goes together (a blind join's screw and button head in the other beam's slot, an end-tap's cap head on its far face, a bought fitting on both profiles); the join checks of the written frame hold the rest"}, "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)"}, "rack": {"$ref": "#/$defs/expr", "description": "The sway allowed at the frame's top under frame.rack's side push alone, each way across, mm: racking as a limit (default frame.rack's own limit where the assembly gives frame.rack; none otherwise)"}}}, "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)"}}}} },
|
|
32
|
+
"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, its feet and end caps with it, [width, depth, height] in mm (a portal: [width, height]); the beams go within it, smaller by what the feet and caps add (refused on castors, whose height is not drawn)"}, "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, estimate } as a join takes them. blind and end-tap are built as they stand; bracket and gusset with their fitting, printed or bought, and hidden and anchor with a bought one; cube not yet", "oneOf": [{"type": "string"},{"type": "object", "additionalProperties": false, "required": ["kind"], "properties": {"kind": {"type": "string"}, "fitting": {"type": "string"}, "screw": {"type": "string"}, "estimate": {"type": "boolean", "description": "true: make the frame with a join the kit cannot build yet (cube; bracket, gusset, hidden or anchor with no fitting), its joins checked by their estimate. Without it those are refused, naming what is missing"}}}]}, "feet": {"description": "What stands under the upright beams' lower ends: foot, levelling or stacking (printed), a bought foot's set by name (fitting-motedis-foot-m6-d19), or a printed castor plate as { kind: castor, holes: [x, y], thread: M6, top } from the castor's drawing; left out, an end cap", "oneOf": [{"type": ["string", "null"]},{"type": "object", "additionalProperties": false, "required": ["kind", "holes", "thread"], "properties": {"kind": {"enum": ["castor"]}, "holes": {"type": "array", "minItems": 2, "maxItems": 2, "items": {"type": "number"}, "description": "The castor's bolt holes' spacing [x, y] in mm, from its maker's drawing"}, "thread": {"type": "string", "description": "Its bolts' thread, as M6"}, "top": {"type": "number", "description": "Its top plate's thickness in mm, for the bolts' length (3, an estimate, where left out)"}}}]}, "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 corner of that side keeps the join asked for and gains a printed corner bracket beside it, on drop-in nuts (where the join is a printed bracket already, that bracket is drawn braced instead; a bracket join not printed is refused with braces)"}, "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, and at least one is named", "minProperties": 1, "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. A design is only tried where every join of a grouped beam still goes together (a blind join's screw and button head in the other beam's slot, an end-tap's cap head on its far face, a bought fitting on both profiles); the join checks of the written frame hold the rest"}, "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)"}, "rack": {"$ref": "#/$defs/expr", "description": "The sway allowed at the frame's top under frame.rack's side push alone, each way across, mm: racking as a limit (default frame.rack's own limit where the assembly gives frame.rack; none otherwise)"}}}, "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)"}}}} },
|
|
33
33
|
"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" } } } },
|
|
34
34
|
"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" } } },
|
|
35
35
|
"printInPlace": { "type": "array", "minItems": 2, "items": { "type": "string" }, "description": "Items printed together as one object printed in place (\"printInPlace\": true on it): they come off the bed together, so the assembly order never takes them apart from each other" },
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"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" },
|
|
53
53
|
"variant": { "type": "string" },
|
|
54
54
|
"set": { "type": "object" },
|
|
55
|
-
"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", "belt-plate", "belt-clamp", "belt-idler"], "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" }, "pulley": { "type": "string", "description": "A belt plate's: the pulley's rule set" }, "idler": { "type": "string", "description": "A belt idler block's: the idler's rule set" }, "belt": { "type": "string", "description": "A belt part's: the belt's rule set" }, "across": { "type": "number", "description": "A belt plate's or idler block's: the pulley's or idler's middle off the slot's line, mm" }, "least": { "type": "number", "description": "A belt plate's: the least height of the belt's middle over the face, mm" }, "lift": { "type": "number", "minimum": 0, "description": "A belt plate's: how much further up its shaft the pulley stands, mm (default 0), to raise the belt without a thicker plate" }, "tension": { "type": "number", "description": "A belt part's: each span's tension, N" }, "rise": { "type": "number", "description": "A belt clamp's or idler block's: the belt's middle over the carriage's top, or over the face" }, "stretch": { "type": "number", "description": "A belt idler block's: the belt's stretch at its tension, mm" }, "carriageHoles": { "type": "array", "description": "A belt clamp's: the carriage's tapped holes, [[x, y], ...] from its top's middle" }, "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)" } } },
|
|
55
|
+
"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", "belt-plate", "belt-clamp", "belt-idler"], "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" } }, "top": { "type": "number", "exclusiveMinimum": 0, "maximum": 20, "description": "A castor plate's: its castor's top plate's thickness in mm, for its bolts' length (3, an estimate, where left out)" }, "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" }, "pulley": { "type": "string", "description": "A belt plate's: the pulley's rule set" }, "idler": { "type": "string", "description": "A belt idler block's: the idler's rule set" }, "belt": { "type": "string", "description": "A belt part's: the belt's rule set" }, "across": { "type": "number", "description": "A belt plate's or idler block's: the pulley's or idler's middle off the slot's line, mm" }, "least": { "type": "number", "description": "A belt plate's: the least height of the belt's middle over the face, mm" }, "lift": { "type": "number", "minimum": 0, "description": "A belt plate's: how much further up its shaft the pulley stands, mm (default 0), to raise the belt without a thicker plate" }, "tension": { "type": "number", "description": "A belt part's: each span's tension, N" }, "rise": { "type": "number", "description": "A belt clamp's or idler block's: the belt's middle over the carriage's top, or over the face" }, "stretch": { "type": "number", "description": "A belt idler block's: the belt's stretch at its tension, mm" }, "carriageHoles": { "type": "array", "description": "A belt clamp's: the carriage's tapped holes, [[x, y], ...] from its top's middle" }, "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)" } } },
|
|
56
56
|
"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" } } } } },
|
|
57
57
|
"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" } } },
|
|
58
58
|
"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" } } },
|
|
@@ -14,6 +14,12 @@
|
|
|
14
14
|
"material": { "type": "string", "description": "The plastic its parts print in unless a part says otherwise: PLA or PETG, or a rule set in rules/ that gives strength, modulus and density. Printed fittings are sized from it" },
|
|
15
15
|
"printer": { "type": "string", "pattern": "^([A-Za-z0-9][A-Za-z0-9_-]*)?$", "description": "The printer rule set its prints are checked against (bed, overhang, layer), as x1c; left out, cad.config.json's printer. A plain name: letters, digits, - and _" },
|
|
16
16
|
"objects": { "type": "array", "items": { "type": "string", "pattern": "^[a-z][a-z0-9-]*$" }, "description": "Its objects, by name, as cad new <project>/<object> lists them" },
|
|
17
|
+
"version": { "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+$", "description": "The project's latest release, as cad release <project> writes it (a git tag <project>@<version> holds it). Left to cad release" },
|
|
18
|
+
"release": {
|
|
19
|
+
"type": "object",
|
|
20
|
+
"description": "The version of each object in the project's latest release, by name, as cad release <project> writes it. Left to cad release",
|
|
21
|
+
"additionalProperties": { "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+$" }
|
|
22
|
+
},
|
|
17
23
|
"filaments": {
|
|
18
24
|
"type": "object",
|
|
19
25
|
"description": "Its filaments, by name, for parts that print in more than one (a part's \"filament\": \"legend\"): each in its AMS slot",
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Coupons: measure your printer
|
|
2
|
+
|
|
3
|
+
Every hole, pocket and slot the kit draws starts from a figure someone else measured, or an estimate. These coupons
|
|
4
|
+
settle them on your own printer and plastic: each prints a feature at the kit's figure and a step or two either side,
|
|
5
|
+
with its figure beside it. Find the one that works best, write its figure back with `cad measured`, and every design in
|
|
6
|
+
this workspace follows it the next time it is checked or exported.
|
|
7
|
+
|
|
8
|
+
`npx cad coupons` put this project in your workspace. The rows below keep the numbers they have in the kit's full bench
|
|
9
|
+
sheet (`examples/bench/projects/benchmarks/MEASURE.md` in the rulecad repository), so cad's messages and the kit's notes
|
|
10
|
+
name the same row.
|
|
11
|
+
|
|
12
|
+
**Print in your usual plastic, at 0.2 mm layers, four walls, 25% infill.** Keep the same spool for the whole set.
|
|
13
|
+
|
|
14
|
+
## What to print
|
|
15
|
+
|
|
16
|
+
| Print | Parts | Solid mass | Measures |
|
|
17
|
+
|---|---|---|---|
|
|
18
|
+
| 1. Fixings coupons (once in PLA, once in PETG if you print both) | `fixings-coupon`, and `holds-coupon` behind it on the same plate: a plate and 13 loose pieces (`cad plates coupons/fixings-test` lays out both) | 55 g and 38 g, 93 g on one plate about 195 by 194 mm, about 100 minutes | 22 to 28, 40 to 47 |
|
|
19
|
+
| 2. Slot coupon (when you build with aluminium beams) | `slot-coupon` (26 loose pieces; `cad plates coupons/slot-test`) | 40 g, about 45 minutes | 29 to 33 |
|
|
20
|
+
|
|
21
|
+
`cad export coupons/fixings-coupon` (and `holds-coupon`, `slot-coupon`) writes each as a 3MF for Bambu Studio.
|
|
22
|
+
|
|
23
|
+
## What you need
|
|
24
|
+
|
|
25
|
+
| | |
|
|
26
|
+
|---|---|
|
|
27
|
+
| **For the fixings coupon** | Socket cap screws: M2 × 6, M2.5 × 6, M3 × 6, M3 × 8, M4 × 8, M5 × 16; M3 and M4 hex nuts; CNC Kitchen heat-set inserts, M2 × 3 and M3 × 5.7, and a soldering iron with an insert tip; steel bolts or set screws M6 × 16, M8 × 20 and M10 × 25 or longer; a spanner |
|
|
28
|
+
| **For the holds coupon** | Steel dowel pins 3 × 12 mm (ISO 8734 or ISO 2338 m6): two; a few 12 mm lengths of 1.75 mm filament, cut square; disc magnets 6 × 3 mm and 8 × 3 mm, N35 or stronger: three 6 × 3 and four 8 × 3 (sold in tens); a steel M8 hex nut and an M8 washer, for the pull bolt; two blocks of wood no more than 20 mm thick (18 mm plywood offcuts) and a G-clamp; a loop of strong cord; a luggage scale (it reads to 50 kg); a vice, or two scraps of wood to press magnets between |
|
|
29
|
+
| **For the slot coupon** | An offcut of your own beam, 50 to 100 mm long, cut square at one end; M2.5 hex nuts and M2.5 × 8 screws for slot 6, M5 hex nuts and M5 × 10 screws for slot 8; one of the bought slot nuts made for your beam (slide-in or drop-in) |
|
|
30
|
+
|
|
31
|
+
## The measurements
|
|
32
|
+
|
|
33
|
+
Each row's command writes the figure back, in this workspace's copy of the rule set (`rules/x1c.json`, `rules/pla.json`,
|
|
34
|
+
`rules/slot-8.json`), marked as measured with the date. Give it on its own, as the rows show, or after one of your own
|
|
35
|
+
assemblies (`cad measured home/lidded-box x1c.pilot_m3=2.9`) to see what it moves there. `cad measured --export` then
|
|
36
|
+
prints every figure you measured as a change to the kit's rule sets, to send to the kit (see the end of this sheet).
|
|
37
|
+
|
|
38
|
+
| # | What | How | The kit assumes | Measured |
|
|
39
|
+
|---|---|---|---|---|
|
|
40
|
+
| 22 | Pilots, rows M2, M2.5, M3, M4, M5 | Each figure is the hole as drawn. Drive a screw of that size into each by hand with a driver. The best is the smallest the screw goes into straight, without splitting the boss, that turns with an even drag and cannot be pulled out by hand. `cad measured x1c.pilot_m4=<figure>` (and `pilot_m2`, `pilot_m2_5`, `pilot_m3`, `pilot_m5`; from the PETG print, `x1c.pilot_m4_petg`) | M2 2.1, M2.5 2.5, M3 2.9, M4 3.75, M5 4.7 mm | |
|
|
41
|
+
| 23 | Insert holes, rows IM2, IM3 | Each figure is the hole as drawn. Set an insert in each with the iron. The best goes in straight and flush, pushes no ring of plastic up round it, and does not turn when a screw is tightened in it. `x1c.insert_m2=<figure>`, `x1c.insert_m3=<figure>` (`_petg` from the PETG print) | 3.2 and 4.0 mm, the insert maker's | |
|
|
42
|
+
| 24 | Nut pockets, rows NM3, NM4 | Each figure is the clearance across the flats. Press a nut in with a thumb, then drive a screw into it from the top. The best is the tightest the nut goes into by hand and does not turn in as the screw is driven. `x1c.nut_fit=<figure>` | 0 mm (a snug fit) | |
|
|
43
|
+
| 25 | Nut slots, rows TM3 and TM4 (the back edge) | Each figure is the clearance across the flats. Drop a nut into the slot from the top, then run a screw in from the coupon's back edge through it and tighten. The best is the tightest the nut drops into by hand, that keeps it when the coupon is turned over, and where it does not turn as the screw tightens. `x1c.nut_slip=<figure>` | 0.1 mm (`x1c.slip`) | |
|
|
44
|
+
| 26 | Counterbore, CM3 | Drive an M3 × 8 cap screw in: its head sits wholly under the top face, a hex key reaches it, and it tightens in the pilot under it. If the head rubs, raise `x1c.fit` | `x1c.fit` 0.2 mm each side | |
|
|
45
|
+
| 27 | Printed threads, rows M6P, M8P, M10P | Each figure is the gap on the radius between the printed thread and a bought bolt. Turn a bolt into each by hand. The best is the tightest it turns all the way into smoothly, with no binding and no wobble, and that does not strip when tightened firmly with a spanner. Where the sizes differ, take the figure two of the three agree on. `x1c.thread_gap=<figure>` | 0.2 mm, an estimate | |
|
|
46
|
+
| 28 | Thread flanks, M8P against M8S | Rows M8P and M8S are the same holes in the two forms a printed thread can take: P has its down-facing flanks laid back to 45° (the kit's default, easy to print, about 51% of the standard's flank overlap at 0.2 mm), S keeps the standard's 60° form (more overlap, 63%, but its down-facing flanks overhang 60°). Compare them at each gap, in this order: it holds (tighten a bolt firmly with a spanner: no stripping, the least wobble), it turns smoothly (no catching all the way in), it prints clean (look into the hole with a light: whole teeth, no drooping or strings on the flanks' undersides). The form that wins the first test wins, and the next test settles a tie. Write 45 for P or 60 for S: `x1c.thread_flank=45`. It records the result; changing the kit's default form is a decision of its own | 45, the printed form | |
|
|
47
|
+
| 29 | Tongues, slot 6 and slot 8 | Each tongue's figure is its clearance a side in the beam's opening. Lay the head on the beam's face with the tongue in the slot and push it the beam's length from the square end. The best is the tightest that slides all the way by hand, and does not rattle when the beam is shaken across. `cad measured x1c.slot_fit=<figure>` | 0.2 mm a side (`x1c.fit`, community) | |
|
|
48
|
+
| 30 | Carriers, slot 6 (M2.5) and slot 8 (M5) | Each carrier's figure is its clearance a side all round the slot. Drop its nut into its side (or its end), slide it into the beam from the square end, and run a screw into it through a scrap of plate. The best is the tightest that slides the beam's length by hand, nut in, and that pulls up square when the screw is tightened. Where it is looser than the tongue in 29, write the carrier's figure to `x1c.slot_fit` instead: a part that fills the slot needs the larger | 0.2 mm a side | |
|
|
49
|
+
| 31 | Printed slots, slot 6 and slot 8 | Each block's figure is how far its printed slot is opened a side. Slide a bought slot nut for your beam down each from the top. The best is the tightest it runs the length of by hand without catching, and that holds it upright when the block is tipped on its side. `x1c.printed_slot_fit=<figure>` | 0.2 mm a side | |
|
|
50
|
+
| 32 | The slot itself, by caliper | On the beam's square end: the opening across the face, the lips' thickness, the cavity's width under the lips and its depth from the face (the depth rod of the calipers). Write each to the slot set your beam's profile names, or to `slot-6` or `slot-8` for an unbranded beam: `cad measured slot-8.opening=<mm> slot-8.lip_thickness=<mm> slot-8.cavity_width=<mm> slot-8.cavity_depth=<mm>`. They go in your workspace's copy of the set as measured, and cad refuses figures that make no slot | slot 6: opening 6, lips 1.5, cavity 12 wide, 5.5 deep. Slot 8: 8, 2.2, 16.5, 9 (community figures) | |
|
|
51
|
+
| 33 | The fit, confirmed | With 29 to 32 written back, print again the carrier whose figure you wrote to `x1c.slot_fit`: `cad export coupons/slot-coupon --part slot-8-carrier-<figure>` (or `slot-6-`). It is now drawn from your measured slot. It should slide as that carrier did in 30; a design's own carriers take the same fit with `printer: v.x1c` | | |
|
|
52
|
+
| 40 | Snap pins' barb, the six loose snap pins | Each pin has one, two or three notches down its foot: barb 0.3, 0.4 and 0.5 mm past its peg. Hold the plate over the table's edge so a barb can come out underneath, push each 4 mm pin from the top through the middle socket of row S4, and pull it back by its foot; then the 3 mm pins in S3. The best is the deepest barb that still clicks through by hand and holds when pulled firmly. `cad measured x1c.snap_barb=<figure>`. It records the result: pins are still drawn with a 0.4 mm barb unless their name says another (`snap pin 4x6 barb 0.5`) | 0.4 mm | |
|
|
53
|
+
| 41 | Snap pin sockets, rows S3 and S4 | Each figure is the gap round the peg, each side, as drawn. Push the pin that won 40 through each socket of its row. The best is the tightest it clicks through by hand, and that does not rock once through. `x1c.snap_clearance=<figure>` | 0.05 mm, measured on the launcher's fit test plate with 4 mm pins (this row's tightest socket is 0.1) | |
|
|
54
|
+
| 42 | Pins pressed, rows D3P and FP | Each figure is how much smaller the hole is drawn than the pin, past the hole compensation. Press a 3 × 12 mm dowel into each hole of D3P by hand or in a vice, and a 12 mm length of filament into each of FP. The best goes in straight without splitting its boss and cannot be pulled out by hand. Where the two rows differ, write the dowel's. `x1c.pin_press=<figure>` | 0.05 mm, an estimate | |
|
|
55
|
+
| 43 | Pins slipping, rows D3S and FS | Each figure is how much larger the hole is drawn than the pin, past the hole compensation. Slide a dowel into each hole of D3S by hand and turn it, then a length of filament in FS. The best is the tightest it slides into and turns freely in, without rattling. `x1c.pin_slip=<figure>` | 0.2 mm, an estimate | |
|
|
56
|
+
| 44 | Magnet pockets, rows 6x3 and 8x3 | Each figure is how much smaller the pocket is drawn than the magnet, past the hole compensation. Press a magnet into each with a thumb, or in a vice between two scraps of wood. The best goes in flush without splitting the wall, and stays in when the plate is turned over and tapped on the table. Push each out again with a length of filament through the hole under it. `x1c.magnet_press=<figure>`. The glued fit is not printed here: keep `x1c.magnet_glue` unless a glued magnet will not go in, and then raise it by 0.1 | 0.1 mm, an estimate. The kit warns that it stretches a pocket's wall close to PLA's strength (24.6 MPa for 8 × 3, 32.8 MPa for 6 × 3, against 39) | |
|
|
57
|
+
| 45 | Crush ribs, row 8x3R | Each figure is how far inside the magnet the ribs' tips stand, past the hole compensation. Press an 8 × 3 magnet into each by hand. The best goes in flush by hand and holds when the plate is turned over and tapped. `x1c.magnet_crush=<figure>` | 0.2 mm, an estimate | |
|
|
58
|
+
| 46 | Printed bolts in printed nuts, rows M8N and M10N, and the six loose bolts | Each figure is the thread gap on the radius, half of it drawn in the nut and half in the bolt; each loose bolt has one, two or three notches down its head for the first, second and third figure of its row. Turn each bolt through its own nut by hand. The best is the tightest that turns all the way through smoothly, without binding or wobble, and does not strip when tightened firmly by hand on its head (a printed thread takes no spanner). This is a second reading of the gap in 27: the kit draws a printed pair from the same `x1c.thread_gap`. Where the two differ, write the larger, so both turn | 0.2 mm, an estimate | |
|
|
59
|
+
| 47 | A printed bolt's strength across its layers, the pull bolt | Last. Clamp two blocks of wood to the table, 10 mm apart and standing past its edge. The blocks are no more than 20 mm thick, an 18 mm plywood offcut for instance, so the nut reaches the thread with the waist hanging below them. Push the pull bolt up through the gap from below, put an M8 washer and a steel M8 nut on its thread, and run the nut down finger tight: the whole waist and both its cones hang below the blocks. Tie a loop of cord round the waist above the head, hook the luggage scale in it and pull straight down, slowly, until the waist breaks. The scale's peak in kilograms, times 9.81, over the waist's 9.62 mm² (3.5 mm across), is the strength in MPa: kilograms × 1.02. `cad measured pla.strength_z=<MPa>` (from the PETG print, `petg.strength_z`). Wear glasses | 38.2 kg (PLA's 39 MPa along its layers: its data sheet gives no figure across them); 22.6 kg for PETG (23 MPa) | |
|
|
60
|
+
|
|
61
|
+
The fixings coupon (22 to 28) is one plate with a figure beside every feature, and each row named on its left: a
|
|
62
|
+
pilot row by its thread (M4), then I for insert holes, N for nut pockets, T for nut slots, C for the counterbore,
|
|
63
|
+
and a printed thread by its size and form (M8P, M8S). The figure beside a feature is the one to write back. Print it
|
|
64
|
+
once in PLA and once in PETG, both upright as it is drawn. A pilot or an insert hole is written per plastic: the PLA
|
|
65
|
+
figure without a suffix, the PETG one with `_petg`. The nut fits, the thread gap and the flank form are one figure per
|
|
66
|
+
printer: write the PLA figure, and note the PETG one in the last column where it differs. `cad history`
|
|
67
|
+
then shows each against what the kit drew before.
|
|
68
|
+
|
|
69
|
+
The holds coupon (40 to 47) measures what holds two parts together without a steel screw. It prints beside the fixings
|
|
70
|
+
coupon, on the same plate: a plate with a row for each fit, named on its left, and 13 loose pieces. S3 and S4 are
|
|
71
|
+
sockets for 3 and 4 mm snap pins, their figure the gap round the peg; D3P and FP are holes a 3 mm dowel or 1.75 mm
|
|
72
|
+
filament is pressed into, D3S and FS holes it turns in; 6x3 and 8x3 are pockets disc magnets are pressed into, 8x3R a
|
|
73
|
+
pocket with three crush ribs; M8N and M10N are printed nuts, a hex nut's height, for printed bolts. The loose pieces are
|
|
74
|
+
the six printed bolts for those nuts, the pull bolt with its waist, and six snap pins, three of each size. The pull
|
|
75
|
+
bolt prints standing on its 13 mm head, as drawn, so its waist breaks across its layers: lying down it would break
|
|
76
|
+
along them and measure the strength the data sheet already gives. Its waist is 3.5 mm across and 3.5 mm long, under
|
|
77
|
+
38 mm of shank and thread: a sideways push of 1 N at its tip as the nozzle passes stresses the waist about 9.9 MPa
|
|
78
|
+
and sways the tip about 0.46 mm (beam bending, an estimate), where a 3 mm waist 6 mm long took 16 MPa and 1 mm. The
|
|
79
|
+
X1C's bed moves only up and down, so nothing shakes it sideways. If it wobbles or snaps all the same, print it alone,
|
|
80
|
+
after the plate, slowed for cooling as the slicer does for a small layer. A loose piece
|
|
81
|
+
says its figure by notches: one, two or three, for the first, second and third figure of its row. The snap sockets go
|
|
82
|
+
through the plate, and each magnet pocket has a hole under it to push the magnet out, so its first layer has a few
|
|
83
|
+
round holes; everything else stands on a plain first layer. Every feature is drawn from the printer's rules through
|
|
84
|
+
@rulecad/fixings, at the kit's figure and a step either side, so the coupon printed again after cad measured is centred
|
|
85
|
+
on yours. The fits are one figure per printer: write the PLA figure, and note the PETG one where it differs. The pull
|
|
86
|
+
bolt measures the plastic, so it is written per plastic. `cad measured` refuses a figure no fit of its kind can be, and
|
|
87
|
+
a strength across the layers above the plastic's strength along them. `cad history` then shows
|
|
88
|
+
each against what the kit drew before.
|
|
89
|
+
|
|
90
|
+
The slot coupon (29 to 33) is 26 loose pieces, each with its figure, the clearance a side, on top: in the front row
|
|
91
|
+
five tongues for slot 6 and five for slot 8 (a T-shaped key, its head on the face and its tongue in the opening), in
|
|
92
|
+
the middle row five carriers for each (a block that slides in the slot holding a hex nut), and at the back three short
|
|
93
|
+
printed slots for each, standing on end. The slot 8 pieces are the larger. Slot 6 is the slot of 20 mm beams, slot 8
|
|
94
|
+
of 30 and 40 mm beams. Every piece is drawn from the slot's rule set, so once 32 is written back the coupon prints from
|
|
95
|
+
your own slot. `cad history` then shows each figure against what the kit drew before.
|
|
96
|
+
|
|
97
|
+
## Sending your figures to the kit
|
|
98
|
+
|
|
99
|
+
`cad measured --export` prints every figure measured in this workspace that the kit does not hold yet, as a change to
|
|
100
|
+
the kit's own rule sets (a diff, the form a pull request takes). Save it (`npx cad measured --export > measured.diff`)
|
|
101
|
+
and send it to the kit, with the printer, the plastic and the spool you printed with: open an issue at
|
|
102
|
+
https://github.com/JoniBach/rulecad/issues and attach the file, or apply it to a copy of the repository and open a pull
|
|
103
|
+
request. Measurements from many printers are how the kit's estimates become figures people can trust.
|
|
104
|
+
|
|
105
|
+
## Words used
|
|
106
|
+
|
|
107
|
+
**Pilot:** a hole sized for a screw to cut its own thread. **Heat-set insert:** a threaded brass sleeve melted into a
|
|
108
|
+
hole. **Hole compensation:** how much smaller a printed hole comes out than it was drawn. **Slot nut:** a nut made to
|
|
109
|
+
slide or drop into an aluminium beam's slot.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Fixings coupons",
|
|
3
|
+
"kind": "fit",
|
|
4
|
+
"description": "The fixings coupon and, behind it on the same plate, the holds coupon: write each result back with cad measured <rule>=<value> (MEASURE.md, rows 22 to 28 and 40 to 47), and cad history keeps it against what the kit drew before. Both fit the X1C's 256 mm bed together, about 195 by 194 mm: the holds coupon 195.3 by 76.8 mm, placed 117 mm behind the fixings coupon's front edge, and the fixings coupon 98.6 by 111.8 mm.",
|
|
5
|
+
"items": [
|
|
6
|
+
{
|
|
7
|
+
"id": "coupon",
|
|
8
|
+
"object": "fixings-coupon"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"id": "holds",
|
|
12
|
+
"object": "holds-coupon",
|
|
13
|
+
"at": [
|
|
14
|
+
0,
|
|
15
|
+
117,
|
|
16
|
+
0
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Slot coupon",
|
|
3
|
+
"kind": "fit",
|
|
4
|
+
"description": "The slot coupon on its own: write each result back with cad measured <rule>=<value> (MEASURE.md, rows 29 to 33), and cad history keeps it against what the kit drew before.",
|
|
5
|
+
"items": [
|
|
6
|
+
{
|
|
7
|
+
"id": "coupon",
|
|
8
|
+
"object": "slot-coupon"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// The fixings coupon: every hole a screw, a nut or an insert needs, at sizes either side of the one the kit draws, so
|
|
2
|
+
// one print settles them for this printer and plastic. Each feature stands in its own boss on a thin base, and every
|
|
3
|
+
// hole ends above the base (the nut slots' screws come in from an edge, lying down, with a teardrop's roof), so the
|
|
4
|
+
// first layer is one plain rectangle and nothing needs a support. Each row is named on the left, and each feature
|
|
5
|
+
// carries the figure to write back (MEASURE.md, rows 22 to 28).
|
|
6
|
+
// Every size comes from v.fixings; each row steps by the printer's hole compensation either side of it.
|
|
7
|
+
import jscad from '@jscad/modeling'
|
|
8
|
+
const { cylinder, cylinderElliptic, roundedRectangle, circle } = jscad.primitives
|
|
9
|
+
const { extrudeLinear } = jscad.extrusions
|
|
10
|
+
const { translate } = jscad.transforms
|
|
11
|
+
const { hull } = jscad.hulls
|
|
12
|
+
const { offset } = jscad.expansions
|
|
13
|
+
const { measureBoundingBox } = jscad.measurements
|
|
14
|
+
|
|
15
|
+
export function main (v) {
|
|
16
|
+
const f = v.fixings, base = v.base, wall = v.wall, step = v.step, seg = v.segments
|
|
17
|
+
const fig = (x) => String(Number(x.toFixed(2))) // a figure as it is labelled and written back
|
|
18
|
+
const around = (centre, n) => Array.from({ length: n }, (_, i) => centre + (i - (n - 1) / 2) * step)
|
|
19
|
+
const width = (text) => { const [lo, hi] = measureBoundingBox(v.shapes.text({ text, height: v.label, stroke: v.stroke })); return hi[0] - lo[0] }
|
|
20
|
+
const say = (text, x, y, z) => translate([x, y, z], extrudeLinear({ height: v.emboss }, v.shapes.text({ text, height: v.label, stroke: v.stroke })))
|
|
21
|
+
// A plain round hole going down from the top, with the lead-in the kit gives a blind hole, its cutter past the top
|
|
22
|
+
const bore = (d, depth, lead, x, y, top) => v.ops.union(
|
|
23
|
+
translate([x, y, top - depth / 2 + 1 / 2], cylinder({ radius: d / 2, height: depth + 1, segments: seg })),
|
|
24
|
+
translate([x, y, top - lead / 2], cylinderElliptic({ height: lead, startRadius: [d / 2, d / 2], endRadius: [d / 2 + lead, d / 2 + lead], segments: seg })))
|
|
25
|
+
// What a feature stands in, its outline rising from the bed to its top, flared at 45° where it meets the base
|
|
26
|
+
const stand = (outline, top) => v.ops.union(extrudeLinear({ height: top }, outline),
|
|
27
|
+
hull(extrudeLinear({ height: base }, offset({ delta: v.root, corners: 'round', segments: seg }, outline)), extrudeLinear({ height: base + v.root }, outline)))
|
|
28
|
+
|
|
29
|
+
// ---------- the features, each { label, across (its footprint, along the row), deep (across it), top, make(x, y) } ----------
|
|
30
|
+
const round = (across, top, cut) => ({ across, deep: across, top, make: (x, y) => ({ solid: stand(circle({ radius: across / 2, center: [x, y], segments: seg }), top), cut: cut(x, y) }) })
|
|
31
|
+
const pilots = (t) => {
|
|
32
|
+
const h = f.holeModel(t, { kind: 'pilot' }), sizes = around(h.diameter, v.pilots)
|
|
33
|
+
return { name: t, items: sizes.map((d) => ({ label: fig(d), ...round(Math.max(...sizes) + 2 * wall, base + h.depth, (x, y) => bore(d, h.depth, h.lead, x, y, base + h.depth)) })) }
|
|
34
|
+
}
|
|
35
|
+
const inserts = (t) => {
|
|
36
|
+
const h = f.holeModel(t, { kind: 'insert' }), sizes = around(h.diameter, v.fits), least = f.fixingModel(t).figures.insert_wall.value
|
|
37
|
+
return { name: `I${t}`, items: sizes.map((d) => ({ label: fig(d), ...round(Math.max(...sizes) + 2 * Math.max(wall, least), base + h.depth, (x, y) => bore(d, h.depth, h.lead, x, y, base + h.depth)) })) }
|
|
38
|
+
}
|
|
39
|
+
// A nut pocket from the top over the screw's clearance hole, as deep again below it so the screw's end passes the nut
|
|
40
|
+
const pockets = (t) => {
|
|
41
|
+
const p = f.nutPocketModel(t), fits = around(p.clearance, v.fits), corner = f.nutPocketModel(t, { fit: Math.max(...fits) }).corner, top = base + 2 * p.depth
|
|
42
|
+
return { name: `N${t}`, items: fits.map((fit) => ({ label: fig(fit), ...round(corner + 2 * wall, top, (x, y) => v.ops.union(f.nutPocket(t, { fit, at: [x, y, top], into: '-z' }), f.hole(t, { depth: top - base, through: false, at: [x, y, top] }))) })) }
|
|
43
|
+
}
|
|
44
|
+
// A cap head's counterbore over its clearance hole, then a pilot: a screw as long as the two seats its head
|
|
45
|
+
const counterbore = (t) => {
|
|
46
|
+
const c = f.counterboreModel(t), p = f.holeModel(t, { kind: 'pilot' }), length = 2 * c.depth, top = base + p.depth + length
|
|
47
|
+
return { name: `C${t}`, items: [{ label: fig(c.diameter), ...round(c.diameter + 2 * wall, top, (x, y) => v.ops.union(f.counterbore(t, { length, at: [x, y, top], into: '-z' }), f.hole(t, { kind: 'pilot', at: [x, y, top - length] }))) }] }
|
|
48
|
+
}
|
|
49
|
+
// A nut slot the nut drops into from the top, across a screw lying along y: the screw comes in through the coupon's
|
|
50
|
+
// back edge, through the nut, and on into the block for its end
|
|
51
|
+
const traps = (t) => {
|
|
52
|
+
const m = f.nutTrapModel(t, { depth: 1, axis: 'y', into: '-z' }), fits = around(m.clearance, v.fits), widest = f.nutTrapModel(t, { depth: 1, axis: 'y', into: '-z', fit: Math.max(...fits) })
|
|
53
|
+
const half = widest.reach - 1, depth = half + wall, axisZ = base + wall + half, top = axisZ + depth, deep = 2 * (wall + m.gap), across = widest.width + 2 * wall
|
|
54
|
+
return { name: `T${t}`, edge: true, items: fits.map((fit) => ({ label: fig(fit), across, deep, top, make: (x, y) => {
|
|
55
|
+
const face = y + deep / 2, slot = face - wall - m.gap / 2 // y is the block's middle; its open face is on the back edge
|
|
56
|
+
return { solid: stand(roundedRectangle({ size: [across, deep], center: [x, y], roundRadius: wall / 2, segments: seg }), top),
|
|
57
|
+
cut: v.ops.union(f.nutTrap(t, { fit, depth, axis: 'y', into: '-z', at: [x, slot, top] }), f.hole(t, { depth: deep - wall, through: false, at: [x, face, axisZ], into: '-y' })) }
|
|
58
|
+
} })) }
|
|
59
|
+
}
|
|
60
|
+
// A printed thread for a bought screw, at three gaps, in the form its flanks are drawn
|
|
61
|
+
const threads = (t, flanks) => {
|
|
62
|
+
const gaps = around(f.holeModel(t, { kind: 'thread', mate: 'bought', flanks }).threaded.clearance, v.fits)
|
|
63
|
+
const made = gaps.map((gap) => f.holeModel(t, { kind: 'thread', mate: 'bought', gap, flanks })), across = Math.max(...made.map((h) => h.diameter)) + 2 * wall
|
|
64
|
+
return { name: `${t}${flanks === 'standard' ? 'S' : 'P'}`, items: gaps.map((gap, i) => ({ label: fig(gap), ...round(across, base + made[i].depth, (x, y) => f.hole(t, { kind: 'thread', mate: 'bought', gap, flanks, at: [x, y, base + made[i].depth] })) })) }
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// ---------- the rows, front to back ----------
|
|
68
|
+
const rows = [[pockets('M3'), pockets('M4')], [pilots('M2'), pilots('M2.5')], [pilots('M3'), inserts('M2')], [pilots('M4'), inserts('M3')], [pilots('M5'), counterbore('M3')],
|
|
69
|
+
[threads('M6', 'printed'), threads('M10', 'printed')], [threads('M8', 'printed'), threads('M8', 'standard')], [traps('M3'), traps('M4')]]
|
|
70
|
+
const solids = [], cuts = [], labels = []
|
|
71
|
+
let y = v.gap, length = 0
|
|
72
|
+
for (const row of rows) {
|
|
73
|
+
const deep = Math.max(...row.flatMap((g) => g.items.map((it) => it.deep))), line = y + v.label / 2, mid = y + v.label + v.gap + deep / 2
|
|
74
|
+
let x = v.gap
|
|
75
|
+
for (const g of row) {
|
|
76
|
+
const nameWidth = width(g.name)
|
|
77
|
+
labels.push(say(g.name, x + nameWidth / 2, mid, base)); x += nameWidth + v.gap
|
|
78
|
+
for (const it of g.items) {
|
|
79
|
+
const pitch = Math.max(it.across, width(it.label) + v.gap), cx = x + pitch / 2, cy = g.edge ? mid + deep / 2 - it.deep / 2 : mid, m = it.make(cx, cy)
|
|
80
|
+
solids.push(m.solid); cuts.push(m.cut); labels.push(say(it.label, cx, line, base)); x += pitch + v.gap
|
|
81
|
+
}
|
|
82
|
+
x += v.gap
|
|
83
|
+
}
|
|
84
|
+
length = Math.max(length, x); y += deep + v.label + v.gap * 2
|
|
85
|
+
}
|
|
86
|
+
const plate = extrudeLinear({ height: base }, roundedRectangle({ size: [length, y], center: [length / 2, y / 2], roundRadius: v.corner, segments: seg }))
|
|
87
|
+
return v.ops.union(v.ops.subtract(v.ops.union(plate, ...solids), ...cuts), ...labels)
|
|
88
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://jonibach.github.io/rulecad/schemas/object.schema.json",
|
|
3
|
+
"name": "fixings-coupon",
|
|
4
|
+
"title": "Fixings coupon",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"uses": [
|
|
7
|
+
"x1c"
|
|
8
|
+
],
|
|
9
|
+
"engine": "manifold",
|
|
10
|
+
"orientation": "Flat on the bed, every hole opening upward: the base is the first layer",
|
|
11
|
+
"description": "Pilots for M2 to M5 at five sizes, heat-set insert holes for M2 and M3, hex nut pockets and side slots for M3 and M4 at three fits, an M3 counterbore, and printed M6, M8 and M10 threads at three gaps, M8 in both flank forms. Each figure is the one to write back with cad measured (MEASURE.md, rows 22 to 28). Print once per printer and plastic.",
|
|
12
|
+
"variables": {
|
|
13
|
+
"base": { "value": "x1c.layer * 6", "unit": "mm", "rule": "The base every feature stands on: six layers, the floor under every blind hole, and a first layer that is one plain rectangle" },
|
|
14
|
+
"wall": { "value": "x1c.wall_min * 2", "unit": "mm", "rule": "Plastic round every hole, pocket and slot: four print lines, as a design gives a boss" },
|
|
15
|
+
"gap": { "value": "x1c.wall_min", "unit": "mm", "rule": "Between features, between a feature and its figure, and round the edge" },
|
|
16
|
+
"root": { "value": "x1c.chamfer", "unit": "mm", "rule": "The 45° flare where each boss meets the base, so no inside corner is square" },
|
|
17
|
+
"step": { "value": "x1c.hole_comp", "unit": "mm", "rule": "Each row steps by the printer's hole compensation either side of what the kit draws: the amount a printed hole comes out wrong by" },
|
|
18
|
+
"pilots": { "value": 5, "rule": "Five pilots for each thread: the kit's figure and two steps either side" },
|
|
19
|
+
"fits": { "value": 3, "rule": "Three of every other feature: the kit's figure and a step either side" },
|
|
20
|
+
"label": { "value": 2.5, "unit": "mm", "rule": "Figure height: six print lines tall, readable close up, and small enough that a figure is no wider than its feature" },
|
|
21
|
+
"stroke": { "value": "x1c.line", "unit": "mm", "rule": "One print line, for the figures" },
|
|
22
|
+
"emboss": { "value": "x1c.layer * 2", "unit": "mm", "rule": "Two layers proud" },
|
|
23
|
+
"corner": { "value": 3, "unit": "mm", "rule": "The base's corners, rounded so they stay down" },
|
|
24
|
+
"segments": { "value": 48, "rule": "Facets on round holes and bosses" }
|
|
25
|
+
}
|
|
26
|
+
}
|