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..
Tags:
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.
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 :)
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...
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
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!
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by