Grasshopper

algorithmic modeling for Rhino

Hey guys, I'm having some  trouble calculating the angles of polygons. when I calculate them with rhino the results are fine but when I pair up the lines for in grasshopper and use  the "angle" component between each set of 2 lines I get a result which is 180 minus the value in rhino calculation for some of them. I thought maybe its because its taking a different plane for each pair of lines but even when I inserted the xyz plane to match rhino it didn't work.. any idea as to how to orient this?

p.s: polygon is not planar..

Views: 6481

Attachments:

Replies to This Discussion

By using "Angle" component, computed between 2 vectors, you can solve by using also a "Cross Product" component.

(Assuming you are working on World XY plane)

If the cross product have Z component negative, the resulting angle must be " x = 360 - x " ...

Attachments:

thank you for the reply , but my curve is not planar, it is based off a cloud point so imagine a polygon which is very distorted.. basically I can get each 2lines but getting different results than when I make manual calculation with rhino.. somehow it makes the resilt minus 180 in some cases in grasshopper.. and I don't know how to have them all working in the same realm like in the manual rhino calculation. or even ntell which ones are "flipped" .. than I could unflip them.. I'm adding my def.

Attachments:

A rule is needed to get the inside/outside of the curve, otherwise all angles between 2 curves/vector is always <180°.

Like i did with crossproduct in XY plane....

But in a 3D space with just curves... I dont get how you want to achieve that...

I don't have your plugins.... can you post internalized basic geometries again?

I am posting geometry.. I basically want to get the angles inside the polygon.As you mentioned.. it needs to be defined somehow..I am just not sure how :)

Attachments:

Patch.

We can patch a closed polyline, even if not planar.

(If polyline not closed, I've added a temporary line to close it...)

Not a standard nurbs-surface patch, just a fragmented patch, as a rough calculation is enough and it is also way faster.

To have a single object (not a brep that is a multi-surface) I've converted it to a single mesh.

Now we have an object with a normal property!

Locally, each vertex "check" the normal of the closest point on the mesh to determine if the angle is convex or not.

(Here the logic I've done works back and forth with crossproduct and stuff... hard to explain sorry...)

The definition should work also with simple trees inputs, but some bugs somewhere should be expected...

Last thing:

starting from a point, 2 vectors, define a plane (if not parallel)

if this plane is normal to the patch we've done, it will just be a random choice between treating the angle as convex or not....

The polyline/border (in yellow) of this shape for example:

Except for the 4 corners, the others angles, are convex or not?

boh!

:D

Attachments:

thanks alot, I will check it straight away, one would have thought its a trivial command .. would be nice if there were' out of the box'  tools for face analysis.:)

seems to be working:) thank you so much Riccardo!

Hi guys, I have this situation, I have to rotate a serie of lines on a plane. but I don't know how to tell to gh the measure of each angle. Is there a comand like measure>distance>between objects like rhino?? 

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service