Grasshopper

algorithmic modeling for Rhino

Randomly populating and rotating Breps on a surface.

Hello all I.  

I have been trying to randomly populate a surface with settings (that will receive faceted round stones) that I would like to rotate randomly by their centers.  

I can populate the surface just fine and I can create a random rotation but I have not been able to link them together.  I have been trying to just create a rectangular array with the brep using an scale of a boundary box as the spacing and then trying to break apart the array to find the center of the individual pieces to rotate randomly in the X-axis.  I am using Rhino and grasshopper on a mac.  

Any help would be amazing.  

Thanks. 

-

Views: 3218

Attachments:

Replies to This Discussion

Since you internalized your 'Brep' shape in GH, there is no need for that huge Rhino file.  Why is it so big anyway?  I see only one small shape in it, the same one you internalized?

I disabled previews for all components except the last one and it looks like it's working fine.  Did you intend to use degrees instead of radians for rotation?

It could be much faster if you avoid using 'Volume' to get the centers of rotation.  Here is one way of doing that:

P.S.  OH!!!  Sorry, I didn't see this until just now.  You are generating only seven random numbers instead of 100.  Standby, will create a another post so I can attach different code.

Attachments:

You are generating only seven random numbers instead of 100.

Here are two ways of fixing this:

1) You can replace the slider input to 'Random N' with the length ('Lng') of the list generated by 'ArrRec':

2) If you want to re-use the same seven angles over and over, you can use 'Repeat Data' and 'Jitter':

I took the liberty of setting 'Degrees' on the 'Rotate A (Angle)' input.

Attachments:

MAN!  

You are amazing.  

I feel like that the obvious thing always eludes me.  I didn't think of hiding everything except for the last node.  

Ugh.  

I should be banned. 

Thanks for the help. 

I am curious as to why the Volume node slows things down.  Is it that is taking a while to find the volumetric center?  

I hope to apply this to new surfaces to set stones on.  After dialing in the geometry and knowing what will work in the real world (3D print in wax, cast in precious metal and then setting the stones) I want to apply it to more complex surfaces and basically put stones on everything.  

Thank you again for the help. 

I am curious as to why the Volume node slows things down. Is it that is taking a while to find the volumetric center?

Yes.  You can see the performance burden of each component using the Grasshopper Profiler widget ('Display | Canvas Widgets | Profiler'):

13.6 seconds seems like a long time for only 100 geometries, not sure why...  It appears to be related to the complexity of your shape; 24 faces, 57 edges, 35 vertices.  Look at this little experiment comparing it to spheres and cones:

'Area' can also be slow.  Whenever possible, I try to use other means to get a centroid instead of using these two.  In this case, you had a grid, in other cases, there is often a point already in the right place or it can be derived by quicker means, like using 'Avr (Average)' of two or more points (vertices).  If you can't avoid it, just know that this can be a bottleneck.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service