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

Vorlage: Eckenradius wächst mit der Wand

Kai-Jungsthoefelb55c71f3fa51
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b68d48c..bb43d08 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,6 +15,10 @@ the version is bumped.
- This changelog is now in English, also for older versions.
+### Fixed
+
+- New models: the box of the template failed to build with a wall of exactly 3 mm, although the Parameters panel allows 1.2 to 4 mm. The corner radius now grows with the wall.
+
## [0.6.2] - 2026-10-11
### Fixed
diff --git a/app/resources/template/model.py b/app/resources/template/model.py
index def9d35..d77a39a 100644
--- a/app/resources/template/model.py
+++ b/app/resources/template/model.py
@@ -11,12 +11,14 @@ LENGTH = param(60.0, "Length", min=30, max=200, unit="mm")
WIDTH = param(40.0, "Width", min=20, max=150, unit="mm")
HEIGHT = param(25.0, "Height", min=10, max=100, unit="mm")
WALL = param(2.0, "Wall", min=1.2, max=4.0, step=0.1, unit="mm")
+# outer corner radius grows with the wall, so the inner corners keep a 2 mm radius
+CORNER = WALL + 2.0
# --- body: a box, hollowed out from the top ---------------------------------------------
body = (
cq.Workplane("XY")
.box(LENGTH, WIDTH, HEIGHT, centered=(True, True, False))
- .edges("|Z").fillet(3.0)
+ .edges("|Z").fillet(CORNER)
.faces(">Z").shell(-WALL)
)
@@ -24,7 +26,7 @@ body = (
lid = (
cq.Workplane("XY").workplane(offset=HEIGHT)
.box(LENGTH, WIDTH, WALL, centered=(True, True, False))
- .edges("|Z").fillet(3.0)
+ .edges("|Z").fillet(CORNER)
)
add_part("Body", body, color=(0.25, 0.45, 0.75))
diff --git a/app/test/measure.mjs b/app/test/measure.mjs
index ad0006a..fa7afb1 100644
--- a/app/test/measure.mjs
+++ b/app/test/measure.mjs
@@ -174,7 +174,7 @@ try {
await clickAt(lidTop.screen);
await result(() => !!window.__t.measure().result || !!window.__t.measure().error);
s = await ms();
- check('In der Vorschau: Oberseite des Deckels vermessen (Deckel 60 × 40, Radius 3 in den Ecken)', s.result?.a.type === 'PLANE' && Math.abs(s.result.a.area - (60 * 40 - (4 - Math.PI) * 9)) < 1e-6,
+ check('In der Vorschau: Oberseite des Deckels vermessen (Deckel 60 × 40, Radius 4 in den Ecken: Wand 2 + 2)', s.result?.a.type === 'PLANE' && Math.abs(s.result.a.area - (60 * 40 - (4 - Math.PI) * 16)) < 1e-6,
s.error || `${s.result?.a.area}`);
const relevant = page.errors.filter((e) => !/favicon/i.test(e));