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

[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.
  • T Offline
    thomthom
    last edited by 1 Jun 2010, 11:00

    hmm...? Are you using Sandbox tools to modify the geometry afterwards?

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

    1 Reply Last reply Reply Quote 0
    • W Offline
      Woz2007
      last edited by 1 Jun 2010, 11:41

      Yes.
      Should I be using an alternative?!

      1 Reply Last reply Reply Quote 0
      • T Offline
        thomthom
        last edited by 1 Jun 2010, 11:47

        That is causing the UV to distort, not the triangulation.
        The flip function in sandbox doesn't preserve UV mapping when flipping.

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

        1 Reply Last reply Reply Quote 0
        • G Offline
          Gaieus
          last edited by 1 Jun 2010, 12:16

          @thomthom said:

          The flip function in sandbox doesn't preserve UV mapping when flipping.

          Sorry Woz; that was my suggestion I know...

          Thom; any other idea? Rewriting the sandbox tools for instance?
          ๐Ÿ˜‰

          (Or maybe some vertex edit tools?)
          ๐Ÿ˜ฎ

          Gai...

          1 Reply Last reply Reply Quote 0
          • W Offline
            Woz2007
            last edited by 1 Jun 2010, 12:36

            @gaieus said:

            Sorry Woz; that was my suggestion I know...
            ๐Ÿ˜ฎ

            No worries Gaeius Im grateful for whatever help I can get ๐Ÿ˜‰

            I should really introduce myself & what Im trying to achieve.
            So Im a hobby artist that fell upon Sketchup back in version 3. Ive found it to be the most user friendly UI for quickly pulling a model together albeit somewhat quirky. Ive tried other apps like 3DSM, Maya, Lightwave etc & those intefaces are just too over complex for simple modelling. PLUS they come with extreme pricetags. SU for me was a happy medium.
            The models Im creating are for use with the Unreal 2.5 engine for the development community of this application: http://avayalive.com/WaStore/Overview.aspx
            There are a few problems that I need to be able to overcome.

            Unreal uses meshes in a triangulated form & uses vertex lighting so I need to be able to see the mesh in a triangulated form prior to exporting & allow me to be able to edit those triangles so that the vertex lighting is shown correctly. At current some bad triangles are shown with hard shadows on flat surfaces due to the nature of the triangulation created. With the ability to edit those triangles I can quickly edit the mesh in SU PRE-EXPORT so the creation doesnt have these issues. Other apps such as 3DSM recommend re-tesselating the mesh to breakdown the triangles into smaller surfaces, however this also is detrimental as it increases the polycount, which is at a premium considering the overall level created.

            Gaeius recommended the use of this script along with the sandbox "flip edge" tool to see if it would solve the problem. Whilst the triangulation script works the UV as we now know is messed up with the flip edge tool affecting the polygons UV mapping.

            So is there a suitable solution that can meet my needs?
            BTW: the .alive project is something I plan to open up to the SU community in the coming weeks as there is a lot of potential for modelling, texturing etc & all with a small learning curve they could soon be developping whole environments ๐Ÿ˜„ Some projects also have funding!!

            1 Reply Last reply Reply Quote 0
            • T Offline
              thomthom
              last edited by 1 Jun 2010, 13:51

              @gaieus said:

              Thom; any other idea? Rewriting the sandbox tools for instance?

              something like that.

              @gaieus said:

              (Or maybe some vertex edit tools?) ๐Ÿ˜ฎ

              I do have plans of making Vertex Edit keep UV mapping when modifying geometry. But probably not fro initial release. But it won't help in this case as it would not flip edges.

              It's a real shame that UV coordinates doesn't stick in SU when you modify geometry - that each tool would need to implement a feature to keep them.

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

              1 Reply Last reply Reply Quote 0
              • W Offline
                Woz2007
                last edited by 1 Jun 2010, 14:02

                damn...sounds like theres no easy solution.
                Could a UV script not be written that uses a similiar situation to align face but align UV ? Please excuse my ignorance if Im talking gibberish.

                1 Reply Last reply Reply Quote 0
                • T Offline
                  thomthom
                  last edited by 1 Jun 2010, 14:05

                  I do have plans for some UV tools, but I have some other projects lined up first.
                  I have done some experimenting with making UVs "sticky".

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

                  1 Reply Last reply Reply Quote 0
                  • G Offline
                    Gaieus
                    last edited by 1 Jun 2010, 14:16

                    Ag imagine Crish's Shape bender or FredoScale with sticky UV's!
                    What an easy thing it would be to make cool arches is no time!

                    Gai...

                    1 Reply Last reply Reply Quote 0
                    • W Offline
                      Woz2007
                      last edited by 1 Jun 2010, 14:27

                      @thomthom said:

                      I do have plans for some UV tools, but I have some other projects lined up first.
                      I have done some experimenting with making UVs "sticky".

                      Cheers ThomThom. Ill look at if Whaats UV solution wors for me in the meantime.
                      http://forums.sketchucation.com/viewtopic.php?f=323&t=23725&hilit=uv+mapper

                      .Alternatively I can fix the triangles & export to Accutrans & resolve the UV there.

                      1 Reply Last reply Reply Quote 0
                      • T Offline
                        thomthom
                        last edited by 1 Jun 2010, 14:28

                        I hope to make Sticky UVs into a framework that can easily be added to plugins.

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

                        1 Reply Last reply Reply Quote 0
                        • W Offline
                          Woz2007
                          last edited by 1 Jun 2010, 16:42

                          Hmmm,.. i think Ive found something interesting by accident though.

                          If you create an object then use this script to triangulate the face then apply a material & then use the sandbox Flip Edge tool....the UV appears to be untouched.

                          -However-

                          If you create an object then apply a material then use this script to triangulate the face & then use the sandbox Flip Edge tool....the UV gets messed up.

                          ..so it looks more like a process issue?!?!?!?

                          1 Reply Last reply Reply Quote 0
                          • B Offline
                            blair
                            last edited by 22 Aug 2010, 20:38

                            I installed the "[Plugin] triangulateFaces.rb v1.1" and tried it on the simple flat face with material shown below but it only creates 2 triangles. How can you get more triangulation?


                            TriangulateFaces.png

                            1 Reply Last reply Reply Quote 0
                            • jeff hammondJ Offline
                              jeff hammond
                              last edited by 22 Aug 2010, 20:51

                              hey blair.. this plugin simply changes everything to triangles instead of quads or more..

                              you're looking for more of a subdivision type of thing:
                              sd.jpg

                              that was done with subdivide and smooth (available at smustard) but i believe there is another subdivision plugin out there that is free and will do what i think you want (although way less functional than whaat's subdivide and smooth).

                              dotdotdot

                              1 Reply Last reply Reply Quote 0
                              • B Offline
                                blair
                                last edited by 22 Aug 2010, 21:09

                                Thanks Jeff,

                                Now I understand that one better. I have seen Subdivide and Smooth and it does a lot more than I can ever imagine needing so I would like to find the free one you mentioned for now.

                                1 Reply Last reply Reply Quote 0
                                • pilouP Offline
                                  pilou
                                  last edited by 22 Aug 2010, 21:28

                                  @unknownuser said:

                                  so I would like to find the free one you mentioned for now.

                                  no problem ๐Ÿ˜‰
                                  Subdive and Smooth (basic free) http://www.smustard.com/script/Subdivide by Ricks Wilson

                                  Frenchy Pilou
                                  Is beautiful that please without concept!
                                  My Little site :)

                                  1 Reply Last reply Reply Quote 0
                                  • B Offline
                                    blair
                                    last edited by 22 Aug 2010, 23:20

                                    Thanks PILOU!

                                    I just tried that one on the flat plane I had previously shown and it did nothing. What I would like to do is create a multitude of triangles like Jeff had shown on the far right in the example he posted.

                                    1 Reply Last reply Reply Quote 0
                                    • T Offline
                                      thomthom
                                      last edited by 20 Nov 2010, 09:57

                                      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?

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

                                      1 Reply Last reply Reply Quote 0
                                      • bac9-flclB Offline
                                        bac9-flcl
                                        last edited by 20 Nov 2010, 10:07

                                        Upd: I've figured out what conditions are needed to reproduce the bug (all dimensions are multiple of 1m in this example; if it matters):

                                        http://img.gameru.net/th/7a004.jpg

                                        @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?

                                        Thanks, will try it and post about result ๐Ÿ˜„

                                        1 Reply Last reply Reply Quote 0
                                        • bac9-flclB Offline
                                          bac9-flcl
                                          last edited by 20 Nov 2010, 10:13

                                          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
                                          • 1
                                          • 2
                                          • 3
                                          • 4
                                          • 5
                                          • 4 / 5
                                          • First post
                                            Last post
                                          Buy SketchPlus
                                          Buy SUbD
                                          Buy WrapR
                                          Buy eBook
                                          Buy Modelur
                                          Buy Vertex Tools
                                          Buy SketchCuisine
                                          Buy FormFonts

                                          Advertisement