Skip to content

armgit / SOMA

Public Imported from GitHub
0

Desktop app for designing parametric 3D models in CadQuery together with the coding agent of your choice

Skills und Vorlage: eine Regel für Maße, Normteile bewegen, Hinweise zu Analyse und Prüfung (E64)

Kai-Jungsthoefel96910945d1d3
diff --git a/app/resources/skills/3d-druck.md b/app/resources/skills/3d-druck.md
index 53b94b2..6518366 100644
--- a/app/resources/skills/3d-druck.md
+++ b/app/resources/skills/3d-druck.md
@@ -34,7 +34,7 @@ in the chat or in `NOTES.md`:
| Minimum wall | {{min_wall}} mm |
| Clearance per side for sliding fits | {{clearance}} mm |
-Constants at the top of `model.py`: `NOZZLE = {{nozzle}}`, `CLEARANCE = {{clearance}}`, `MAX_OVERHANG = {{overhang}}`,
+Constants at the top of `model.py` (or in `parts/params.py`): `NOZZLE = {{nozzle}}`, `CLEARANCE = {{clearance}}`, `MAX_OVERHANG = {{overhang}}`,
`BED = ({{bed_x}}, {{bed_y}}, {{bed_z}})`.
## Walls and small features
diff --git a/app/resources/skills/analyse.md b/app/resources/skills/analyse.md
index 0429ac2..2e89246 100644
--- a/app/resources/skills/analyse.md
+++ b/app/resources/skills/analyse.md
@@ -20,13 +20,17 @@ topics: Auswertungen; Ablauf; Grenzen; Rückmeldung
| `soma analyze clearance` | gap in front of the surface to the next other part, negative inside another part | below 0.5 mm |
Options: `--threshold` (take it from the active skills: overhang, minimum wall, clearance, and say so), `--parts
-"Lid,Housing"` (names or groups, default all own parts without references and purchased parts), `--up z` for the
-print direction of overhangs, `--name` to keep a second result of the same kind. Parts that touch (gap 0) are not
-critical, overlaps are.
+"Lid,Housing"` (names or groups, default all own parts without references and purchased parts; a part name wins over a
+group of the same name, `"Housing/"` is always the group), `--up z` for the print direction of overhangs, `--name` to
+keep a second result of the same kind. Parts that touch (gap 0) are not critical, overlaps are. Values within the mesh
+accuracy of the threshold count as exactly at the threshold, not critical (a 45° roof, a gap of exactly 0.2 mm).
## Workflow
-1. `soma build`, then the analysis. Read the summary: range per part, critical area, worst value and where.
+1. `soma build`, then the analysis. Read the summary: range per part, critical area, worst value and where, then the
+ largest critical spots with area, size and position (similar spots such as gear teeth as one line). For overhang
+ it names a print direction with clearly less overhang if there is one; parts printed in different orientations
+ need one run each (`--parts`, `--up`, `--name`).
2. `soma render --result thickness` (add `--view bottom` for another side) and open the picture: colours green (fine),
yellow (close to the threshold), red (critical), legend at the bottom right.
3. Change the model, build, analyse again. Report numbers: "thinnest wall 1.4 mm (was 0.8 mm)".
@@ -35,6 +39,7 @@ critical, overlaps are.
- One value per small triangle. Curved faces carry the mesh tolerance, a few hundredths of a millimetre.
- Thickness at sharp inner corners and on tiny features can be off. Check a suspicious spot before you change it.
+ Narrow strips along sharp edges (tooth tips, the rim of a countersink) are thin by nature: judge them by their size.
- Clearance is measured along the surface normal: a gap at an angle (a cone in a hole) reads larger than it is.
- Overhang looks at the direction of the surface only. Bridges and small chamfers show as overhang, judge them with
the skill for the process.
diff --git a/app/resources/skills/animation.md b/app/resources/skills/animation.md
index 29f8cca..0754f5c 100644
--- a/app/resources/skills/animation.md
+++ b/app/resources/skills/animation.md
@@ -57,7 +57,9 @@ Captions: one short sentence in the language the user speaks, about what moves a
1. `soma anim build` (the app also builds when the file changes). Errors name file and line.
2. `soma anim info "Open the lid"`: the timeline as text. Read it.
3. `soma anim check "Open the lid" --gap 0.5`: parts that collide or come closer than the gap during the motion. Fix
- collisions in the model or in the motion. Contacts that already exist in the model position are marked.
+ collisions in the model or in the motion. Contacts and gaps as built in the model count as intended, only what
+ gets worse during the motion is reported. A motion built from many short `play()` steps (a coupled mechanism)
+ is fine: approximate a curve with steps of a few degrees, too coarse steps show up as small collisions.
4. `soma render --anim "Open the lid" --sheet`: one picture with 9 stills and their times, `--at 1.5` for one moment.
Open the picture and look at it.
5. Only when the user wants a video: `soma render --anim "Open the lid" --video` writes `renders/<id>.mp4`
diff --git a/app/resources/skills/cadquery.md b/app/resources/skills/cadquery.md
index ca2fc95..abb35de 100644
--- a/app/resources/skills/cadquery.md
+++ b/app/resources/skills/cadquery.md
@@ -12,10 +12,11 @@ topics: Parameter und Aufbau; Reihenfolge der Schritte; Selektoren; Typische Feh
## Parameters and structure
-- Base dimensions are named constants at the top, everything else is derived (`INNER_W = WIDTH - 2 * WALL`). Never
- type the same number twice.
+- Base dimensions are named constants at the top of `model.py`, everything else is derived (`INNER_W = WIDTH - 2 *
+ WALL`). Never type the same number twice.
- One function per part (`def make_lid(): ... return lid`), the `add_part` calls at the end of `model.py`. Move parts
- into `parts/` when `model.py` grows beyond about 200 lines.
+ into `parts/` when `model.py` grows beyond about 200 lines. The constants then move to `parts/params.py`, imported
+ by `model.py` and the part modules.
- Build each part around a sensible origin (mounting face on XY, symmetric parts centered), then place it with
`.translate()` and `.rotate()`.
diff --git a/app/resources/skills/normteile.md b/app/resources/skills/normteile.md
index 0a3a556..7a20047 100644
--- a/app/resources/skills/normteile.md
+++ b/app/resources/skills/normteile.md
@@ -31,6 +31,8 @@ add_part("Screw 1", s, group="Hardware") # role "hardware" automat
- Position: `at` is the point on the axis where the part rests, `direction` (default `"-Z"`) points from there into
the material. With `at=(x, y), on=lid` the surface is found along `direction`. `sunk=True` sinks a head, nut or
washer flush with `at` (the hole gets the counterbore). Countersunk screws, set screws and inserts always sit flush.
+- Moving: `s.rotate(p1, p2, angle)`, `s.translate((x, y, z))` and `s.moved(loc)` return a moved copy, like CadQuery
+ shapes. Build a moving part with its screws in one place, then move both the same way.
- Other end: `s.point(d)` is the point `d` mm from the seat along the axis, `.outer` the opposite face. Under a plate
of thickness `T`: `w = Washer("ISO 7089", "M3", at=s.point(T), direction="+Z")`, then
`Nut("ISO 4032", "M3", at=w.outer, direction="+Z")`.
diff --git a/app/resources/skills/toleranzen.md b/app/resources/skills/toleranzen.md
index 962efb0..51561f0 100644
--- a/app/resources/skills/toleranzen.md
+++ b/app/resources/skills/toleranzen.md
@@ -20,8 +20,8 @@ Every real part deviates from its nominal size. Design so that parts still fit w
- Manufacturing process from the app: **{{process}}**. If it is "unknown" and `NOTES.md` does not say how the parts
are made, ask: the clearances depend on it. The skill for the process (if you follow one) has more specific values,
they take precedence over this one.
-- Every clearance, fit and allowance is a named constant at the top of `model.py` (`SCREW_CLEARANCE`, `LID_GAP`), never
- hidden in expressions.
+- Every clearance, fit and allowance is a named constant at the top of `model.py` or in `parts/params.py`
+ (`SCREW_CLEARANCE`, `LID_GAP`), never hidden in expressions.
- Mating faces never share the exact same coordinate: a defined gap, or a defined overlap for a press fit.
- Parts that must not touch keep at least {{min_gap}} mm distance (`MIN_GAP = {{min_gap}}`).
- Dimension from the functional faces: a hole follows the part it has to meet, not an arbitrary outer edge.
diff --git a/app/resources/template/AGENTS.md b/app/resources/template/AGENTS.md
index 4f42b67..7911960 100644
--- a/app/resources/template/AGENTS.md
+++ b/app/resources/template/AGENTS.md
@@ -24,7 +24,7 @@ The app shows the result in a 3D viewer next to this terminal. Notes and wishes
3. Names are unique. Umlauts are fine, they are shown as written.
4. Group related parts with `group`: `add_part("Screw front", screw, group="Housing/Screws")` (nested with `/`). Groups show up in the part tree of the app and as sub-assemblies in `output/model.step`.
5. Mark a part the user brought (for example a circuit board) with `role="reference"`: it is shown semi-transparent and skipped by `soma export --all`. Cut clearances around it, but do not export it.
-6. Units are millimetres, Z is up. Put dimensions in named constants at the top so the user can ask for changes ("make the wall 3 mm").
+6. Units are millimetres, Z is up. Put dimensions in named constants at the top of `model.py` so the user can ask for changes ("make the wall 3 mm"). Once parts live in `parts/`, the constants go to `parts/params.py`, and `model.py` and the part modules import them from there.
7. Load user files with `import_step("inputs/board.step")`: this merges the whole file into one shape. If the file has several parts or sub-assemblies, keep them with `asm = import_assembly("inputs/board.step")` and `add_part("Board", asm, role="reference")`: every body becomes its own part with its name and color, the sub-assemblies become groups under "Board". Move an assembly with `asm.loc = cq.Location((x, y, z))`. STEP files often have their origin in a corner: check the bounding box and move the part deliberately.
8. Prefer simple, readable CadQuery. Check that operations produced solids. Do not use `show_object` or `cq_editor`.