• Login
sketchucation logo sketchucation
  • Login
πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

How to detect if two faces are EXACTLY coplanar or not?

Scheduled Pinned Locked Moved Developers' Forum
9 Posts 7 Posters 7.8k Views
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.
  • A Offline
    architectboy
    last edited by 27 Nov 2007, 23:54

    So, I've made a script that erases any lines in-between coplanar faces. The only way that I could think of detecting if they are coplanar is by checking their normals for equality, but the returned normal is an approximation, not the true value πŸ˜• . And thus my script erases lines in-between faces that are close - but not absolutely - co-planar and destroys the faces in the process. Any ideas on how to detect if they are ABSOLUTELY co-planar?
    I've got one... hehe

    1 Reply Last reply Reply Quote 0
    • K Offline
      Krisidious
      last edited by 28 Nov 2007, 00:01

      yeah see that's one thing I know nothing about ruby... and I mean nothing.
      hopefully someone will save us from stumpage.

      By: Kristoff Rand
      Home DesignerUnique House Plans

      1 Reply Last reply Reply Quote 0
      • T Offline
        todd burch
        last edited by 28 Nov 2007, 00:01

        Well, define your use of "coplanar". Coplanar means "on the same plane". So:

        if face1.plane == face2.plane then puts "faces are coplanar" ; end ;

        Now, if you also mean 100% "coincident", then the defined bounding box of each face will match.

        If you mean partially overlapping, then tests would have to be made with various points (vertices) on one face with the bounding box of the other face, and then vice versa as well.

        Todd

        1 Reply Last reply Reply Quote 0
        • A Offline
          architectboy
          last edited by 28 Nov 2007, 00:02

          Well, are plane values exact? That I will check tomorrow. As for stumpage you might still be in it.

          1 Reply Last reply Reply Quote 0
          • G Offline
            Gaieus
            last edited by 28 Nov 2007, 00:02

            @unknownuser said:

            ...As for stumpage you might still be in it.

            Yeah, by 4 minutes...
            πŸ˜„

            Gai...

            1 Reply Last reply Reply Quote 0
            • R Offline
              RickW
              last edited by 28 Nov 2007, 00:03

              @unknownuser said:

              I've got one... hehe

              What's that about?  What do you have?  Can everyone have one?  :smile:
              

              I had to pull out my superhero eyeglasses to read that!

              RickW
              [www.smustard.com](http://www.smustard.com)

              1 Reply Last reply Reply Quote 0
              • J Offline
                Jim
                last edited by 28 Nov 2007, 00:04

                This may not be the best solution, but the logic is sound..

                Check for deleted faces just after erasing the edge, and if the face is also deleted, undo and continue with the next edge in the loop.

                It may not be too costly because the trash loop is already a limited set containing only edges that are candidates for removal. But then again, I've noticed skin.rb can get slow already (not your fault.)

                Hi

                1 Reply Last reply Reply Quote 0
                • A Offline
                  architectboy
                  last edited by 28 Nov 2007, 00:04

                  Ok, I must admit that not knowing how to fix this was pretty stupid. It was the second method I wrote on my first script and I wasn't - and I still am not - very knowledgeable about the API. The only reason that I thought it would stump you guys is that the STUPID google employee at the sketchup help group (not pro) told me that an approximation was as close as I could get 😐 ! Now I know that he is wrong, because planes do give acurite data! And as for the idea that I had I was thinking that if creating a face with the two faces edges (minus the in-between edge) was successful than I could erase the line. And Jim, you said that skin.rb runs slowly, well it does because of how many nested iterations through arrays I had (every face was processed once for every edge it had, every edge was processed twice, and every vertex was processed at least twice for every line attached to it!), it should run faster with the next version.

                  1 Reply Last reply Reply Quote 0
                  • R Offline
                    robint
                    last edited by 1 Oct 2018, 19:40

                    Yeehaaa

                    here's a dummy way with a tetrahedron

                    fudge your model with a face on x,y plane and one edge on the x axis - you hope. this face must be filled

                    draw a flat rectangle joining this edge at both end and extend along the flat plane y. It should fill by itself. the line in between can be removed and it should all fill - if not you screwed up placing your model

                    I think this is fundamental to any modelling (would you start a 2d drg without an origin, scale and xy directions

                    coplanarity.jpg

                    As one door closes another one slams in your face

                    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