create-rulecad 0.3.3 → 0.3.5
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
package/template/AGENTS.md
CHANGED
|
@@ -29,7 +29,11 @@ variable says which rule it comes from. Follow these steps; they're what makes a
|
|
|
29
29
|
## Changing a design
|
|
30
30
|
1. `npx cad history <project>/<object>` first: read the print log. A failed print is the reason for most changes:
|
|
31
31
|
fix the rule or variable it points at (a measured fit beats a community rule).
|
|
32
|
-
2. Change, then check, preview and look, as for a new part.
|
|
32
|
+
2. Change, then check, preview and look, as for a new part. Change values with `npx cad set <project>/<object>
|
|
33
|
+
name=value` and assemblies with `npx cad add fit|joint|item|pose …`: they keep the file's layout and refuse an edit
|
|
34
|
+
that breaks it. `npx cad values` lists an object's numbers; `npx cad why <project>/<object>.<name>` shows what a
|
|
35
|
+
value depends on, down to the rules (estimates marked). `--json` on check, values and why gives data to act on:
|
|
36
|
+
each finding has a code, its numbers and where it is.
|
|
33
37
|
3. `npx cad release <project>/<object> -m "what changed, for the person" --dry-run` shows the bump and why. If it's
|
|
34
38
|
major, tell the person which interface values changed: earlier prints may no longer fit.
|
|
35
39
|
4. Release only when the person agrees. Don't use `--force` without asking.
|
|
@@ -40,6 +44,10 @@ variable says which rule it comes from. Follow these steps; they're what makes a
|
|
|
40
44
|
- Holes and slots get the printer's hole compensation; parts that slide together get its fit clearance. Chamfer
|
|
41
45
|
bottom edges.
|
|
42
46
|
- An overhang warning means supports: say so in `orientation`, or change the shape or orientation.
|
|
47
|
+
- Use the print-aware features in `v.shapes` before drawing your own: `countersink`, `teardropHole`, `nutPocket`,
|
|
48
|
+
`crushRibs`, `wallOpening` print without supports as drawn. Use `v.ops.union/subtract/intersect` for booleans: the
|
|
49
|
+
workspace can switch them to Manifold (faster, watertight) without touching the design.
|
|
50
|
+
- Designs run sandboxed: they may import only `@jscad/modeling`, `@rulecad/shapes` and files in their project.
|
|
43
51
|
- Something printed under the part and removed afterwards is a named `support` part (`return { cap, pillar }`, both
|
|
44
52
|
described in the .json's `parts`), not part of the shape. Look at `cad preview --explode` too.
|
|
45
53
|
|
|
@@ -72,6 +80,15 @@ variable says which rule it comes from. Follow these steps; they're what makes a
|
|
|
72
80
|
- Join pins with `nets` (`GND: ['U1.GND', 'J1.GND']`) and let the autorouter draw them; `cad check` runs the fab's
|
|
73
81
|
design rules. Look at the copper preview: connectors should face the edge their plug comes from.
|
|
74
82
|
|
|
83
|
+
## Optimised parts
|
|
84
|
+
- For a flat part that carries load (a lever, a bracket, a pedal arm), describe it as a problem in `problems/`: the
|
|
85
|
+
space it may fill, the bosses to keep, the holes to avoid, the supports and loads (in newtons, each in a case), the
|
|
86
|
+
material's rule set. `npx cad optimise <project>/<problem>` and **look at the picture** in `.preview/`.
|
|
87
|
+
- A design reads the result through a `problem` variable and builds it with `v.shapes.optimisedOutline(...)`. Add an
|
|
88
|
+
`analysis` to the object so `cad check` reports its stiffness; report those numbers with their load and material.
|
|
89
|
+
- Say plainly that the analysis is coarse and the material values are data-sheet figures: anything that could hurt
|
|
90
|
+
someone if it broke needs testing, not just a check.
|
|
91
|
+
|
|
75
92
|
## Talking to the person
|
|
76
93
|
- Give links as one labelled line (`npx cad link <project>/<object> --md`), never a raw URL. If it says
|
|
77
94
|
"(not a release)", say so. If it says the link is too long for chat, don't paste it: tell the person, and offer
|
|
@@ -1,20 +1,86 @@
|
|
|
1
1
|
{
|
|
2
|
+
"$schema": "https://jonibach.github.io/rulecad/schemas/object.schema.json",
|
|
2
3
|
"name": "soap-tray",
|
|
3
4
|
"title": "Soap tray",
|
|
4
5
|
"version": "0.1.0",
|
|
5
|
-
"uses": [
|
|
6
|
+
"uses": [
|
|
7
|
+
"x1c"
|
|
8
|
+
],
|
|
6
9
|
"material": "PLA",
|
|
7
10
|
"orientation": "Flat side down on the bed. Walls are straight up, so it prints without supports.",
|
|
8
11
|
"variables": {
|
|
9
|
-
"length": {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
"length": {
|
|
13
|
+
"value": 110,
|
|
14
|
+
"unit": "mm",
|
|
15
|
+
"rule": "Long enough for a bar of soap",
|
|
16
|
+
"label": "Length",
|
|
17
|
+
"show": true,
|
|
18
|
+
"tweak": {
|
|
19
|
+
"min": 70,
|
|
20
|
+
"max": 180
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"width": {
|
|
24
|
+
"value": 75,
|
|
25
|
+
"unit": "mm",
|
|
26
|
+
"rule": "Wide enough for a bar of soap",
|
|
27
|
+
"label": "Width",
|
|
28
|
+
"show": true,
|
|
29
|
+
"tweak": {
|
|
30
|
+
"min": 50,
|
|
31
|
+
"max": 120
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"height": {
|
|
35
|
+
"value": "x1c.layer * 60",
|
|
36
|
+
"unit": "mm",
|
|
37
|
+
"rule": "A whole number of layers",
|
|
38
|
+
"label": "Height",
|
|
39
|
+
"show": true
|
|
40
|
+
},
|
|
41
|
+
"wall": {
|
|
42
|
+
"value": "x1c.line * 4",
|
|
43
|
+
"unit": "mm",
|
|
44
|
+
"rule": "Four print lines: stiff, and no gaps between lines",
|
|
45
|
+
"label": "Wall"
|
|
46
|
+
},
|
|
47
|
+
"floor": {
|
|
48
|
+
"value": "x1c.layer * 8",
|
|
49
|
+
"unit": "mm",
|
|
50
|
+
"rule": "Eight layers under the ribs"
|
|
51
|
+
},
|
|
52
|
+
"rib_height": {
|
|
53
|
+
"value": "x1c.layer * 15",
|
|
54
|
+
"unit": "mm",
|
|
55
|
+
"rule": "Holds the soap up out of the water",
|
|
56
|
+
"label": "Rib height",
|
|
57
|
+
"show": true
|
|
58
|
+
},
|
|
59
|
+
"rib_width": {
|
|
60
|
+
"value": "x1c.line * 4",
|
|
61
|
+
"unit": "mm",
|
|
62
|
+
"rule": "Four print lines"
|
|
63
|
+
},
|
|
64
|
+
"pitch": {
|
|
65
|
+
"value": 12,
|
|
66
|
+
"unit": "mm",
|
|
67
|
+
"rule": "Ribs this far apart: soap rests on several, water runs between",
|
|
68
|
+
"label": "Rib spacing",
|
|
69
|
+
"show": true,
|
|
70
|
+
"tweak": {
|
|
71
|
+
"min": 8,
|
|
72
|
+
"max": 20
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"slot": {
|
|
76
|
+
"value": "3 + x1c.hole_comp",
|
|
77
|
+
"unit": "mm",
|
|
78
|
+
"rule": "Drain slots between the ribs, widened for how holes print small"
|
|
79
|
+
},
|
|
80
|
+
"margin": {
|
|
81
|
+
"value": 6,
|
|
82
|
+
"unit": "mm",
|
|
83
|
+
"rule": "Solid floor between the slots and the walls"
|
|
84
|
+
}
|
|
19
85
|
}
|
|
20
86
|
}
|