G3 “Fillet” using Evolutionary Algorithm in Rhinoceros 3D

Download G3 Fillet Script
Rhinoceros 3D is a powerful surfacing tool, but achieving Class-A surface quality requires advanced techniques beyond the native commands. For instance, the BlendCrv command allows for different continuity settings but lacks precision, especially when mimicking a fillet radius. In this guide, we'll explore how to create a high-quality G3 fillet using an evolutionary algorithm.
Understanding Fillet Options in Rhino
Option A: _Fillet Command
The fillet command creates a Tangent Continuity (G1) between curve segments. This results in three curves: two baselines and the fillet curve itself. The control points are arranged to maintain tangency but introduce an abrupt radius shift.
Curvature Analysis: The transition between the base curve and the fillet is not smooth, causing visible highlights in reflections. This is not ideal for high-quality surface design, especially for premium product aesthetics like Apple’s industrial designs.

This will create a highlight in the final surface quality at the point of union and this is not an optimum result if we want to achieve high surface quality like Apple products.

Option B: _BlendCrv Command (G2 & G3 Continuity)
The BlendCrv command provides higher continuity options:
- G0 - Position continuity
- G1 - Tangent continuity
- G2 - Curvature continuity
- G3 - Torsion continuity
- G4 - Higher-order curvature continuity
You can adjust the control points manually for a smoother transition. Holdinhile moving CVs ensures symmetrical deformation.
Curvature Analysis: The transition is smoother than a standard fillet, but manual control point adjustments introduce inaccuracy. There’s no way to precisely match the original fillet radius while maintaining G3 continuity.

Option C: Optimizing BlendCrv + Gh Optimization
To achieve both G3 continuity and minimal deviation from a reference fillet, we can leverage Grasshopper’s parametric capabilities combined with evolutionary optimization via Galapagos.
Step 1: Recreating the Blend Curve in Grasshopper
- Define four movable control points on each end, creating eight total variables.
- Construct a Degree-7 single-span curve based on these points.
- These control points serve as adjustable parameters to refine the blend curve.

Step 2: Implementing Evolutionary Optimization with Galapagos
What is Galapagos? Galapagos is an evolutionary solver in Rhino that mimics natural selection to optimize complex problems. It requires two key inputs:
- Genome (Design Variables): The four control point positions.
- Fitness Function (Optimization Goal): Minimize deviation between the fillet and blend curve.

So, when we run the solver, the 4 CVs will move randomly at the start. Galapagos will evaluate the 100 possible solutions to see which of these 100 curves has the least deviation. In the next generation, the best performing curves will “survive” and create offspring by combining the DNA or Genes of the parent curves. The curves that are performing poorly will be eliminated (just like in nature). And if we let it run a couple of generations, let’s say 200 iterations, you will notice it will slowly converge into an optimum Blend curve with a deviation of around 1 or 2 hundredths of a millimetre.

2D to 3D: Surface Quality Evaluation
Since curves define surfaces, the quality of the blend curve directly impacts surface continuity. Using Zebra Map, Environment Map, and Curvature Map, we can analyze surface characteristics:
- Smooth G3 transitions result in uniform reflections.
- Surface lofting between optimized profiles maintains continuity along the U and V directions.


Conclusion
This workflow provides a G3 blend curve that closely matches a fillet, ensuring both smooth continuity and minimal deviation. Additional refinements could include:
- Aspect ratio constraints to maintain proportional control points.
- Minimum CV distance enforcement for uniform control point distribution.
You can download the .gh script to experiment with different blend types. If you improve the script, tag us in your results—we’d love to share your work with the community!
Thanks for reading ❤️
