Wow, great explanation. Thanks for that. I figured it had something to do with ArrayOn3dPoint because it kept asking for an Array...just didn't have ANY clue how to do it!
Thanks again. On Jan 22, 9:02 pm, damien_alomar <[email protected]> wrote: > Brent, > > I know exactly what you're looking to do, and I actually put pretty > much the exact same thing (script component, not the definition as a > whole) together a few months ago. Rather than directly comment on the > code that you provided I'll go through some of the details of how I > put my version together. > > We'll work from the ending (the creation of the curves) back through > the script as knowing what you need makes it much easier to find your > way. You got the right method for building the interpolated curve, > but the points actually need to be in a special data type, an > ArrayOn3dPoint. This isn't really much more than an actual array of > On3dPoints, but the SDK has set up the data type and thats what it > wants for the method. Unfortunately supplying a regular array just > won't do. Luckily getting the points into that data type is easy with > the Append method. > > So now we know that we need to take our long list of points and split > them into little lists and create an ArrayOn3dPoint for the little > list to make the curve (sorry that sentence sucks). In theory you've > got two ways to do this A) split the list into the smaller lists all > at once, then make the curves or B) make the curves as we make the > little lists. From looking at your code, it seams as though you chose > A, but IMHO B is an easier solution as you don't have to keep track of > the list of short lists. > > The next thing that's on the plate is how to actually step through the > large list so that we can grab the short lists. My recommendation is > to have two (2) For..Next loops. One on the outside that steps short > list by short list, and one on the inside that steps through each > point individually. This also offers us something that's useful. The > way that scope works in VB.NET is such that any variable that is > initiated within a loop will only "live" for the duration of that > loop. Once the loop is finished with an iteration, the variables will > be reinitiated as if they were never around before. This is useful > because if we declare our ArrayOn3dPoint, add the points to the > ArrayOn3dPoint, and create the interpolated curve all within the loop, > then next time we execute the loop (for the next curve) we won't have > to worry about switching out old points for new points or any of that > junk. The only thing we need do is add the created curve to a > variable that contains all the created curves, supply that to the > output and its good to go. > > Also, a little note, the way the Surface UV divider actually works is > that it will create 1 additional point beyond the number specified in > both the U and V directions. In the context of you're definition, the > code takes this into account by adding 1 to the number of points > desired per curve. For a wider approach, its probably best to take > out those small additions and do that outside of the code. > > http://grasshopper3d.googlegroups.com/web/Canopy%20Lines_v2_ScriptAdd... > > Hope that Helps > > -Damien > > On Jan 22, 5:54 pm, BrentWatanabe <[email protected]> wrote: > > > Hey folks- > > > Having an issue with VB.Net > > > I want to go from having to do > > this:http://groups.google.com/group/grasshopper3d/web/Canopy%20Lines_v2_No... > > > To scripting in VB.NET, but I'm pretty sure I'm having an issue with > > Syntax. > > > Here is the problem file: > > >http://groups.google.com/group/grasshopper3d/web/Canopy%20Lines_v2_Sc... > > > and 3dm file > > >http://groups.google.com/group/grasshopper3d/web/test.3dm > > > Basically what I want to do is have a system of distortion that > > updates automatically depending on the amount of points you have have, > > instead of having to cull through each and every row of points. > > > I tried subsets...intervals, etc...but it seems to come down to > > scripting.
