How to draw non static Arc's?
-
I was reading the following thread today.
Which leads in to a 2nd issue related to the arcs method:
entities.add_arc(center, xaxis, normal, radius, start_angle, end_angle, <numsegs>)
I'm currently developing a door ruby which will also include the door swing in the xy plane. But since the location of the doors can occur at any angle or quadrant in the xy plane, the arc itself is not really tied down by the 2 end points that define its radius.
the arc simply floats in the xy plane, defined by its "start_angle, end_angle"
the "start_angle, end_angle" for a 90 degree arc will have any one of the values.
pi, pi/2 | 0,pi/2
-----------+---------
-pi/2,-pi | -pi/2,0While this is OK for arcs that are static, or predefined situations:
The above arc's method is quite useless for non static condition where the user is taking control over the location of those 90 degree arcs.I have included an example. Note: that the arc is only correctly placed once, while the door open and door closed lines follow their respective locations, as they should.
Since the arc in SU is really nothing more than a series of short line segments,
I was thinking of developing my own set of short line segments that approximates
an arc, that way I can forget about using this badly thought out arc method altogether.Is there a simpler method that I'm not seeing in the API?
In which case I'm also willing to take back my "badly thought out comments"TIA!
-
You should definitely draw compute the arc yourself. This is simple as I guess the rotation center and radius is known and fixed for a door. It will also allow you to adjust the number of segments based on the angle of overture.
Tell me if you need some code for that in 3D.
Fredo
-
@unknownuser said:
Tell me if you need some code for that in 3D.
Fredo
Thanks! I'll take you up on that offer. I will PM you.
Advertisement