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

    Edge Orientation on a Rectangle

    Scheduled Pinned Locked Moved Developers' Forum
    4 Posts 4 Posters 169 Views 4 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
      tpoz
      last edited by

      Hello all,
      I have a script that i have been running quite frequently for quite a few months. It seemed to work nicely and consistently, but now it has suddenly changed and I'm wondering if it has something to do with the start and end positions of edges on rectangle faces being changed. I'll explain a bit more...
      So, my plug-in would require the user to draw a rectangle and select the two edges between the point/vertex where the rectangle was initiated (after some time I found the convention of how the edge vectors were oriented). But since mid-January this convention has suddenly changed (I think) and the layout that is drawn on top of this rectangle and depends on this orientation has changed.

      Am I imagining this?
      Does anyone have any insights on this?

      laura

      1 Reply Last reply Reply Quote 0
      • J Offline
        Jim
        last edited by

        I'm not sure you can make any assumptions about edge direction. Perhaps when first creating the rectangle.

        But once geometry has started intersecting, there is no way to guess what SketchUp has done.

        The bottom line is if your plugin requires a certain order, you must check and correct the geometry; or write the plugin so it is not dependent on the order.

        Hi

        1 Reply Last reply Reply Quote 0
        • Chris FullmerC Offline
          Chris Fullmer
          last edited by

          And I've found that if you draw a line and test it's vertex order, then copy and paste the line, the new line will not always keep the same direction. Same for more complex shapes such as a rectangle, etc. The copied shape will often get all dis-organized. Recreating the order of the edges endpoints, in order, is how I generally tackle this.

          Chris

          Lately you've been tan, suspicious for the winter.
          All my Plugins I've written

          1 Reply Last reply Reply Quote 0
          • TIGT Offline
            TIG Moderator
            last edited by

            If the rectangle has a face then face.outer_loop.vertices are always listed counterclockwise [right-hand rule].
            You can test if a face and its edge are 'reversed?' too...

            TIG

            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