@rulecad/cad 0.7.48 → 0.7.55

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rulecad/cad",
3
- "version": "0.7.48",
3
+ "version": "0.7.55",
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": {
@@ -64,7 +64,7 @@
64
64
  "@rulecad/model-link": "^0.3.2",
65
65
  "@rulecad/versions": "^0.1.6",
66
66
  "@rulecad/shapes": "^0.4.4",
67
- "@rulecad/rules": "^0.3.10",
67
+ "@rulecad/rules": "^0.3.14",
68
68
  "@jscad/modeling": "^2.12.0",
69
69
  "three": "^0.186.1",
70
70
  "@rulecad/fea": "^0.2.1",
@@ -72,7 +72,9 @@
72
72
  "@rulecad/flexures": "^0.5.0",
73
73
  "@rulecad/gears": "^0.3.2",
74
74
  "@rulecad/motors": "^0.1.4",
75
- "@rulecad/robots": "^0.1.1"
75
+ "@rulecad/fixings": "^0.1.3",
76
+ "@rulecad/robots": "^0.1.1",
77
+ "@rulecad/frames": "^0.1.7"
76
78
  },
77
79
  "peerDependencies": {
78
80
  "@rulecad/pcb": "^0.1.0 || ^0.2.0 || ^0.3.0 || ^0.4.0 || ^0.5.0"
@@ -17,6 +17,7 @@
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
+ "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, and lines their holes up as a holes fit does", "items": { "$ref": "#/$defs/fasten" } },
20
21
  "joints": { "type": "array", "items": { "$ref": "#/$defs/joint" } },
21
22
  "loops": { "type": "array", "items": { "$ref": "#/$defs/loop" } },
22
23
  "planetary": { "type": "array", "items": { "$ref": "#/$defs/planetary" } },
@@ -46,10 +47,13 @@
46
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" },
47
48
  "variant": { "type": "string" },
48
49
  "set": { "type": "object" },
49
- "at": { "$ref": "#/$defs/vec3" },
50
+ "beam": { "type": "object", "required": ["profile"], "additionalProperties": false, "description": "A length of a profile from @rulecad/frames: bought and cut to length, faint in previews; 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": { "type": "boolean", "description": "A printed beam (a later release): a bought one is false, the default" }, "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
+ "at": { "anyOf": [{ "$ref": "#/$defs/vec3" }, { "$ref": "#/$defs/address" }] },
50
52
  "rotate": { "$ref": "#/$defs/vec3" },
53
+ "to": { "$ref": "#/$defs/vec3", "description": "A beam's end b, with from its end a" },
54
+ "roll": { "$ref": "#/$defs/expr", "description": "Degrees a beam placed by its ends turns about its own axis, a toward b; at 0 its top faces up (+z), or +y when it stands upright" },
51
55
  "place": {},
52
- "from": {},
56
+ "from": { "description": "For a beam: its end a, [x, y, z]. For an object: inputs worked out from items built before it, { input: expression }" },
53
57
  "repeat": {
54
58
  "type": "object",
55
59
  "additionalProperties": false,
@@ -94,6 +98,41 @@
94
98
  "within": { "$ref": "#/$defs/expr", "description": "With an anchor name (item@anchor): only faces this close to it (mm, default 10)" }
95
99
  }
96
100
  },
