Grasshopper

algorithmic modeling for Rhino

Hello

rgb is not very convenient when selecting similar colors. so

i am trying to work with HSL (and possibly with other color space) with the point cloud.

i am using the following c#

System.Drawing.Color color = Color.FromArgb(R, G, B);

    H = color.GetHue();
    S = color.GetSaturation();
    L = color.GetBrightness();

it outputs the values ok, but since add data is currently bugged, i cannot evaluate the point cloud and then cull it.

is there a way to work with HSL, using this or other code, within volvox?

or any other workaround that in general gives access to custom user data within the cloud would be very helpful.

thank you

best

alex

Views: 615

Replies to This Discussion

Hi, 

We're really close to releasing the debugged Volvox, where this bug should not happen. You're always free to go with the expression... the truth is you can write any code for the expression which is one line of code and returns double (and doesn't use any other libraries than system).

Best,

Mateusz

Great news, just saw the add data working, from the other post.!

what would be a one liner expresion for this case of getting Hue and then culling? (if there is any).

sorry my code skills are in an infant state.

cheers.

hm...  while it seems the hue equation could be done with a one huge line of code:

http://stackoverflow.com/questions/2353211/hsl-to-rgb-color-conversion

(its possible to merge this code to one line, srsly).

...you might just want to wait a bit for new volvox. I will make another Expression component where you can actually code with more than one line.

luminance could be done i guess that way :

((max(max(r, g), b) + min(min(r, g), b)) / 2)/255

this gives the values in 0 to 1 domain.

i see, thank you again for the help.

i got discouraged, because i tried using max and floor,before asking, but failed. i guess i did not write em correctly.

will try this again. i am wrapping up the whole thing for delivery.

will wait for the update, to improve the definition.

this plugin combined with anemone opens up lots of possibilities for what i am searching lately.

keep it coming!

cheers

alex

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