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

    Two identical faces, but show just one

    Scheduled Pinned Locked Moved Developers' Forum
    10 Posts 4 Posters 698 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.
    • N Offline
      niccah
      last edited by

      Hi!

      I have the following problem: I have two identical (in the view of position) faces. One is green, the other one grey. Sketchup shows these two faces now with a little bit grey and a little bit green, and it changes by rotating the view.

      Is there a possibility to push one of these two faces to a higher "level"? Means, it is possible to show just the green one?

      To be honest, I don't know the right englisch words descriping this situation, to do a serious search in google and in your forum respectively...

      Thanks a lot for your help!

      1 Reply Last reply Reply Quote 0
      • cottyC Offline
        cotty
        last edited by

        The effect is called z-fighting. You can not give them a different priority to avoid this. You can

        • move them to different positions (a little bit)
        • hide one of them
        • ...

        my SketchUp gallery

        1 Reply Last reply Reply Quote 0
        • N Offline
          niccah
          last edited by

          @cotty said:

          The effect is called z-fighting. You can not give them a different priority to avoid this. You can

          • move them to different positions (a little bit)
          • hide one of them
          • ...

          Ahh okay, thanks a lot for your help! I will try to hide the affected faces....

          1 Reply Last reply Reply Quote 0
          • jolranJ Offline
            jolran
            last edited by

            You can always make the face into a component and glue the component onto the other face. They will not "Z-fight" then.

            1 Reply Last reply Reply Quote 0
            • N Offline
              niccah
              last edited by

              Hey Joel! Thanks for your help! What exactly do you mean by
              @jolran said:

              and glue the component onto the other face
              ?

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

                @niccah said:

                Hey Joel! Thanks for your help! What exactly do you mean by
                @jolran said:

                and glue the component onto the other face
                ?

                http://support.google.com/sketchup/bin/answer.py?hl=en&answer=114523
                http://support.google.com/sketchup/bin/answer.py?hl=en&answer=114533
                http://www.youtube.com/watch?v=LsyC-Sd8LJM
                http://www.sketchup.com/intl/en/developer/docs/ourdoc/componentinstance#glued_to=

                Sorry for just a set of links, but, I should be wrapping up presents instead of surfing the interwaves.

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

                1 Reply Last reply Reply Quote 0
                • N Offline
                  niccah
                  last edited by

                  Oh thanks a lot! I think, with the help of your links, I will be able so solve the problem!

                  1 Reply Last reply Reply Quote 0
                  • jolranJ Offline
                    jolran
                    last edited by

                    Thomthom's links tells you how it works. Sometimes the API can be hard to understand. Also we don't know where exact you are in your code.
                    But you can group the face and then turn the group into an component.
                    I think its easier to work with groups at first and then at some point turn it into an instance-component when ready to glue to a face. Just a personal preference.
                    Dont know how you want to group your face but be careful not to group Sketchup entities directly(add_group(entities). It can BUGsplat.
                    And then use the behavior to glue. Lets say you have made your component and it's called inst.

                    You get the behavior with: be = inst.defintion.behavior
                    You have all the behavior methods in the API. But for gluing you will need to add:
                    be.is2d = true
                    be.cuts_opening = true
                    be.snapto = 0

                    So lets say your second face you want to glue onto is called face2.

                    Then you just add inst.glued_to = face2

                    Don't have time to give you more code just now. Maybe Thomthom get back to you after he have packed all his presents πŸ˜„

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

                      Alternatively, if the faces both have transparent materials it will avoid the Z-fighting.

                      But... why do you even have two faces overlapping anyway? It's generally something to avoid in any 3d modelling.

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

                      1 Reply Last reply Reply Quote 0
                      • N Offline
                        niccah
                        last edited by

                        At first at all, thank you very much for all your help! I will try it at weekend.

                        @thomthom said:

                        But... why do you even have two faces overlapping anyway? It's generally something to avoid in any 3d modelling.

                        Following situation in my plugin:

                        • you have a model
                        • you choose a part of this model, which you like to get milled (for example a pocket)
                        • after you have choosen it and add it to the "milling list", my plugin will copy this choosen faces into a hidden group
                        • when you click on the list, the "to be milled" faces (I collored it green) will be shown
                        • with the help of the hidden faces, the plugin is independent of the real model => so, before calculating the GCode, the user is allowed to change the model itself

                        I hoped, I could explained my situation understandably πŸ˜„

                        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