Grasshopper

algorithmic modeling for Rhino

Hi,

I'm a total newbie to vbscript, but can operate reasonably well in Grasshopper.  I am hoping that someone might be kind enough to help me with what I think is a fairly simple task, yet has been causing me much stress to figure out!

Basically, I created a polyline in GH with a variable angle.  I would like to then like to perform two actions:

1. at each start point of the line, mirror a copy from its start point
2. at each end point of the line, mirror a copy from its midpoint

original polyline:                                               actions 1 (on left) and 2 (on bottom) performed:

 



I'd then need to loop this, so that they could be recursively copied off of each instance.  The generation would start to look like this, based on N iterations:



Unfortunately this needs to be done in vbscript rather than rhinoscript because I need to be able to see the movements of the system as the internal polyline angle changes.


I've attached the rhino file (only contains a point) and one of the many GH definitions I've tried.


Any and all help would be GREATLY appreciated--I've been stuck on this for over a week!

THANKS!!!


Views: 2409

Attachments:

Replies to This Discussion

I think, though I'm not positive (because I haven't bothered with the vb code yet) that you're getting diamond shapes, because one operation is missing, but fixing it will probably give you a lot of overlapped duplicate shapes.

Since you want a more rectangular aggregation why don't you reconfigure it based on a rectangular module four elements. I'll try to upload a jpg, but since my internet is crawling it should look like (very roughly)
/_ _\

\ /
- -
then just copy with series of vectors, no VB needed
should have read: "module of four elements"
Attachments:
Thanks, Trevor. That would be great to do this all within grasshopper and avoid VB entirely. But how did you do the aggregation without copying components for each instance? I thought that GH couldn't do recursive loops, only VB...

Could you show me how you "copied with series of vectors"?

Thanks!
It doesn't need to be recursive if you can find a repetitive module whose dimensions you can calculate in advance (and copy to the appropriate grid) rather than defining each point sequentially from a previous point location.

Actually a lot of the initial point creation in this would probably be nice to put into VB but only to get the wires out of the way. It looks complicated but it's just a sequence of simple arithmetic, adding dimensions (like in the .jpg above).
Attachments:
That's awesome, thanks Trevor! One thing with the definition you sent--I have not worked much with vectors. Is there a reason you chose to generate the polylines with vectors? I've attached an alternate way of doing that part of it.

The other thing is that the vector transformation doesn't seem to work once I add a rotation in the Y direction. Instead of iteratively copying it into an arc or something, it makes more like a sandwich...

Right:


Wrong:

cell generator-25-add rotation.ghx
The problem is that you're rotating part of the module, but not providing a rotation after the Move, so it's only translating (copying) the module exactly in the state it was in. The sandwiching happens because you're cross-referencing all three components of the Move vector, you need to Graft one of the dimensions (or two actually, but in this case you only need the X- and Z-components: see the file)
Attachments:
(In the absence of a PointAdd component, adding a vector to a point just feels more direct and efficient to me than Decomposing a point, adding values to one or more components, and then recomposing)
yikes, the method is right but the numbers are off (angle and vector length)
aaargh, almost there troubleshooting that one! The rotation values seem to be right at first, but as the iterations increase the numbers get increasingly off...


I am thinking that this now has to do with the second rotation (each individual module), but am not sure how to fix it. any thoughts, trevor?

thanks!!!
Attachments:
should it always make a semicircle? or does the arc angle change when more rows are added/unit is stretched?
I'm not sure why the arc angle is changing... I think it is because the vector rotation is driven by an angle from the base point, rather than the previous row. Not sure how to get it to read iteratively like that without using VB...

Ideally it would make a semicircle, yes. But then I want to be able to control it more precisely, like make the profile be a sin wave or something.
ah, got it!!

Turns out it you just need add an orientation vector from one stack to the next iteration.


It also helps to avoid the whole copying to a flat plane first. Instead I copied into a vertical stack, then just defined a series of points to copy those stacks to. As long as those points are a function of the width of the original module, vectors can be computed to keep them touching.

Whew!!

Now let's see if it will hold up to added geometrical complexity....
Attachments:

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service