@rulecad/cad 0.7.53 → 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.53",
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.12",
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",
@@ -73,7 +73,8 @@
73
73
  "@rulecad/gears": "^0.3.2",
74
74
  "@rulecad/motors": "^0.1.4",
75
75
  "@rulecad/fixings": "^0.1.3",
76
- "@rulecad/robots": "^0.1.1"
76
+ "@rulecad/robots": "^0.1.1",
77
+ "@rulecad/frames": "^0.1.7"
77
78
  },
78
79
  "peerDependencies": {
79
80
  "@rulecad/pcb": "^0.1.0 || ^0.2.0 || ^0.3.0 || ^0.4.0 || ^0.5.0"
@@ -47,10 +47,13 @@
47
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" },
48
48
  "variant": { "type": "string" },
49
49
  "set": { "type": "object" },
50
- "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" }] },
51
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" },
52
55
  "place": {},
53
- "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 }" },
54
57
  "repeat": {
55
58
  "type": "object",
56
59
  "additionalProperties": false,
@@ -95,6 +98,24 @@
95
98
  "within": { "$ref": "#/$defs/expr", "description": "With an anchor name (item@anchor): only faces this close to it (mm, default 10)" }
96
99
  }
97
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" },
98
119
  "fasten": {
99
120
  "type": "object",
100
121
  "required": ["screw", "through", "into"],
@@ -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
+ }