git.lucas.co / cce-designer
graphic design tool
git clone https://git.lucas.co/cce-designer.git

commitdacff84a535f9e2882debf0c5577bd9fa881c67e
parent718fa4e3a0
authorLucas Galante <[email protected]>
date2026-07-23 14:12
feat: Bevel Profile ramp — Style section reshapes the DE bevels live

New Style section on the Main menu node with a "Bevel Profile" ramp param
(cce-ui's new ramp row type). Editing the curve reshapes every recess/boss
wall this instance renders — apply_settings_from_menubar_subnets feeds the
spec into cce_ui::layout::set_bevel_profile_keys on every param sync (and at
project load, so the saved curve applies at startup). The default identity
curve is exactly the toolkit's analytic bevel. The params pane draws the
ramp rows through ParametersBg::paint_scene_rows inside its scroll clip —
curve geometry the legacy flat views can't carry.

Co-Authored-By: Claude Fable 5 <[email protected]>

 src/project.rs | 18 +++++++++++++++++-
 src/render.rs  |  3 +++
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/src/project.rs b/src/project.rs
index 4c30368..a0fd21a 100644
--- a/src/project.rs
+++ b/src/project.rs
@@ -412,6 +412,12 @@ impl State {
         ensure_param(main_node, "Background Color", "color", &color_to_hex(vp_bg_color), &[], None, None, None);
         ensure_param(main_node, "Grid Color", "color", &color_to_hex(vp_grid_color), &[], None, None, None);
 
+        // Style — the DE-chrome styling this instance renders with. The bevel
+        // profile ramp reshapes every recess/boss wall live (the identity 0→1
+        // smooth curve IS the analytic default the toolkit ships).
+        ensure_param(main_node, "Style", "section", "", &[], None, None, None);
+        ensure_param(main_node, "Bevel Profile", "ramp", "smooth;0.000:0.000,1.000:1.000", &[], None, None, None);
+
         // The Help section is retired — its only row was an About button nothing
         // dispatched. Drop it from older saves too.
         main_node.params.retain(|p| !matches!(p.name.as_str(), "Help" | "About"));
@@ -448,7 +454,7 @@ impl State {
             }
         }
 
-        const MAIN_PARAM_ORDER: [&str; 32] = [
+        const MAIN_PARAM_ORDER: [&str; 34] = [
             "File", "New Project", "Open", "Save", "Save As", "Exit",
             "Edit", "Undo", "Redo",
             "View", "Show Viewport Pane", "Show Parameters Pane",
@@ -459,6 +465,7 @@ impl State {
             "Show Grid Guide", "Show Reference Cube", "Show Origin Axes",
             "Ray Traced Preview", "Grid Thickness", "Origin Guide Size",
             "Camera Pivot Size", "Background Color", "Grid Color",
+            "Style", "Bevel Profile",
         ];
         main_node.params.sort_by_key(|p| {
             MAIN_PARAM_ORDER
@@ -574,6 +581,15 @@ impl State {
                         self.active_camera = cam.clone();
                         self.viewport_mut().active_camera = cam;
                     }
+
+                    // Style
+                    "Bevel Profile" => {
+                        if let Some((keys, smooth)) = cce_ui::widget::parse_ramp_spec(&p.default) {
+                            cce_ui::layout::set_bevel_profile_keys(&keys, smooth);
+                        } else {
+                            cce_ui::layout::clear_bevel_profile();
+                        }
+                    }
                     _ => {}
                 }
             }
diff --git a/src/render.rs b/src/render.rs
index 3e9a0ec..8222619 100644
--- a/src/render.rs
+++ b/src/render.rs
@@ -285,6 +285,9 @@ impl State {
                     for (scx, scy, sr, sc) in param_bg.spheres() {
                         pc.sphere(scx, scy, sr, sc);
                     }
+                    // Scene-path rows (ramp curves) — geometry no flat view
+                    // carries; drawn last so they sit over the section wells.
+                    param_bg.paint_scene_rows(pc);
                 });
             }