Jump to content

Recommended Posts

Posted
How about finding the minimum positive value from a file and starts color from 1 to the end of positive values and same for the negative values.

 

Hows that again?

say for example min is 12.. whats the color? and if its over 255 what color?

-23.5 .... color?

and 0.00 elevation?

  • Replies 33
  • Created
  • Last Reply

Top Posters In This Topic

  • aaryan

    15

  • MSasu

    12

  • pBe

    3

  • stevesfr

    2

Top Posters In This Topic

Posted

So whats your opinion pBe..?

What should we look for?

Posted
So whats your opinion pBe..?

What should we look for?

 

Well.... :unsure:.....

I see that you already "marked" the negative elevations wih an underscore. so it wouldnt matter if its the same color as the equivalent positive value. Also Bigals suggested using a larger range instaed of an increment of one. and you will always have to deal with color going over 255

 

Its your call aaryan. :)

Posted

Thanks and yes you are right.

Posted
SORRY for being very late Steve. I hope you forgive it.

I didnt see your post as it was very late last night in my country.

Anyways Good Morning..

Please find attached block drawing and if you update this routine please post for me too...

[ATTACH]35403[/ATTACH]

 

Thanks and Best Regards

Aaryan

 

Please do reply...

 

@Aaryan... got it, thanks

Steve

Posted

Pbe what I am getting at you have around 240 colours take min and max value then assign a step ratio for a big number if you want a rainbow effect a small number if want minimum colour change you never exceed colour say 250 for us would start at colour 10 prior to this we have set as black.

 

You can take the elevation and work out a ratio number multiple by colour number. say 0-100 is z then say for rl =50, 50/100 = .5*240 =120 plus 10 so use colour 130.

Posted

What should be the code if I want to restrict the colors upto color no.7.

i.e converting all negative into postive and then we'll have a list of all positive values and after that finding a minimum value from a newly made list and starts from color no.1 and after reching the no.7 again starts from 1.

Regards

Aaryan

Posted

You should adjust highlighted number with the desired limit:

(setq theColor (1+ (fix (rem (abs (caddr data)) [color=magenta]7[/color]))))

Posted

Thanks Mircea

But will it work if the elevation in negative..?

 

Regards

Aaryan

Posted

Yes, that example with work with both negative and positive values.

Posted

Oh that's great that means if I have -27 and +27 both will be imported on same color within desired color limit.

Posted

The answer is again yes - the colors will be distributed simmetrically around the origin. To test this please paste the code below on your command prompter:

(progn
(setq theEl -27)
(repeat (1+ (* 2 (abs theEl)))
 (setq theColor (1+ (fix (rem (abs theEl) 7))))
 (print (strcat "\For elevation " (rtos theEl 2 2) " the color is " (itoa theColor) "."))
 (setq theEl (1+ theEl))
)
(princ)
)

Posted

Thank you so much Mircea.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...