Applying gradient to custom shape

Hi Rhino Community,

I have a grasshopper question. My main task has been to map earthquakes for the last 100 years in Bangladesh. I have managed to map the location of the previously mentioned earthquakes and I have altered the icon pinpointing the epicentres by associating a + sign to them.

I have also set out to change their size depending on their magnitude. I am now hitting a wall with associating colour to the + shaped curves depending on the magnitude. There seems to be a problem with my range of magnitude. Supposedly the scale component is picking up a 0 somewhere. I have checked the CSV files, without finding a single 0 magnitude earthquake there. I don’t know if the issue comes from there…

Perhaps someone here will find what has eluded me for so long now. (36.0 KB)
(There should be a .csv, .3dm & .gh in this zip)

There is no error on your script, just enable preview on your last component and diable the others.
As you remap value from [1.7 to 8.6] to [0 to 20] 1.7 becomes 0.0 => so the problem of scaling.
Just remap correctly for scaling and it will be OK.

1 Like

yes, I just changed 0.0 to 0.1 and it worked perfectly
(also, in case you’re going through an allnighter… you have preview off for the custom preview component -in case you missed it!) :slight_smile: :slight_smile: :slight_smile:

@laurent_delrieu & @anikolo thanks for your help guys. Turning on the preview doesn’t seem to change anything on my machine. Are you both using pc or mac?

Did you disable that ?
“only preview geometrye for selected object” because with this mode there are no color as your object is selected !

What are coordinate system you use ?

Nope, I haven’t disabled it. From memory, it was Universal Transverse Mercator Zone 46

here it is my file it works well with your file csv. You need also your 3dm to have the cross (not internalized) (23.5 KB)

1 Like

Awesome, it works! Thanks Laurent.

I Can see the parts you have added to my definition but I don’t understand how they affect the definition as they aren’t linked back to any components?

Also, you mention “not internalised” what do you mean by that?

Apologies for my lack of knowledge really just starting out with the software.

The part I added whas just useful for me to understand where was the problem. You can delete that.
Grasshopper script can store geometry text Colors … so you don’t need 3dm. If you right click on curve where you get the cross you can click on internalise. So your script will no more need 3dm.
Hope it is clear.