sketchucation logo sketchucation
    • 登入
    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!
    ⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update

    [Plugin] triangulateFaces.rb v1.2 20101120

    已排程 已置頂 已鎖定 已移動 Plugins
    97 貼文 21 Posters 110.6k 瀏覽 21 Watching
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • TIGT 離線
      TIG Moderator
      最後由 編輯

      Here's v1.1 http://forums.sketchucation.com/viewtopic.php?p=175613#p175613
      ☀
      Thanks to Thomtom's knowledge of uvs mapping etc it now successfully triangulates any face [even with holes like Swiss Cheese] and keeps the front AND back uv texture mapping as it was ! Thanks!

      TIG

      1 條回覆 最後回覆 回覆 引用 0
      • GaieusG 離線
        Gaieus
        最後由 編輯

        Hi TIG,

        Would it be possible for the plugin to triangulate faces with a more "even" or "regular" triangles? After this topic, I thought maybe pre-triangulating the face on the ramp would spare some extra hand-work but it seems that the plugin triangulates the faces just exactly the same way native SU does when autofolding.


        TriangulateFaces.jpg


        TriangulateFaces.skp

        Gai...

        1 條回覆 最後回覆 回覆 引用 0
        • TIGT 離線
          TIG Moderator
          最後由 編輯

          @gaieus said:

          Hi TIG,
          Would it be possible for the plugin to triangulate faces with a more "even" or "regular" triangles? After this topic, I thought maybe pre-triangulating the face on the ramp would spare some extra hand-work but it seems that the plugin triangulates the faces just exactly the same way native SU does when autofolding.

          TriangulateFaces uses the built-in SUp mesh making methods, which presumably match the auto-fold ones, hence the similarity.
          You might have noticed that my ExtendEdgesByRails script does produce a neat set of faces as that can't use the mesh methods directly but has to make up its own...
          Using EEbyRails is a MUCH simpler way of making a curved ramp - I've attached an example...EEbyRailsSimpleRamp1.pngEEbyRailsSimpleRamp2.pngEEbyRailsSimpleRamp.skp

          TIG

          1 條回覆 最後回覆 回覆 引用 0
          • GaieusG 離線
            Gaieus
            最後由 編輯

            Thanks TIG for the examples - although my question was more a bit "academical" and theoretical - but at least I know why the two meshes are similar.

            Certainly the other twoo tools are also great and would probably fit more to this particular need - that moving of the face was just so simple method - too bad autofold screws it up.

            Gai...

            1 條回覆 最後回覆 回覆 引用 0
            • thomthomT 離線
              thomthom
              最後由 編輯

              @gaieus said:

              Certainly the other twoo tools are also great and would probably fit more to this particular need - that moving of the face was just so simple method - too bad autofold screws it up.

              This triangulation would be a separate plugin. It's just too specific. But I've been thinking of this myself. I often find I want such partitioning. It seems that it's usually long strip of a face where two of the sides runs parallel-ish to each other. So you want an edge to go between each opposite vertex. I've had it on my list of things to do - just not got around to it yet.

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

              1 條回覆 最後回覆 回覆 引用 0
              • A 離線
                alz
                最後由 編輯

                Yeah, I agree -- having a more uniform triangulation method is preferred. It makes things a lot easier developing models if it's more uniformed and less "meet all at one point".

                With the current method, I have to spend time flip-flopping various divisions (and sometimes just recutting the face).

                😄

                1 條回覆 最後回覆 回覆 引用 0
                • W 離線
                  Woz2007
                  最後由 編輯

                  @tig said:

                  ###,
                  Plugin parts by TIG**. 20090729
                  v1.1
                  Rewritten entirely by TIG... THEN completely corrected by Thomthom (TT)!***
                  It now retains all Texture mapping successfully. 20091203

                  [attachment=0:kz9i3jbr]<!-- ia0 -->triangulateFaces.rb<!-- ia0 -->[/attachment:kz9i3jbr]

                  Im using this & seeing the UV mapping failing...is this the latest version?!

                  1 條回覆 最後回覆 回覆 引用 0
                  • thomthomT 離線
                    thomthom
                    最後由 編輯

                    Got a sample of where it fails?

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

                    1 條回覆 最後回覆 回覆 引用 0
                    • W 離線
                      Woz2007
                      最後由 編輯

                      @thomthom said:

                      Got a sample of where it fails?

                      If you look at the texture in the tringle before & after you will see that it is affected. When I export the model as a mesh the surface is indeed messed up.

                      I hope the image is enough to work from?!
                      Thnaks for looking into this. This script could save me a lot of hassle if working correctly 😄


                      before & after shot

                      1 條回覆 最後回覆 回覆 引用 0
                      • thomthomT 離線
                        thomthom
                        最後由 編輯

                        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 條回覆 最後回覆 回覆 引用 0
                        • W 離線
                          Woz2007
                          最後由 編輯

                          Yes.
                          Should I be using an alternative?!

                          1 條回覆 最後回覆 回覆 引用 0
                          • thomthomT 離線
                            thomthom
                            最後由 編輯

                            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 條回覆 最後回覆 回覆 引用 0
                            • GaieusG 離線
                              Gaieus
                              最後由 編輯

                              @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 條回覆 最後回覆 回覆 引用 0
                              • W 離線
                                Woz2007
                                最後由 編輯

                                @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 條回覆 最後回覆 回覆 引用 0
                                • thomthomT 離線
                                  thomthom
                                  最後由 編輯

                                  @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 條回覆 最後回覆 回覆 引用 0
                                  • W 離線
                                    Woz2007
                                    最後由 編輯

                                    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 條回覆 最後回覆 回覆 引用 0
                                    • thomthomT 離線
                                      thomthom
                                      最後由 編輯

                                      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 條回覆 最後回覆 回覆 引用 0
                                      • GaieusG 離線
                                        Gaieus
                                        最後由 編輯

                                        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 條回覆 最後回覆 回覆 引用 0
                                        • W 離線
                                          Woz2007
                                          最後由 編輯

                                          @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 條回覆 最後回覆 回覆 引用 0
                                          • thomthomT 離線
                                            thomthom
                                            最後由 編輯

                                            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 條回覆 最後回覆 回覆 引用 0
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 5
                                            • 2 / 5
                                            • 第一個貼文
                                              最後的貼文
                                            Buy SketchPlus
                                            Buy SUbD
                                            Buy WrapR
                                            Buy eBook
                                            Buy Modelur
                                            Buy Vertex Tools
                                            Buy SketchCuisine
                                            Buy FormFonts

                                            Advertisement