algorithmic modeling for Rhino
Hello all,
I've searched for the answer but am not finding the right clues. It is probably right in front of me but cannot find it.
I am using Grasshopper to build a regional intersection of two closed curves. Then filleting the corners of the resulting curve with a radius. I then rebuild the curves with a new number of control points. All good so far.
However I now need to run the normal Rhino "Smooth" command on the resulting curve a few times to remove the lumps and get a good result. How to do this seemingly simple step? Where can I go to find examples of this approach?
Assuming passing an id of the object to VBScript and accessing a Rhino Command, but lost.
Thanks for your time.
Shaw
Tags:
Hi Shaw,
smoothing means averaging the control points with the neighbours on both sides. There is no function that readily does this, you'll need to write it yourself. I don't think it will be very simple though, especially if you want to cater for periodic curves.
I did write a few smoothing algorithms for polylines (Rhino.Geometry.Polyline) so maybe you can use those, then convert the polyline points back into curve control-points.
--
David Rutten
david@mcneel.com
Turku, Finland
Hi Shaw,
I attach here one example of smoothing an open polyline using the Laplacian Smoothing definition. It is here applied segment-by-segment.
The example itself is provided in all languages for Grasshopper:
- C#
- Vb.Net (not the same as VbScript)
- Python (for Rhino5 in external add-on, both with RhinoScript and RhinoCommon)
I hope this helps getting started,
- Giulio
_______________
giulio@mcneel.com
McNeel Europe
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by