The project
I discovered a shop that sells very affordable lab-grown sapphires. An 11mm Sapphire from Stuller costs $867, but from RGems in the Diamond District I can get it for $35! Such a good price, I decided to make a pendant with this impressive stone. I have been thinking of wanting to incorporate more petals and flower-like structures, so I went with a sunflower. I wanted to add some random variation to make it look natural.
The remainder of this piece shows how you can create a surface by offsetting the control points from a central rail, and applying random jitter to these control points to create organic shapes.
The Implementation
I started with a centerline curve in a Grasshopper C# component. I convert it to a nurbs curve.
|
1 2 3 4 5 6 |
for(int i = 0;i < petalCount;i++) { var centerCurve = inputCurve.ToNurbsCurve(); var leftCurve = inputCurve.ToNurbsCurve(); var rightCurve = inputCurve.ToNurbsCurve(); |
The line had six control points. By converting to a Nurbs curve this gives me access to the control points.
for control point 0, at the base, I simply offset the left and right points.
|
1 2 3 4 5 6 7 8 |
var p0r = centerCurve.Points[0].Location; p0r.Transform(Transform.Translation(new Vector3d(0.5, 0, 0))); rightCurve.Points.SetPoint(0, p0r); var p0l = centerCurve.Points[0].Location; p0l.Transform(Transform.Translation(new Vector3d(-0.5, 0, 0))); leftCurve.Points.SetPoint(0, p0l); |
For points 1 through 4, I get the position of the control point. I extract a Point3d from the control point using Location. I transform this point by a pre-defined vector, and jitter this control point with my static method CreateJitterVector, and applying the vector as a Translation to the Point. To replace the current control point with this translated and randomized control point, I use the curve.Points.SetPoint(int index, Point3d point) command. The first point is index 0, second index 1, and the other tip is index 5, because this particular curve has six control points. The transformation is applied by using SetPoint(int index, Point3d point);
|
1 2 3 4 5 6 7 |
... var p2r = centerCurve.Points[2].Location; p2r.Transform(Transform.Translation(cv2)); jitterVector = CreateJitterVector(random, randMult); p2r.Transform(Transform.Translation(jitterVector)); rightCurve.Points.SetPoint(2, p2r); |
to get the left hand curve I make the xvalue negative, so it mirrors along the Y axis, but keep the Z value the same, keeping the petal flat not twisted.
|
1 2 3 4 5 |
var p2l = centerCurve.Points[2].Location; p2l.Transform(Transform.Translation(new Vector3d(-cv2.X, 0, cv2.Z))); jitterVector = CreateJitterVector(random, randMult); p2l.Transform(Transform.Translation(jitterVector)); leftCurve.Points.SetPoint(2, p2l); |
And so on with all my points. I keep the endpoint, point 5, the same, so it comes to a rounded point. The I loft the three curves to create a petal
|
1 2 |
var lofts = Rhino.Geometry.Brep.CreateFromLoft(new NurbsCurve[]{leftCurve, centerCurve, rightCurve}, Point3d.Unset, Point3d.Unset, LoftType.Loose, false); |
I polar array the petals around the Z axis, with every other petal pitching up. Every other petal I rotate the petal up pivoting around the point at centerCurve.Points[0].Location.
|
1 2 3 4 5 6 7 |
double pitchAngle = random.NextDouble() * randMult + petalPitch; foreach(Brep l in lofts) { if (i % 2 == 0) l.Rotate(pitchAngle, new Vector3d(1, 0, 0), centerCurve.Points[0].Location); l.Rotate(2 * Math.PI * i / petalCount, new Vector3d(0, 0, 1), new Point3d(0, 0, 0)); } |
I cheated and did a manual offsetSrf command to thicken the petals.



The rest of the setting I did manually.
Leave A Reply