Skip to content

Commit 625490e

Browse files
author
alferio
committed
feat(primitives): sphere,cylinder,cone,pill
Added tools: - Sphere: center point, radius point, circle resolution controls tessellation. - Cylinder: base center, radius point, height point; axis is h - c, base plane is normal to that axis. - Cone: same 3-point workflow as cylinder, apex at height point. - Pill: same 3-point workflow as cylinder, capsule body between c and h with hemispherical caps. Wiring included: - new ToolIds - new PrimitiveTools.kt - registered tools in Main.kt - new Primitives toolbar in SketchUiOverlay.kt - mapped icons: sphere, cylinder, cone, pill - toolbar layout version bumped so the new toolbar gets placed cleanly Primitive tools now show 3D wireframe feedback while picking: - sphere previews latitude/longitude wireframe after center + radius hover - cylinder previews bottom/top rings and vertical edges - cone previews base ring and side edges - pill previews capsule rings and longitudinal edges Toolbar commands are now registered for every built-in toolbar: - View> Toolbars> Show ... - View> Toolbars> Hide ... This includes Actions, Point Construction, Modification, Entity Construction, Rendering, Architecture, Camera, Modification 2, Voxel, HVAC, Mech, Primitives, and In-tool Operators. fix: The Primitives toolbar was being created and stored in builtInToolbars, but it was missing from the buildStandardToolbars() return list. That means it was never added to the stage, so: - primitive tool commands could still activate the tools - show/hide commands found the toolbar object - but nothing appeared, because the toolbar actor was not in the scene graph Fixed in core/src/main/kotlin/com/github/alfu32/sketch/ui/SketchUiOverlay.kt:1689: - added primitives to the standard toolbar actor list - made setBuiltInToolbarVisible() self-heal by adding the toolbar to the stage if it is detached
1 parent 893f660 commit 625490e

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

core/src/main/kotlin/com/github/alfu32/sketch/tools/PrimitiveTools.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,14 @@ class SpherePrimitiveTool(
127127
val c = upper[next]
128128
val d = upper[i]
129129
if (stack == 0) {
130-
group.faceStore.addTriangle(a, c, d, faceColor)
130+
group.faceStore.addTriangle(a, d, c, faceColor)
131131
faces++
132132
} else if (stack == stacks - 1) {
133-
group.faceStore.addTriangle(a, b, d, faceColor)
133+
group.faceStore.addTriangle(a, d, b, faceColor)
134134
faces++
135135
} else {
136-
group.faceStore.addTriangle(a, b, c, faceColor)
137-
group.faceStore.addTriangle(a, c, d, faceColor)
136+
group.faceStore.addTriangle(a, c, b, faceColor)
137+
group.faceStore.addTriangle(a, d, c, faceColor)
138138
faces += 2
139139
}
140140
edges += addPrimitiveSegment(group, a, b)

0 commit comments

Comments
 (0)