Conversation
|
I hit an error while handling your request (Model unavailable on AI Gateway free tier: Free tier users do not have access to this model. Upgrade to paid credits at https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%3Fmodal%3Dtop-up for unrestricted…). Please try again, rephrase, or reach out if it keeps failing. Error id: d4e5e7db-a268-4f42-80b9-49d6749f0cf5 |
7c6ac90 to
faf6efe
Compare
faf6efe to
14a1676
Compare
87059c5 to
0315065
Compare
14a1676 to
a39be0a
Compare
0315065 to
631d5dc
Compare
e5aad07 to
bf12a8a
Compare
…vel (AK-03b) A v2 'extrude' shape takes an expression-bearing F1 section (rectangle with optional corner radius, round with optional wall, oval, or polygon with up to 16 holes), a length and an optional bevel. Evaluation resolves it to a numeric ResolvedSectionProfile, re-centred in its box, so bounds, handles, surfaces and the base shift keep reading every shape as an oriented box. core/procedural-items/section.ts turns a resolved section into validated rings (the seam B-05's sweep will reuse) and counts an extrusion's triangles analytically: earcut caps (V + 2H - 2) plus side walls per layer. The builder uses three's ExtrudeGeometry; a bevel shrinks the outline by its size and bevels back out, so the box does not grow. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… wall (AK-03b) The bevel insets every contour, so it must stay under the least distance from any vertex to an edge it does not touch (outline and holes, at most 256 points), not just under the section's box. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…-03b, rebase onto the version-rule refactor) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… hole edges, structural sections (AK-03b, failing) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…trude UVs, section edge checks, structural sections (AK-03b) - Recipe shapes are a discriminated union on primitive: sized primitives keep a required size (R1); extrude takes section and length. - Extrusions take world-scale UVs from each triangle's own frame. - sectionRings refuses crossing edges, nested holes and sections above 256 points, and draws the F1 structural families (I, C, L, T, Z, rect-tube), which recipes may now use as Expr-bearing sections. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…erialize byte for byte (AK-03b) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
107a0e1 to
f2941e5
Compare
bf12a8a to
9a02e58
Compare
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 39b36e5. Configure here.
| thinnest = Math.min(thinnest, segmentDistance(point, other[j]!, other[k]!)) | ||
| } | ||
| return thinnest | ||
| } |
There was a problem hiding this comment.
Bevel cap treats arcs as walls
Medium Severity
sectionThickness takes the nearest vertex-to-non-incident-edge distance, so on rounds, ovals, and rounded rectangles it measures the gap to the next tessellation chord rather than the real wall. A solid 24-gon of radius 5 cm then allows only about 1 mm of bevel, and a 3 cm rounded corner allows less than 1 mm, so a normal chamfer on those sections is refused as if a thin wall existed.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 39b36e5. Configure here.


