Grasshopper

algorithmic modeling for Rhino

Sort angles (by negatif) and replace

Thank you for reading
I have a curve im (xy)plane
divided by some points.
At each point i evaluate the tangent and measure the angle between the tangent and x-axis vector as reference.
Some angles are positif some other negatif.
I need all angles positif or negatif.
So i need to call something which can recognize the negatif angle in order to rotate them.
What function (component) can recognize the negatif. And how to replace the vector by the new rotated vector?
I read this topic
http://www.grasshopper3d.com/forum/topics/why-the-angle-between-vec...

But still dont get it?
Regards

Views: 808

Replies to This Discussion

If your angles go from -180 to +180, but you'd rather they went from 0 to 360, then just add 360 to every angle and then use the [Mod] component to wrap it back down into the 0...360 range.

Thank for answer 

may be the difficulty for me is to update the list with vectors with new list (after i picked some vectors

and applied a rotation to get the positive angle).

i need to replace the vectors (which are base a points from two curves).

Is it simplier just to remap the points by coordinates so that all my vectors become positive? Instead of trying to rotate vectors and remap vectors? (which i dont know how to do).

One again thank you Dvid Rutten

Attachments:

adding 360 works but how can i apply only on a part of my list and 

put back into my principal list the rotated vectors?

i use smaller than 0 to identify the vectors i need to rotate then cull

then dont know how to put them back

(Insert, or replace, remap) Confused!! and mis-understanding

how those can work.

 

Use "sift" instead of cull (I prefer the workflow over cull + list replace, it keeps null placeholders in a list that you can then combine back into later). Then rotate the vectors you need to rotate (they will either be in list "0" or list "1" from sift outputs). So if the ones you need to rotate are in "0" output of sift rotate those. Then get a "combine" component. Plug the sift output "1" (your unchanged vectors) into the "1" input of combine. Plug the vectors you changed into the "0" input of combine. 

This assumes your neg vectors are in "0" and that depends on your boolean pattern. If the neg vectors go into "1" then do same as above but manipulate the "1" data and keep the "0" data.

Part of file which was difficult is Working now
With you help.

Thank you and regards
Thank Mr. David Rutten and Mr. Mickael Pryor

here a picture of the Gh. files

where it is stopping me.

I guess the difficulty beguins with the idea to build the vectors from two curves.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service