sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Angle_between issue

    Scheduled Pinned Locked Moved Developers' Forum
    2 Posts 2 Posters 7.0k 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.
    • R Offline
      rinse04
      last edited by

      Hi guys wonder if someone can help.
      I am trying to differentiate the difference between an internal corner and an external corner to get two different angles as shown in the below image.

      https://www.dropbox.com/s/4hygsrmpxslvghl/Capture.JPG?raw=1

      This is the code I am using, which is returning the same angle for all...?

      puts (sel[0].faces[0].normal.angle_between (sel[0].faces[1].normal)).radians
      

      Any help would be greatly appreciated.
      Thanks

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

        @rinse04 said:

        I am trying to differentiate the difference between an internal corner and an external corner to get two different angles as shown in the below image.

        angle_between() returns the angle between 0 and 180 degrees. If you wish the oriented angle, you need to set a reference of some sort to distinguish between concave and convex angles. Look at your model, and make abstraction of the walls, keeping only the vectors, and you'll see that none can make a difference between inside and outside.

        Usually, if you have vectors v1 and v2, say in the horizontal plane, then
        (v1 * v2) % Z_AXIS is either positive or negative. Now, up to you, based on conventions to consider this is an internal or external angle.

        Fredo

        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