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

    Entities.add_face - does order matter

    Scheduled Pinned Locked Moved Developers' Forum
    11 Posts 6 Posters 468 Views 6 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.
    • thomthomT Offline
      thomthom
      last edited by

      When you pass edges to the add_face method, does the order or the edges matter?

      Reason I ask is that I'm trying a script where I take two coplanar faces, collect their edges, then filter away the inner edges, and then try to create a new face which is essentially both the faces joined. It jsut seems that some times it won't create, or the face is invalidated if I Fix Errors.

      Thomas Thomassen — SketchUp Monkey & Coding addict
      List of my plugins and link to the CookieWare fund

      1 Reply Last reply Reply Quote 0
      • Didier BurD Offline
        Didier Bur
        last edited by

        @unknownuser said:

        does the order or the edges matter?

        No, AFAIK

        DB

        1 Reply Last reply Reply Quote 0
        • A Offline
          avariant
          last edited by

          Hm... I'm curious, does edge order control the face winding, which side is the "back side" or the "front side"? I assumed so, but maybe SU just makes some assumptions based on the overall geometry...

          1 Reply Last reply Reply Quote 0
          • W Offline
            Whaat
            last edited by

            @avariant said:

            Hm... I'm curious, does edge order control the face winding, which side is the "back side" or the "front side"? I assumed so, but maybe SU just makes some assumptions based on the overall geometry...

            i am pretty sure the order of points controls the front side of the face

            SketchUp Plugins for Professionals

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

              The order definitely matters. And its not discussed in the Ruby docs, as far as I know. Its even more important if its followed by a pushpull. I seem to recall you want to enter your points clockwise when creating a face. If you enter your points anticlockwise then a pushpull will produce an object with the faces reversed.

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

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

                If you visualize the face you are creating as being drawn CCW, then when the face is created, you'll be looking at the front.

                If you visualize the face and you draw CW, you'll be looking at the back when the face is created.

                Faces created on plane z=0 will always have their normal pointing towards -Z.

                Todd

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

                  You can test this by hand too. Establish a front elevation, and with the line tool, draw a box. CCW you'll get white. CW you'll get blue.

                  1 Reply Last reply Reply Quote 0
                  • thomthomT Offline
                    thomthom
                    last edited by

                    So the order matters for what's side is being up or down?

                    But does it matter for the face being created? Should all edges be organised so that edges connected to each other comes after each other in the array passed?

                    Thomas Thomassen — SketchUp Monkey & Coding addict
                    List of my plugins and link to the CookieWare fund

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

                      @thomthom said:

                      So the order matters for what's side is being up or down?

                      Well, depending on if you care what the orientation of the face normal is, yes. An alternative approach is to just draw the face, and then figure out out if it has the normal you want, and if not, .reverse! it. And, remember it's not about "up or down". It's all about direction. On a typically drawn cube, you have 6 faces, each pointing in their own direction, having opposite faces pointing in opposite directions.

                      @thomthom said:

                      But does it matter for the face being created? Should all edges be organised so that edges connected to each other comes after each other in the array passed?

                      This is a most fundamental concept - it absolutely makes a difference. Trying to draw a four sided face with two points swapped will give you an hourglass shape with overlapping, non-intersecting lines, and possibly even an invalid face.


                      SketchUp031-1.png

                      1 Reply Last reply Reply Quote 0
                      • thomthomT Offline
                        thomthom
                        last edited by

                        Ok, I had a feeling something like that happened. Just wasn't sure if SU sorted the edges before generating.

                        Thomas Thomassen — SketchUp Monkey & Coding addict
                        List of my plugins and link to the CookieWare fund

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

                          You are very welcome.

                          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