From 007d03422edcedbeb8abc330652f8c2745912ea9 Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Sun, 19 Jul 2026 19:14:11 +0300 Subject: [PATCH] fix(solid): cone silhouette uses the base radius, not the root radius MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The DISPSILH silhouette for a cone anchored its `CurvedGen::Cone.base` at the face's h_min (the base rim) but stored `radius` as the surface's h=0 root radius. The silhouette builder treats `radius` as the radius AT `base`, so its base line landed at the wrong radius and its top line (`radius + span·tan_a`) overshot the apex — a visibly wrong outline in wireframe, and wrong lines drawn over the (correct) shaded fill. Store the radius at the base instead (`radius + h_min·tan_a`). Cylinders (tan_a=0) and root-based cones (h_min=0) are unchanged. Co-Authored-By: Claude Opus 4.8 --- src/scene/convert/solid3d_tess.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/scene/convert/solid3d_tess.rs b/src/scene/convert/solid3d_tess.rs index cc4ac4241..a55035392 100644 --- a/src/scene/convert/solid3d_tess.rs +++ b/src/scene/convert/solid3d_tess.rs @@ -719,7 +719,12 @@ fn collect_curved_gens( axis: rot_dir(g.axis), u_dir: rot_dir(g.u_dir), v_dir: rot_dir(g.v_dir), - radius: (g.radius * scale) as f32, + // `radius` is the cone radius at `base`, which sits at h_min — + // NOT at the surface's h=0 root. `cone_face_geom.radius` is the + // root radius, so add the h_min offset (`radius + h_min·tan_a`) + // or the silhouette's `r0 = radius` lands at the wrong radius + // and its top `r1 = radius + span·tan_a` overshoots the apex. + radius: ((g.radius + g.h_min * g.tan_a) * scale) as f32, tan_a: g.tan_a as f32, h_max: ((g.h_max - g.h_min) * scale) as f32, theta_min: g.theta_min as f32,