101
+ "beamAddress": { "type": "string", "pattern": "^([ab](\\.\\d+)?|(top|bottom|front|back)(\\.\\d+)?(@-?\\d+(\\.\\d+)?%?)?)$", "description": "An address on a beam, without its item: an end (a, b), an end's bore (a.1), or a face's place with a distance from end a (top@120), from end b (top@-20) or a share of the length (top@50%), the second place of a face top.2@120" },
102
+ "beamOp": { "type": "object", "required": ["op", "at"], "additionalProperties": false, "description": "An operation on a beam (@rulecad/frames OPS): each takes only its own keys, and is refused by name otherwise", "properties": {
103
+ "op": { "enum": ["cut", "mitre", "tap", "access", "drill", "counterbore", "pocket", "notch", "deburr"], "description": "cut: square to length; mitre: an end at an angle about a named face; tap: a thread in an end bore; access: a hole across, in line with a slot, for a key; drill: through one wall or right through, plain or tapped; counterbore: a seat for a head; pocket: milled by outline; notch: a slot's lips cut away; deburr: named so the sheet asks for it" },
104
+ "at": { "$ref": "#/$defs/beamAddress" },
105
+ "thread": { "type": "string", "description": "A thread by name (M5): sizes the hole, the tap or the seat through @rulecad/fixings" },
106
+ "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" },
108
+ "diameter": { "$ref": "#/$defs/expr", "description": "mm, in place of a thread's figure" },
109
+ "depth": { "$ref": "#/$defs/expr", "description": "mm from the face or the end" },
110
+ "through": { "enum": ["wall", "beam"], "description": "A drilled hole through one wall (the default) or right through the beam" },
111
+ "angle": { "$ref": "#/$defs/expr", "description": "A mitre's angle from square, degrees" },
112
+ "about": { "enum": ["top", "bottom", "front", "back"], "description": "The face a mitre's angle is seen on" },
113
+ "long": { "enum": ["top", "bottom", "front", "back"], "description": "The side a mitred beam's length is measured on" },
114
+ "size": { "type": "array", "items": { "$ref": "#/$defs/expr" }, "minItems": 2, "maxItems": 2, "description": "A pocket's [along, across], mm" },
115
+ "outline": { "type": "array", "items": { "type": "array", "items": { "type": "number" }, "minItems": 2, "maxItems": 2 }, "minItems": 3, "description": "A pocket's outline, points [along, across] about the address" },
116
+ "radius": { "$ref": "#/$defs/expr", "description": "A pocket's corner radius, mm" },
117
+ "length": { "$ref": "#/$defs/expr", "description": "A notch's length along the beam, mm" } } },
118
+ "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" },
119
+ "fasten": {
120
+ "type": "object",
121
+ "required": ["screw", "through", "into"],
122
+ "additionalProperties": false,
123
+ "properties": {
124
+ "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" },
125
+ "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" },
126
+ "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" },
127
+ "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" },
128
+ "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)" },
129
+ "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" },
130
+ "washer": { "type": "boolean", "description": "A plain washer under the head" },
131
+ "length": { "$ref": "#/$defs/expr", "description": "The screw's length in mm, where the name gives none: checked for reaching, bottoming out and standing proud" },
132
+ "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)" },
133
+ "note": { "type": "string" }
134
+ }
135
+ },
97
136
  "anchorRef": {
98
137
  "anyOf": [
99
138
  { "type": "string", "description": "item.anchor" },
@@ -0,0 +1,24 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://jonibach.github.io/rulecad/schemas/outline.schema.json",
4
+ "title": "rulecad section outline",
5
+ "description": "A profile's measured section as closed loops, kept beside its rule set as rules/outlines/<set name>.json. The outside of the metal and each hole are loops of [x, y] points in mm, x across and y up, with the middle of the section's envelope at the origin. It says what it was measured from and under what licence: the kit draws its own outlines, so a maker's model is measured in your own workspace and its shape is never copied into the kit.",
6
+ "type": "object",
7
+ "required": ["source", "licence", "loops"],
8
+ "additionalProperties": false,
9
+ "properties": {
10
+ "$schema": { "type": "string" },
11
+ "_doc": { "type": "string" },
12
+ "name": { "type": "string", "description": "The rule set it belongs to" },
13
+ "unit": { "type": "string", "enum": ["mm"], "description": "Always mm" },
14
+ "source": { "type": "string", "description": "What it was measured from: a model's file and where that came from, or a bar and how it was measured" },
15
+ "licence": { "type": "string", "description": "The terms the source came with" },
16
+ "checked": { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$", "description": "The date it was measured, YYYY-MM-DD" },
17
+ "loops": {
18
+ "type": "array",
19
+ "minItems": 1,
20
+ "description": "Closed loops, the last point joining the first. Either way round: a loop inside an odd number of others is a hole",
21
+ "items": { "type": "array", "minItems": 3, "items": { "type": "array", "minItems": 2, "maxItems": 2, "items": { "type": "number" } } }
22
+ }
23
+ }
24
+ }