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

    [Plugin] triangulateFaces.rb v1.2 20101120

    Scheduled Pinned Locked Moved Plugins
    97 Posts 21 Posters 109.1k Views 21 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.
    • bac9-flclB Offline
      bac9-flcl
      last edited by

      Greetings.

      I've encountered a problem with this plugin. Here's the deal: I am making a complex building, looking like that:


      http://img.gameru.net/th/65082.jpg

      Of course, it consists of a hundreds of separate components, because I don't need any unnecessary polycount. For example, here are the outer walls:


      http://img.gameru.net/th/a4015.jpg

      http://img.gameru.net/th/3697a.jpg

      As you can see, they are divided with edges. Some were made to allow different texturing (e.g. leaks under the windows), and some - to ensure that triangulation made during the import process via Autodesk Connection Extension (which seems, by the way, to be the only way to export your model from SU without breaking it) won't look like a messy web full of thin invalid faces.

      However, CE repeatedly fails to triangulate T-type face connections properly:

      http://img.gameru.net/th/75605.jpg

      Here is how it should look like:

      http://img.gameru.net/th/d3095.jpg

      And there are the examples how CE (or standart 3DS Max triangulation, maybe CE is just utilizing it) works with such faces:

      http://img.gameru.net/th/42a40.jpg

      http://img.gameru.net/th/3697d.jpg

      Of course it's not your problem, but Max/CE, so let's move onto the subject. To ensure this weirdness won't appear in my model after Max import, I must draw all triangulation on risky areas by myself, in SU, before using Connection Extension.

      It's quite easy to guess that I hate to spend time for this. It would take hours to complete hand-made triangulation with Line tool for every T-shaped area. So I searched for some SU plugin which can make a triangulation of selected faces, - your seems to be the most used πŸ˜„

      I tried the plugin:

      http://img.gameru.net/th/380a1.jpg

      http://img.gameru.net/th/767b6.jpg

      Seemed to work fine, but when I tried it on a bit harder areas, it didn't went so smooth:

      http://img.gameru.net/th/e1cda.jpg

      http://img.gameru.net/th/39e2b.jpg

      These edges are missing:

      http://img.gameru.net/th/318e3.jpg

      Another area:

      http://img.gameru.net/th/1fc3c.jpg

      http://img.gameru.net/th/ce385.jpg

      http://img.gameru.net/th/8b639.jpg

      I decided to test it on the simple T-shaped face without pre-drawn edges. Unfortunately, I got this:

      http://img.gameru.net/th/42a40.jpg

      Is there some kind of a rule I don't know? Something like "non-convex faces are forbidden"? πŸ˜„

      It's just strange to encounter the same issue again in a completely different software, with an area I can't call hard to triangulate at all. There are no geometrical paradoxes, every man can connect these points with proper lines, - then why a triangulation is improper?

      To be exact, the problem seems to be related not only to T-shaped faces, but to non-convex faces (in some curcumstances) and to faces with divided straight edges:
      [url=http://img.gameru.net/?v=5feed.jpg:3a0jr4pg][img:3a0jr4pg]http://img.gameru.net/th/5feed.jpg[/img:3a0jr4pg][/url:3a0jr4pg]

      Here I got a more complex example:
      [url=http://img.gameru.net/?v=6afdd.jpg:3a0jr4pg][img:3a0jr4pg]http://img.gameru.net/th/6afdd.jpg[/img:3a0jr4pg][/url:3a0jr4pg]

      Surprisingly, it was triangulated properly:
      [url=http://img.gameru.net/?v=05e4c.jpg:3a0jr4pg][img:3a0jr4pg]http://img.gameru.net/th/05e4c.jpg[/img:3a0jr4pg][/url:3a0jr4pg]

      Then I've added the line:
      [url=http://img.gameru.net/?v=73f56.jpg:3a0jr4pg][img:3a0jr4pg]http://img.gameru.net/th/73f56.jpg[/img:3a0jr4pg][/url:3a0jr4pg]

      Just as planned:
      [url=http://img.gameru.net/?v=36011.jpg:3a0jr4pg][img:3a0jr4pg]http://img.gameru.net/th/36011.jpg[/img:3a0jr4pg][/url:3a0jr4pg]

      Or let's use some dividing under windows:
      [url=http://img.gameru.net/?v=c24bb.jpg:3a0jr4pg][img:3a0jr4pg]http://img.gameru.net/th/c24bb.jpg[/img:3a0jr4pg][/url:3a0jr4pg]

      Then we have 4-sided faces again:
      [url=http://img.gameru.net/?v=62060.jpg:3a0jr4pg][img:3a0jr4pg]http://img.gameru.net/th/62060.jpg[/img:3a0jr4pg][/url:3a0jr4pg]


      Sorry for being so talkative πŸ˜„

      [url=http://img.gameru.net/?v=5feed.jpg:3a0jr4pg][img:3a0jr4pg]http://img.gameru.net/th/5feed.jpg[/img:3a0jr4pg][/url:3a0jr4pg]
      ^ So here's the ultimate question: is there a way to fix the triangulation of such areas?

      1 Reply Last reply Reply Quote 0
      • bac9-flclB Offline
        bac9-flcl
        last edited by

        @thomthom said:

        Try this plugin: http://forums.sketchucation.com/viewtopic.php?f=323&t=21472
        Use the UV probe and hit F2 to see SU's internal triangulation. What do you get then? Would that triangulation be ok?


        http://img.gameru.net/th/f6c83.jpg

        Oh, nice, it's internal triangulation 😞

        Should we ask SU team to fix it then?

        SU is heavily oriented for Push/Pull boolean operations which easily produce surfaces with holes, non-convex surfaces and other kinds of complex geometry, so it's very important issue. I don't use Push/Pull for anything complex, but thousands of users do - and it means thousands of SU models have such surfaces. Same as they have zero-area or 4-sided faces bug.

        Maybe it doesn't affect SU and Google Earth performance, but these faces are considered invalid and unacceptable in other 3d software or game engines. For example, I can't use any model with "invalid" faces in X-Ray Engine (S.T.A.L.K.E.R.).

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

          Here's v1.2 http://forums.sketchucation.com/viewtopic.php?p=175613#p175613
          This should now trap any '4-sided' "triangles" made by the 'mesh' process as it forces an intersection of all new entities and adds edges should a "triangle's" vertices > 3...

          TIG

          1 Reply Last reply Reply Quote 0
          • CadFatherC Offline
            CadFather
            last edited by

            Tig,

            is there anyway to split the resulting triangles as well? suppose you wanted to subdivide the mesh even further (perhaps there is a script already..)

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

              @cadfather said:

              Tig,

              is there anyway to split the resulting triangles as well? suppose you wanted to subdivide the mesh even further (perhaps there is a script already..)

              I think there's a subdivide tool somewhere...

              TIG

              1 Reply Last reply Reply Quote 0
              • CadFatherC Offline
                CadFather
                last edited by

                ok (search shows Whaat's SDS)

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

                  I'm probably thinking of RickW's simpler free tool - referred to here... http://forums.sketchucation.com/viewtopic.php?p=278060#p278060 and available here http://www.smustard.com/script/Subdivide

                  TIG

                  1 Reply Last reply Reply Quote 0
                  • CadFatherC Offline
                    CadFather
                    last edited by

                    thanks TIG but that will 'smooth' the shape - i'm only thinking of dividing

                    i think there is the difficulty of internal (read infernal..) faces being generated

                    split.jpg

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

                      My Addvertex+ tool http://rhin.crai.archi.fr/rubylibrarydepot/plugin_details.php?id=8
                      lets you add a vertex on a face and divides it into triangles with new edges...

                      TIG

                      1 Reply Last reply Reply Quote 0
                      • CadFatherC Offline
                        CadFather
                        last edited by

                        ok TIG, i'll have a look, thanks as always

                        1 Reply Last reply Reply Quote 0
                        • bac9-flclB Offline
                          bac9-flcl
                          last edited by

                          @tig said:

                          Here's v1.2 http://forums.sketchucation.com/viewtopic.php?p=175613#p175613
                          This should now trap any '4-sided' "triangles" made by the 'mesh' process as it forces an intersection of all new entities and adds edges should a "triangle's" vertices > 3...

                          Thanks a lot! I've finally got my models into X-Ray SDK 😍


                          http://img.gameru.net/th/035c3.jpg

                          http://img.gameru.net/th/583ba.jpg


                          http://img.gameru.net/th/7099f.jpg

                          http://img.gameru.net/th/12959.jpg

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

                            Hiya,

                            I downloaded this plugin with the goal of importing my Sketchup models into Unreal Developers Kit (UDK).
                            But even though the faces are triangled ok, when I import my model in UDK most the triangles are really messed up.
                            Like this:

                            http://photos2.pix.ie/E2/45/E2458AAC3155407588F70888B4B391C8-0000316933-0002622418-00800L-6AC7C78B1057411F8E2C7FDD5C50FCC1.jpg

                            I suppose this doesn't indicate any problem with triangulatefaces.rb, but rather UDK.
                            Has anybody else tried to this? Would love some advice. πŸŽ‰

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

                              Are the normals in the SketchUp model oriented properly?

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

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

                                Well, all the white faces are pointed out, if that's what you mean.
                                I don't think SU offers many options regarding normals.
                                Do you mean smoothing?

                                I tried again using a more simple model but results are the same.
                                Tried toying around with the 2 options in the Soften Edges window, but got the same results.

                                http://photos3.pix.ie/6F/66/6F66B36E6F514077AF8492334650BE09-0000316933-0002622789-01024L-BA9A361F41C24665A7F2488CC916D358.jpg

                                http://photos3.pix.ie/81/B4/81B4B45B36564B10A0B88215CE4D824E-0000316933-0002622790-01024L-A57B864FEDBF40F0A23B1A8759AAC34F.jpg

                                I'm confident people are able to put SU content into UDK, there's another ruby script exporter someone made called "HardPCM", but it produces the same results for me.
                                So i'm not using that script atm.

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

                                  This app seems to be smoothing the coplanar edges - they are not smooth in the SKP.
                                  Have you tried switching off its 'preserve smooth groups' options etc?

                                  TIG

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

                                    nice observation!

                                    I turned the quality slider down to 0 and found an option in the drop-down box that gives a better result.
                                    Not flawless though.
                                    It's one for the UDK forums at any rate.
                                    Thanks for the help.

                                    favicon

                                    (photos2.pix.ie)

                                    1 Reply Last reply Reply Quote 0
                                    • M Offline
                                      mustafashredder
                                      last edited by

                                      @TIG

                                      Could you please post a download link to the .rbz file for your script. I cant load .rb file and it wont show up in sketchup when I copy the .rb file to the directory.

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

                                        @mustafashredder said:

                                        @TIG

                                        Could you please post a download link to the .rbz file for your script. I cant load .rb file and it wont show up in sketchup when I copy the .rb file to the directory.
                                        This thread is superseded by a new one - linked in the first post.
                                        That in turn had the v1.2 .rb - but it is now linked to the RBZ at the PluginStore entry http://sketchucation.com/forums/viewtopic.php?p=175613#p175613

                                        Please learn to use the search at the PluginStore page... e.g.
                                        http://sketchucation.com/pluginstore?listtype=1%26amp;author=0%26amp;category=0%26amp;search=triangulate%26amp;submit=%3F

                                        However, if you are having trouble manually adding a .rb, then loading it you might have inadequate permissions to add files to your Plugins folder... which might also affect the AutoInstall of RBZ content...
                                        Fix these in Properties > Security > Edit... giving every entry in the list FULL read/write permissions...

                                        TIG

                                        1 Reply Last reply Reply Quote 0
                                        • 1
                                        • 2
                                        • 3
                                        • 4
                                        • 5
                                        • 1 / 5
                                        • First post
                                          Last post
                                        Buy SketchPlus
                                        Buy SUbD
                                        Buy WrapR
                                        Buy eBook
                                        Buy Modelur
                                        Buy Vertex Tools
                                        Buy SketchCuisine
                                        Buy FormFonts

                                        Advertisement