AK-03b: extrude shapes with F1 sections, holes and bevel
Stacked on #950 (AK-03a) → … → #945. Review the top commit only. This is part 2 of AK-03.
What. A v2
extrudeshape:{ primitive: 'extrude', section, length, bevel?, position, rotation?, slot }.sectionis an F1SectionProfilewhose numbers may be expressions:rectangle { width, depth, corner? };round { radius, wall? };oval { width, depth };polygon { outer, holes? }, with 3–64 points per ring and up to 16 holes.Evaluation resolves it to the frozen numeric
ResolvedSectionProfile, so norefis allowed and recipes stay self-contained, as the CHALLENGE required.Geometry. The section lies in local x/y and is extruded along local z over
length, centred. The evaluated shape is re-centred in its box, which gives three things:sizeis derived;sectionis carried on the evaluation.core/procedural-items/section.tsholds two helpers:sectionRings(profile): turns a resolved section into rings. Rounds and ovals use 24 sides, rounded corners use 4 segments per quarter, repeated points are dropped, a ring needs an area, and holes must sit inside the outline. This is the seam for B-05's sweep, which will consume the same rings along a path. Sweep is not in this PR.extrusionTriangles(): analytic. Earcut caps giveV + 2H − 2triangles each, and the side walls give 2 per edge per layer. The count is exact for rings without collinear points and an upper bound otherwise.Builder. three's
ExtrudeGeometry(MIT, already bundled). A bevel usesbevelOffset = −bevel, so the outline shrinks and bevels back out and the box never grows. Bevel is at most min(length, width, depth)/4 and at most 5 cm.Other rules.
extrudeis v2-only and takes nosize. Every other primitive now needssize; the schema made it optional only soextrudecan omit it. An extrude cannot be a support shape.Why. Audit limit #1. On /next, 525 elements (7.3 %) need extrusion: fascia and soffits (45/84), stair stringers and nosings (40/101), louvers (39/143), countertops and mouldings. It is also stage 1 of holes (limit #3): counters with a sink cut-out, grilles, frames.
Failing case first. Before the fix,
core/src/procedural-items/extrude.test.tsfailed 5 of 5 tests (scratch/AK-CORE/03b-failing-before.txt).Proof.
E6 fascia return (trial element
cabana-roof-east-end-closure). The sloped-top return was a box; now it is a polygon extrude of its four measured corners. Scored with the trial'scompare.pyagainst the /next source mesh, inside the return's box (scratch/AK-CORE/trial-proof/e6-return.out):Both have 48 triangles. Over the whole element, R@2 goes from 0.9995 to 0.9998 (the return is small next to the cap).
Parity and fit. nodes
geometry.test.tscovers rectangle, rounded rectangle, fully rounded ends, round, round tube, oval, a countertop with a sink hole, and both of those with a bevel. For each, the built triangles equalshapeTriangles, and the built bounding box equals the evaluated box to 1e-5.Expressions and pose. Core tests confirm that a
widthparameter moves polygon vertices and that the re-centred position is correct.bun test src(core): 3012 pass.bun test src/procedural-item(nodes): 52 pass.turbo check-typesfor core, nodes and editor: pass.bun run check: clean.House effect: no change. The /next scenes have no
procedural-itemnodes; the E6 gain lands when converters write v2.R7 size note. Each polygon vertex costs 2 values of the 12,000-value structural budget. A 64-point ring with 16 holes of 64 points is about 2,200 values. Hole patterns such as grilles should use a repeated part with a
countrather than listing many holes (CHALLENGE AK-03 fix).Bugbot fix (second commit): a bevel is now capped by the section's thinnest wall, not only by its box. The thinnest wall is the least distance from a vertex to any edge it does not touch, across the outline and holes;
bevel ≤ wall / 2.5, and a bevelled section may have at most 256 points. Tested on the counter (its slot is 5 mm from the edge, so 2 mm is OK and 2.5 mm is refused) and on an L-section.sizeis optional in the TS type only because extrude omits it; every other primitive still requires it at parseref)Local preview
Shared setup for the whole stack:
previews/AK.md(preview.sh start AK-PV previews/AK/ak-after.jsonserves on :3301).Setup is in
previews/AK.md.What you will notice
Where to look
Pose
3-counter-cylinders, the counter on the left.Before / after
previews/AK/before-3-counter-cylinders.png/after-3-counter-cylinders.png.Checked by me: the static renders at the listed poses (captured from :3100 and :3301). I did not click through the interactive steps in a browser; unit tests cover them.
Known limits
For Wassim to review:
sectionfield name (F1's own), withlengthrather thandepth, which collides with F1rectangle.depth.🤖 Generated with Claude Code
Note
Medium Risk
Touches recipe schema, evaluation, and mesh generation with new validation paths; v2-only and additive, but incorrect section/bevel rules could reject valid designs or mis-size bounds.
Overview
Adds a version-2-only
extrudeshape to procedural recipes:{ primitive: 'extrude', section, length, bevel?, … }instead ofsize. Recipe shapes are now a discriminated union onprimitive(solidShapevsextrudeShape), withsolidFields()so existing box/cylinder validation stays on sized primitives only.Core evaluation resolves expression-driven F1 sections (rectangle, round, oval, polygon with holes, structural I/C/L/T/Z/rect-tube), builds rings via new
section.ts(sectionRings,extrusionTriangles,sectionThickness), derivessizeand re-centredpositionfrom section bounds so extrusions still behave like oriented boxes for bounds/handles. Bevel is capped by length, 5 cm, and thinnest wall / 2.5. Polygon validation rejects crossing edges, nested holes, and invalid structural webs.Rendering in
geometry.tsbuilds extrusions with Three.jsExtrudeGeometryfrom those rings (optional inset bevel), treats extrude as v2 geometry for world-scale face-frame UVs, and counts triangles consistently withshapeTriangles.Tests cover compile-time contract for non-extrude
size, core extrude/bevel/validation cases, and nodes parity (triangle charge, bounding box, UVs on angled walls).Reviewed by Cursor Bugbot for commit 39b36e5. Bugbot is set up for automated code reviews on this repo. Configure here.
Codex review round (rev-951-a)
Failing test first:
test(... AK-03b, failing), then the fix.primitive. Non-extrude shapes keep a requiredsize. v1 key order is kept so parsed v1 recipes serialize byte for byte (there is a byte-pin test).Required change in the private bump PR
When private-editor bumps the
editor/pin past this PR, fixpackages/ai/src/studio/procedural-normalize.ts(~lines 199–212) in that same bump PR, or the private typecheck fails.shape.radiusandshape.size, then assigns.radiuson the probe shape and ontarget.RecipeShapeis now a union: extrude shapes (this PR) and revolve shapes (feat(procedural-items): revolve shapes (AK-03c) #952) have neitherradiusnorsize.primitiveis'extrude'or'revolve'before the clamp. Those shapes can't carry rounding anyway.