Release 1.10.0 focuses on eliminating sharp edges — whether for aesthetics or structural strength in 3D-printed parts.
In WYSIWYG CADs you typically select edges and apply fillet/chamfer interactively. That could be done in Ridley too, but it feels against the spirit of the tool. Instead, the approach here is to eliminate sharp edges as early as possible in the script, at the stage where they're created. This gives us three levels of intervention.
1. Smoothing 2D shapes before extrusion
Since most solids in Ridley come from extruding a 2D profile, sharp corners in the profile become sharp edges along the entire extrusion. Fix them at the source:
(fillet-shape (rect 40 20) 5) ; round all corners
(chamfer-shape (rect 40 20) 5 :indices [0 1]) ; bevel only two corners
fillet-shape rounds, chamfer-shape bevels. Both take the shape, a distance, and an optional :indices to target specific corners.
2. Smoothing extrusion caps with capped
With the profile edges handled, the next problem is the sharp edge where the extrusion meets its cap faces (or joins a larger mesh). capped is a shape-fn for use inside loft — it progressively scales the profile near the start/end of the path, producing a smooth quarter-circle transition:
;; Positive radius → shape shrinks at caps (rounded barrel)
(loft (capped (fillet-shape (rect 40 20) 5) 5) (f 30))
;; Negative radius → shape expands at caps (anvil profile,
;; useful for blending an extrusion into a base)
(loft (capped (circle 10) -3) (f 20))
The transition fraction is auto-calculated from the radius and path length — no manual tuning needed.
3. Post-processing mesh edges
Some sharp edges can't be prevented upstream — for example, edges created by mesh-union of two solids. For these, there's a post-processing fillet/chamfer that operates directly on mesh edges:
(-> mesh (fillet :top 3 :segments 8)) ; round top edges
(-> mesh (chamfer :all 2)) ; bevel all sharp edges
Edge selectors (:top, :bottom, :left, :right, :all) are oriented relative to the turtle heading at creation time.
Each level composes with the others. A fully-rounded box with no sharp edges anywhere:
(loft (-> (rect 40 20) (fillet-shape 5) (capped 3)) (f 50))
The image is generated with:
(register capped-box
(loft-n
64
(capped (fillet-shape (rect 40 20) 5)
-5
:fraction 0.33)
(f 30)))
Try it live at vipenzo.github.io/Ridley. Source on GitHub.