sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    How to draw non static Arc's?

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 329 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T Offline
      tomot
      last edited by

      I was reading the following thread today.

      http://groups.google.com/group/Ruby-API/browse_thread/thread/c5796526ccbf5e89/381313a3bce457d8?lnk=gst&q=arc#

      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,0

      While 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!


      DoorArc.skp

      [my plugins](http://thingsvirtual.blogspot.ca/)
      tomot

      1 Reply Last reply Reply Quote 0
      • fredo6F Offline
        fredo6
        last edited by

        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

        1 Reply Last reply Reply Quote 0
        • T Offline
          tomot
          last edited by

          @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.

          [my plugins](http://thingsvirtual.blogspot.ca/)
          tomot

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Buy SketchPlus
          Buy SUbD
          Buy WrapR
          Buy eBook
          Buy Modelur
          Buy Vertex Tools
          Buy SketchCuisine
          Buy FormFonts

          Advertisement