Grasshopper

algorithmic modeling for Rhino

first i wanna indicate that i'm new to the grasshopper and scripting. What I wanted to achieve that creating volumetric cubes which will seem like randomly spread in x,y and z directions.(but not randomly spread) i'll add an image about the identical depiction of the thing that i wanted to achieve.

here comes my problems : 
- these cubes' sizes should change with a growth of fractal algorithm.
- for the other volumes that will be shattered between cubes should not touch or overlap each other. I think that I must write an if-then conditional script which says " if a cube overlaps on an other one, then move the other one away." but i have no idea how to do it, i am searching for tutorials and e-books about it, but no tutorial solved my problem and e-books are mostly about scripting and even if i want to start and go further on scripting, i have a limited time to solve this problem. 

PS: for the images that i upload; these are only for to describe my idea, i used jitter to randomize but i should have an algorithm to be able to control the distances or density of the boxes.i also added a sketch to describe my idea but conceptually.

Views: 3207

Attachments:

Replies to This Discussion

no one to say anything? even a small idea to lead me in a way?
Your example images don't look like they have a fractal relationship.

Maybe you're looking for a discrete subdivisional-type relationship.

If you want boxes, try playing around with OcTree (3D) under the Mesh tab.
Hi Ibrahim,

Another approach without scripting may be creating a series of scaling factors with the sort of fractal growth you are talking about and scale the initial cube.

Then create a new series based on the first series( or perhaps the first series itself) to find the coordinates of the corner of different boxes. doing some maths you should be able to figure out a formula to give you the corners so you end up with points you can move the scaled boxes to.

Just and idea!

Cheers

Evert
thank you taz and evert amador, for your comments.

to achieve what i want to create, i should somehow combine both of your advertises. I can define the poins on a box and check that if it is inside of another box or not (surfaces->utilities-> inside ). or i can put a parameter to calculate the distance between points and write the formula that "if the x distance is smaller than y value, add z to x value". but even if i write it, it changes nothing. (i use f1 or f2 scripts under math) i even tried to select the ones which have true boolean result from the distance formula and move only these ones but it didn't work.

if anyone can help me with these statements, i would be grateful.

i will start two other discussions related with this problems to indicate my goals clearly, one of them will be about coloring these boxes with different colour and the other will be about creating level differences between boxes.

btw i'm uploading a definition which i found on modelab.nu and modified a little to make similar that i wanted. i guess that will help the ones who is trying to make similar things a lot. but there was a picture on the page of definition which attracted me a lot but the definition is far different from the picture, is there anyone that have an idea about that? (source: http://modelab.nu/?p=2734 )
Attachments:
I'm not sure if it helps you or not, but you can make a simple VB Switch component ...

Private Sub RunScript(ByVal f As Object, ByVal Ai As Object, ByVal Bi As Object, ByRef Ao As Object, ByRef Bo As Object)
If f Then
Ao = Ai
Bo = Nothing
Else
Ao = Nothing
Bo = Bi
End If
End Sub


Feed a boolean into f for a simple If ... Then ... Else component.
thank you shawn. i used the code and created a vb script but i'm not good at scripting yet and i guess i made a mistake because it is shown red in gh. i'm still working on it, so i'll let you know if that worked for me or not. thank you again for your help.
Make sure that your input and output variables match whatever is in the script text. That's most likely what's causing it to go red.
Here's the component as I have it. I use this quite a bit.
Attachments:
thank you again, because of being a newbie to gh and these issues, i made a silly mistake that i fixed it now with your definition's help. now I'll try to combine it with my case and try to benefit from this definition as much as I can :) thank you again Shawn. =)
With the latest release of GH (8.0002), now you can just use the new Pick'n'Choose component, it should reduce the number of components and perhaps make the solution more lightweight.

Attachments:

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service