Place Spheres with different color and Radii on points on a curve


(Calmunrogue) #1

Hey guys,

I am looking for a way to place a list of spheres with different radii along existing point on a curve.
Currently I have a very basic script, which allows me to control individual spheres,

but I want to be able to import a list of spheres, all with different radii so that I do not have to set the radius for each one. If possible, I would like to make each sphere a different color as well, defined by either a hex code or rgb values. I think the data would look something like this.

0.8, FFFF00 (equals a sphere with a .8mm radius, colored yellow
0.5, FF0000 (equals a sphere with a .5mm radius, colored red (7.3 KB)

Any help would be much appreciated!

Thanks, Callum.

(Michael Pryor) #2

Use a list of sizes equal to the amount of points. Look at components like range, series, distance, ect.


Hope it helps you out… (11.2 KB)

(Calmunrogue) #4

Awesome thanks for the tips, will definitely look into these components.

(Calmunrogue) #5

Hey thanks for the script! It was very helpful :slight_smile:

(Calmunrogue) #6

Hi Michael,

Just wondering if you know how I could go about getting the data into a readable list format. For example if I have ten Radii in a list (1,2,4,3,2,6,8,3) and ten points on a curve, how can I get that data into grasshopper, and how can I get my script to assign a sphere with a specific radii to each point? The problem with components like range and series is they seem to generate a list of numbers based off a few parameters:

Where as I just want to assign specific existing radii to each point. Any advice would be much appreciated!
By the way, love your instagram!

Cheers, Callum.

(Michael Pryor) #7

It is better to generate your list in some way but if you have already some specific number you absolutely need you can input them.

For example if I have ten Radii in a list (1,2,4,3,2,6,8,3)

That’s only 8 numbers so I added 2 more in the example attached. Although GH will use longest list rules by default if you gave 8 it would just repeat the last value for the remaining spheres. I highly suggest you get this book and this pdf so you understand what grasshopper is and how/why it works. (6.9 KB)

(Calmunrogue) #8

Aaaah so simple, thank you so much! Also Thanks for the links, I have been using Rhino for a while but have only just started using grasshopper. Trying to read as much as I can on the subject so these will come in handy.

Cheers, Callum.

(qythium) #9

Fyi, there’s a updated edition of the Grasshopper primer linked above:

and also a web version:

(Michael Pryor) #10

Ah yes was looking for the modelab one but the link on the old gh forum was dead.