feat(parametric): guide model to use BOSL2 for organic/curved shapes#152
Draft
eve-assistant-bot[bot] wants to merge 1 commit into
Draft
feat(parametric): guide model to use BOSL2 for organic/curved shapes#152eve-assistant-bot[bot] wants to merge 1 commit into
eve-assistant-bot[bot] wants to merge 1 commit into
Conversation
… shapes (#65) Freeform and curved shapes (car body panels, tail lights, ergonomic grips, smooth pockets) were rendering as faceted/blocky geometry because the model defaulted to bare cylinder() / linear_extrude() / rotate_extrude() chains. Those primitives cannot represent splines, swept profiles, or lofted surfaces — the user who tried to model a Datsun 280z tail light couldn't form the top curve, use the "spline tool", or trace the pocket. Adds explicit guidance + a worked example to the STRICT_CODE_PROMPT in supabase/functions/parametric-chat/index.ts telling the model to: - include <BOSL2/std.scad> plus skin.scad / beziers.scad / rounding.scad - reach for path_sweep() (sweep a 2D profile along a 3D path — the "spline tool" equivalent) and skin() (loft between cross-sections) - generate smooth curves with bezier_curve() / bezpath_curve() instead of stacking cylinders - use offset_sweep() and round_corners() for chamfered/rounded edges - set $fn = 64 minimum (128–256 for organic surfaces) so swept Bezier geometry stays smooth - expose control points, radii, and slice counts as snake_case parameters The new few-shot example walks through the user's exact use case — a teardrop tail-light body swept along a 3D Bezier path — so the model has a direct template for this kind of request. Same playbook as the #42 BOSL2 fix for threaded fasteners. No new runtime dependencies — BOSL2 is already preloaded. Sample prompts users can now try: - "a Datsun 280z teardrop tail light" - "a curved car fender panel" - "a swept handle following a spline" - "a tapered fuselage lofted between three cross-sections" Closes #65 Authored by Eve (Zach's AI agent) on behalf of Adam.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Updates to Preview Branch (eve/issue-65-organic-shapes) ↗︎
Tasks are run on every commit but only new migration files are pushed.
❌ Branch Error • Mon, 11 May 2026 14:10:32 UTC View logs for this Workflow Run ↗︎. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #65
Root cause
When a user asked for a Datsun 280z tail light, the parametric-chat generator defaulted to bare OpenSCAD primitives (
cylinder(),linear_extrude(),rotate_extrude()) and tried to chain them into a freeform shape. Those primitives can't represent splines, swept profiles, or lofted surfaces — so the top curve flattened out, there was no "spline tool" equivalent the model knew to use, and the pocket trace couldn't follow the body's Bezier outline. The result was faceted/blocky geometry that didn't capture the user's intent.This is the same class of failure as #42 (screws/bolts collapsing because
cylinder()can't form helical threads). The fix follows the same playbook: tell the LLM explicitly to reach for BOSL2's higher-level primitives, which are already preloaded in the WASM runtime.What changed
Pure prompt change to
supabase/functions/parametric-chat/index.ts(STRICT_CODE_PROMPT):std.scad,skin.scad,beziers.scad,rounding.scad) and the right primitive for each shape class:path_sweep(shape, path)— the "spline tool" equivalent: sweep a 2D cross-section along a 3D path. For tail-light/headlight bodies, tubes following a curve, swept handles, fillet trim.skin([profile_a, profile_b, ...], slices=N)— loft/blend between cross-sections. For tapered shells, blended transitions, fuselage-like bodies.bezier_curve()/bezpath_curve()— generate a smooth curve from control points; feed intopath_sweeporpolygon.offset_sweep()andround_corners()— chamfered/rounded extrusions and edge rounding.$fnfloor to 64, with 128–256 recommended for organic surfaces so swept Bezier geometry stays smooth (low$fnis a common cause of "faceted" results).bezpath_curvefor both the 3D body path and the 2D teardrop cross-section, thenpath_sweepto assemble them. Mirrors the existing mug example in style and length.No new runtime dependencies, no changes to the OpenSCAD WASM worker, no changes to
package-lock.json. BOSL2 is already preloaded under/libraries/BOSL2/.Sample test prompts
Once shipped, users should be able to ask for any of these and get smooth swept geometry instead of faceted primitives:
a Datsun 280z teardrop tail light(the reporter's original ask)a curved car fender panela swept handle following a splinea tapered fuselage lofted between three cross-sectionsa smooth pocket traced along a Bezier curvean ergonomic computer mouse shellValidation
npm install --no-audit --prefer-offlinesucceeded;package-lock.jsonrestored to baseline so the lockfile is unchanged.npm run typecheck(tsc -b --noEmit) — passes cleanly.npm run lint:supabase(deno lint supabase) — passes (19 files checked, no diagnostics).Authored by Eve (Zach's AI agent) on behalf of Adam.
Summary by cubic
Guides the parametric-chat generator to use
BOSL2sweep/loft/bezier primitives for organic shapes, fixing faceted results like the Datsun 280z tail light in #65. Adds a worked example and smoother$fndefaults; no runtime changes.STRICT_CODE_PROMPTwithinclude <BOSL2/std.scad>,skin.scad,beziers.scad,rounding.scad, and when to usepath_sweep,skin, Bezier curves,offset_sweep, andround_corners.$fnfloor to 64 (recommend 128–256 for organic surfaces) and encourage exposing control points/radii as parameters.bezpath_curve+path_sweep.BOSL2is already preloaded.Written for commit e387520. Summary will update on new commits.