forked from 1b-agent/opencadstudio-upstream
fix(solid): cone silhouette uses the base radius, not the root radius
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 <[email protected]>
This commit is contained in:
1 parent
e0f5b29941
commit
007d03422e
1 file changed
+6
-1
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user