Cool, I have been waiting for a discussion topic to cover lofting with the VB component.
I have uploaded a file that modifies what visose has done (with Mr. Rutten's suggestions, of course) to create a set of rotating "organic louvers" along a curve. http://grasshopper3d.googlegroups.com/web/VB_Loft_Organic Louvers_nmiller.jpg http://grasshopper3d.googlegroups.com/web/VB_Loft_Organic Louvers_nmiller.ghx This is too much fun. Thanks guys! -Nate On Oct 20, 3:33 pm, visose <[EMAIL PROTECTED]> wrote: > I did a simple example of multiple lofts with the help of the pointers > mentioned above:http://grasshopper3d.googlegroups.com/web/loftcurves.jpg > > In GH i create a 3D grid of points and I place a horizontal circle in > each of the points.The radius of the circles is a function of the > x,y,z values of its corresponding point (so all or most circles have a > different size). > Then I order the list of circles by its Z value. > In the script component i select the curves that have the same X,Y > position and loft them. > My scripting skills are really bad, so the way i select the curves to > loft was a bit of trial and error and its probably not the best way to > do it. I tried to include only the necessary lines to create a loft, > but there are a loft more loft options available. > > On Oct 20, 3:28 pm, David Rutten <[EMAIL PROTECTED]> wrote: > > > Hi Visose, > > > that is indeed too simplistic. The Loft component is not part of > > Grasshopper, it is part of the Surface.gha file which ships alongside > > grasshopper. GHA files in Grasshopper are similar to RHP files in > > Rhino. There's no way for a plugin to hack into another plugin. Only > > functions that are available inside Rhino core (and inside dlls you > > specifically reference when you compile your plugin) can be called > > from within a plugin. > > > I could make a simple Loft function in Grasshopper somewhere, which > > could be used by people writing scripts. But since we (read: Dale > > Fugier) are already in the process of porting all RhinoScript > > functions to the SDK, I'd rather wait until V5 comes out so we can get > > all this for free. > > > The EH_Box, EH_Integer, EH_Surface classes you saw indeed come from > > Grasshopper. I didn't bother changing the prefixes on all classes when > > the name changed to Grasshopper, and to avoid a double naming standard > > I still call everything "EH_". But, these classes are not components, > > they are data types. EH_Curve can be likened to OnCurve, EH_Colour is > > similar to System.Drawing.Color etc. etc. These classes typically do > > not offer much functionality, they merely contain data. > > > -- > > David Rutten > > Robert McNeel & Associates > > > On Oct 20, 4:09 pm, visose <[EMAIL PROTECTED]> wrote: > > > > What I'm going to ask is probably very simplistic and naive since i > > > don't know how the internals work too well. > > > But when the popup list appears when writing code the are seem to be > > > some GH components like EH_box, EH_circle, EH_curve (I assume EH is > > > from 'explicit history'). > > > So I thought maybe there was a way (or there will be a way) of using > > > the grasshopper component 'loft' inside the scripting component > > > instead calling the SDK loft directly. > > > So it would be as simple as: (here comes the most naive part of the > > > post) > > > > Having as input parameter of the scripting component 'loft_curves' and > > > 'A' as output: > > > Dim loft As New GH_Loft() > > > loft.inputcurves = loft_curves.ToArray() > > > A = loft.outputgeometry > > > > On Oct 20, 1:11 pm, David Rutten <[EMAIL PROTECTED]> wrote: > > > > > Hi Adam, > > > > > Lofting is not easy. You have to construct a new instance of > > > > MArgsRhinoLoft, which contains all the loft settings and curves. Then, > > > > you have to call RhUtil.RhinoSdkLoftSurface and pass it your > > > > arguments. There's no function in the SDK which is as easy as > > > > Rhino.AddLoftSrf in RhinoScript. I agree that there should be, but > > > > there isn't. > > > > > Let's assume you have a collection of 100 OnCurves, and you want to > > > > loft the first 10: > > > > > 1) Create a new list of MRhinoLoftCurve and populate it using a loop > > > > > Dim loft_curves As New List(Of MRhinoLoftCurve) > > > > For i As Integer = 0 To 9 > > > > Dim crv_section As New MRhinoLoftCurve() > > > > crv_section.m_curve = m_original_curves(i).DuplicateCurve() > > > > crv_section.m_bClosed = m_original_curves(i).IsClosed() > > > > crv_section.m_bIsPlanar = m_original_curves(i).IsPlanar() > > > > loft_curves.Add(crv_section) > > > > Next > > > > > 2) Then, create new MArgsRhinoLoft and populate the values: > > > > > Dim loft_args As New MArgsRhinoLoft() > > > > loft_args.m_loftcurves = loft_curves.ToArray() > > > > loft_args.SetClosed(<<value that indicates whether you want a closed > > > > loft of not>>) > > > > ....<<set other loft settings in similar fashion>> > > > > > 3) Finally, call the RMA.Rhino.RhUtil.RhinoSdkLoftSurface() function > > > > with loft_args and an array of OnNurbsSurfaces. > > > > > -- > > > > David Rutten > > > > Robert McNeel & Associates > > > > > On Oct 20, 1:48 pm, "Adam Holloway" <[EMAIL PROTECTED]> wrote: > > > > > > I'm relatively new to scripting. I want to sort a number of curves, > > > > > in > > > > > different lists, and then loft them periodically in the scripting > > > > > component. What is the best way to do this? I've looked through the > > > > > sample > > > > > code for SDKLoft but the different classes confused me and I wasn't > > > > > sure > > > > > what was appropriate for this. > > > > > > Thanks, > > > > > Adam
