Grasshopper

algorithmic modeling for Rhino

Hi everyone,

I'm having a little problem of logic which I can't seem to solve.  What I'm looking to do is have a domain/s to test angles against which wraps around the domain of 0-180.

So for example I could have a testing range of 30 degrees which could have a bounds of:

75-105

or 0-30

or 150-180

OR, and here's the tricky bit...

0-15 and 165-180

0-5 and 155-180

This image perhaps shows the problem more clearly.

Any help would be greatly appreciated,

James

Views: 570

Replies to This Discussion

I've seemingly solved my problem.  Not sure if the solution could have been more elegant, if you have a better solution I'd love to see it :)

J

Attachments:

I think I understand what you are aiming for but if I'm wrong can you spell it out in words with only one syllable.

Attachments:

Thanks Danny,

That was exactly what I was after.  Sorry if my wording wasn't clear.  Your solution was much cleaner than mine.

Cheers,

J

I don't actually have time right now, but I'd solve this by creating an arc with the correct angle domain and then find the Closest Point to see if a value is on the arc or not.

--

David Rutten

david@mcneel.com

wouldn't that only work if the domain wrapped from 360 to 0

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service