fix(parametric): generate proper threaded geometry for screws/bolts#143
fix(parametric): generate proper threaded geometry for screws/bolts#143zachdive wants to merge 2 commits into
Conversation
…rs (#42) Threaded fasteners were rendering as smooth cylinders or blank space because the model used bare cylinder()/linear_extrude() — OpenSCAD primitives can't represent helical thread geometry. The thread region collapses to invisible slivers, especially at default low $fn values, and the same blank space ships through to the STL export. Adds explicit guidance + a worked example to the parametric-chat system prompt telling the model to: - include <BOSL2/std.scad> + screws.scad / threading.scad - use screw(), screw_hole(), threaded_rod(), nut() etc instead of cylinder() - set $fn=64 (96-128 for larger diameters) so threads actually resolve - expose diameter/length/pitch as snake_case parameters - pass standard size strings like "M6x1" or "#8-32" so pitch is auto-picked Closes #42 Authored by Eve (Zach's AI agent) on behalf of Adam. Co-authored-by: eve-app <280557408+eve-app@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
Greptile SummaryThis PR is a pure system-prompt change that steers the LLM away from bare
Confidence Score: 5/5Safe to merge — pure prompt change with no runtime or schema impact, and the thread=true correctness issue from earlier review rounds is not present in this version. The only change is the system-prompt string in a single Edge Function. BOSL2 guidance is technically accurate: includes are correct, the right modules are called, the previously-flagged thread=true boolean is gone, and $fn = 96 is appropriate for M8. The one finding is a naming nit in the worked example with no effect on runtime correctness. No files require special attention. Important Files Changed
Reviews (3): Last reviewed commit: "fix(parametric): remove boolean thread o..." | Re-trigger Greptile |
Summary
Closes #42.
When the model generated a screw or bolt, the threaded region rendered as smooth cylinder or blank space, and the same gap shipped through to the STL export. Root cause: the LLM was hand-rolling threads with bare `cylinder()` / `linear_extrude()`, neither of which can represent helical thread geometry in OpenSCAD. At the default low `$fn`, the thread profile collapses into invisible slivers.
Fix
Adds explicit guidance + one worked example to the parametric-chat system prompt directing the model to use BOSL2 for any threaded fastener:
BOSL2 is already preloaded in the runtime (referenced from the README as a built-in library), so no library plumbing change is needed — only the prompt.
Test plan
Suggested test prompts:
Notes
This is a pure prompt change; no runtime, library, or schema changes. The change is in `supabase/functions/parametric-chat/index.ts` only.
Authored by Eve (Zach's AI agent) on behalf of Adam.
Summary by cubic
Fixes missing/blank threads by requiring
BOSL2for all screws, bolts, nuts, threaded rods, and tapped holes, and removing boolean thread overrides so models and STL exports render correct helical threads (fixes #42).BOSL2includes and modules (std.scad,screws.scad,threading.scad); callscrew(),screw_hole(),threaded_rod(),nut().thread_lenonly for partial threads.cylinder()/linear_extrude(); set$fn >= 64(96–128 for larger diameters).Written for commit 5458cd3. Summary will update on new commits.