sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    Mac User? | Join the Rayscaper Beta for Mac Learn More

    [REQ] Detect Overlaps mode

    Scheduled Pinned Locked Moved Plugins
    12 Posts 4 Posters 1.8k 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.
    • jolranJ
      jolran
      last edited by

      If the geometry isent grouped the result would be randomized unless you find a way to put mindreading into code..

      Another way to put it is finding out if a face has a hole, but it wont be foolproof..
      But it would only be for visual purposes ?

      Sketchup.active_model.selection.grep(Sketchup;;Face).each{|face| face.material = "orange" if face.loops.length > 1 }
      
      1 Reply Last reply
      Reply Quote 0
      • R
        rv1974
        last edited by

        For visual purposes only! Kinda quality control before exporting.

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

          ok..

          Looking at your Picture again I see that the faces are all "simple polygons" without holes. So this oneliner wont work. I overlooked this fact.

          I have a feeling this is not so simple to solve since we don't have any reference to compare with (?)
          It's easy to visually see the letters and how they should be formed, but in code it's just another polygon with the same properties as it's neighbours.

          I don't have time to dig deeper into this right now, maybe later..

          1 Reply Last reply
          Reply Quote 0
          • G
            glro
            last edited by

            @rv1974 said:

            I'm really missing a visual mode that would clearly show all areas with overlapping faces. It'd solve many problems in export\rendering.

            Thanks in advance.

            it might be easier to achieve this considering a volume, instead of a surface

            and since your letters are 3d, you might consider transform them into solids

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

              @unknownuser said:

              it might be easier to achieve this considering a volume, instead of a surface

              and since your letters are 3d, you might consider transform them into solids

              I agree.

              However I think Rv1974 is after a general purpose face overlapping detection.

              Thought about it during lunch, and can perhaps be solved if looking at face vertices winding order and comparing those with adjecent faces in the plane. Or maybe not 😄

              I don't have time to work on this though.. But an interesting problem.

              1 Reply Last reply
              Reply Quote 0
              • R
                rv1974
                last edited by

                @unknownuser said:

                However I think Rv1974 is after a general purpose face overlapping detection.

                Exactly! Those letters were used for illustrating purposes only. And it supposed to be a heavy duty thing- displaying relatively large geometry.

                1 Reply Last reply
                Reply Quote 0
                • D
                  driven
                  last edited by

                  if each item has material, Visualizer quickly shows any overlaps...
                  circles0059.png

                  to fix them in code it is probably quickest to filter bounding box max/min of each item...

                  once filtered you could jitter them a tiny amount to avoid z fighting that shows up in renderers...

                  to check if a model [containing only solids] has any overlaps...

                  original_count = 0
                  ents = Sketchup.active_model.active_entities
                  ent_n = ents.length
                  ents.each do|e|
                    original_count += e.definition.entities.grep(Sketchup;;Face).length
                  end
                  sel = Sketchup.active_model.selection
                  Sketchup.active_model.active_entities.each do|e|
                    sel.add(e) if sel.length == 0
                    sel[0].outer_shell(e) if sel.length == 1
                  end
                  shell_count = sel[0].definition.entities.grep(Sketchup;;Face).length
                  if shell_count != original_count
                    p original_count - shell_count
                    ent_n.times{Sketchup.undo}
                    # run a jitter code
                  end
                  

                  john

                  learn from the mistakes of others, you may not live long enough to make them all yourself...

                  1 Reply Last reply
                  Reply Quote 0
                  • R
                    rv1974
                    last edited by

                    So you suggest to render in application A in order to eliminate defects in application B.
                    I'm not sure it's heading in right direction.

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

                      @Rv1974 when you say "overlapping" faces where you refering to Z-fighting where non-intersected faces lie on top of each other ,as Driven has shown ?

                      Cause the first Picture show intersected faces which would mean a whole different thing, and dare I say quite more complicated algorithm...

                      Otherwise Driven's boundingbox tests idea might work.

                      1 Reply Last reply
                      Reply Quote 0
                      • R
                        rv1974
                        last edited by

                        All possible directions of course. And NOT 'solids'- SU is not about solids at all.

                        1 Reply Last reply
                        Reply Quote 0
                        • D
                          driven
                          last edited by

                          @rv1974 said:

                          ...SU is not about solids at all.

                          SU has some very fast methods for handling solids that take forever on non-solid geometry...

                          The only reason for the overlapped geometry is sloppy modelling that can be more easily fixed if all are grouped solids...

                          are you importing the bad topography?

                          which renderer is failing to accept the errors?

                          are you really still using SU v8 Pro?

                          learn from the mistakes of others, you may not live long enough to make them all yourself...

                          1 Reply Last reply
                          Reply Quote 0

                          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                          With your input, this post could be even better 💗

                          Register Login
                          • 1 / 1
                          • First post
                            Last post
                          Buy SketchPlus
                          Buy SUbD
                          Buy WrapR
                          Buy eBook
                          Buy Modelur
                          Buy Vertex Tools
                          Buy SketchCuisine
                          Buy FormFonts

                          Advertisement