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
      最後由 編輯

      @coronel said:

      Could you please clarify for a 3D newie the purpose of triangulation in this case?
      Does it means the model will be correct or will work better or is merely a way of get more detail?

      If you have a mesh that's rectangular it won't deform consistently. If you triangulate the faces they will... etc.

      TIG

      1 條回覆 最後回覆 回覆 引用 0
      • C 離線
        CPhillips
        最後由 編輯

        I needed the triangulation to prepare a model for export.

        Thanks for incorporating it into your script TIG! Why is it that back facing UV's didn't work?

        1 條回覆 最後回覆 回覆 引用 0
        • C 離線
          CPhillips
          最後由 編輯

          @tig said:

          @cphillips said:

          I needed the triangulation to prepare a model for export.

          Thanks for incorporating it into your script TIG! Why is it that back facing UV's didn't work?

          There is only a method to 'place material textures on a face' - and that assumes a 'front_face' - there's no 'back_face' method...

          Do you mean position_material? It takes a bool for front or back material

          http://code.google.com/apis/sketchup/docs/ourdoc/face.html#position_material

          1 條回覆 最後回覆 回覆 引用 0
          • I 離線
            ideas_arte
            最後由 編輯

            Thanx really useful!

            where download? 😳

            1 條回覆 最後回覆 回覆 引用 0
            • J 離線
              Jim
              最後由 編輯

              @ideas_arte said:

              where download?

              That's a valid question; it is not clear which version is the latest, and it is harder than necessary to locate the download.

              The download is about 5 posts before this one.

              Hi

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

                @cphillips said:

                I needed the triangulation to prepare a model for export.

                Thanks for incorporating it into your script TIG! Why is it that back facing UV's didn't work?

                There is only a method to 'position material textures on a face' - and that assumes a 'front_face' - there's no 'back_face' method ? ...

                TIG

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

                  @cphillips said:

                  @tig said:

                  @cphillips said:

                  I needed the triangulation to prepare a model for export.

                  Thanks for incorporating it into your script TIG! Why is it that back facing UV's didn't work?

                  There is only a method to 'place material textures on a face' - and that assumes a 'front_face' - there's no 'back_face' method...

                  Do you mean position_material? It takes a bool for front or back material

                  http://code.google.com/apis/sketchup/docs/ourdoc/face.html#position_material

                  Duh! 😳 I'll adjust the code and re-post...

                  TIG

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

                    There's something afoot... What I posted before worked - on keeping the front face texture mapping but not on the back_face... Now when I try it it fails to map both faces ? Any ideas - CPhillips's idea worked fine in tests but now seems to fail...

                    TIG

                    1 條回覆 最後回覆 回覆 引用 0
                    • C 離線
                      CPhillips
                      最後由 編輯

                      Post the code and I'll have a look. It might be the face.mesh(1). I think you need to use a different number when you want back uv's as well.

                      1 條回覆 最後回覆 回覆 引用 0
                      • honoluludesktopH 離線
                        honoluludesktop
                        最後由 編輯

                        Hi TIG, Any way to convert this kind of mesh into its component triangles?


                        Drapery05.skp

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

                          @honoluludesktop said:

                          Hi TIG, Any way to convert this kind of mesh into its component triangles?

                          I wrote an example script a few weeks ago to do something like this... http://forums.sketchucation.com/viewtopic.php?p=186068#p186068 ❓

                          TIG

                          1 條回覆 最後回覆 回覆 引用 0
                          • honoluludesktopH 離線
                            honoluludesktop
                            最後由 編輯

                            TIG, Thanks for the link, it works. Now I can make small edits to the (mesh?).

                            1 條回覆 最後回覆 回覆 引用 0
                            • jeff hammondJ 離線
                              jeff hammond
                              最後由 編輯

                              @tig said:

                              Result: it triangulates a face... front Texture UVs are kept.

                              hey TIG,

                              if i run the script on this sphere, the UVs go haywire.
                              am i misunderstanding or misusing the script?
                              thanks

                              [edit] ok, wait.. i just read the rest of the thread and i guess this hasn't been sorted out ?


                              sorry about the size.. i guess i could of used a smaller texture 🙂

                              dotdotdot

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

                                @unknownuser said:

                                @tig said:

                                Result: it triangulates a face... front Texture UVs are kept.

                                hey TIG,

                                if i run the script on this sphere, the UVs go haywire.
                                am i misunderstanding or misusing the script?
                                thanks

                                [edit] ok, wait.. i just read the rest of the thread and i guess this hasn't been sorted out ?

                                It's broken... the UV mapping was CJP's but it still needs fixing...

                                TIG

                                1 條回覆 最後回覆 回覆 引用 0
                                • jeff hammondJ 離線
                                  jeff hammond
                                  最後由 編輯

                                  @tig said:

                                  It's broken... the UV mapping was CJP's but it still needs fixing...

                                  ah, ok..
                                  too bad 😄

                                  [fwiw - i can manually triangulate the sphere using and everything turns out ok.. i guess this script is doing something other than just drawing lines to cut quads in half?]

                                  dotdotdot

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

                                    @unknownuser said:

                                    @tig said:

                                    It's broken... the UV mapping was CJP's but it still needs fixing...

                                    ah, ok..
                                    too bad 😄

                                    [fwiw - i can manually triangulate the sphere using and everything turns out ok.. i guess this script is doing something other than just drawing lines to cut quads in half?]

                                    It triangulates the quads and tries to fix the UV mapping - obviously very badly !!!! CJP help! ❗

                                    TIG

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

                                      See this new script just for selected quad faces - it keeps UV mapping etc...
                                      http://forums.sketchucation.com/viewtopic.php?p=201025#p201025

                                      TIG

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

                                        @tig said:

                                        Known Issues: Back Materials are kept, but these Texture UVs cannot be re-used;
                                        there's a Ruby Console warning message if this problem is found...
                                        Solution: use the front faces only for textures IF you might be triangulating later.

                                        Why is it that you can't preserve the UVs of the backfaces?

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

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

                                          We tried [CJP+me] but we couldn't get it to work - any ideas on fixing the whole issue of triangulation and keep UV mapping to front and back faces would be appreciated...

                                          TIG

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

                                            hm... looking at the code:

                                            mesh=face.mesh(1)
                                            This will give you a PolygonMesh with only the FrontUV.

                                            mesh=face.mesh(3) will give you front and back.
                                            but you need to change this as well: uvs=mesh.uvs(true) true will give you set of front UVs, false will give you back UVs if you specified that in the .mesh method.

                                            I'm not quite sure I understand the purpose of this:
                                            outmesh = Geom::PolygonMesh.new faces.each{|f|outmesh.add_polygon(verts[f[0].abs-1],verts[f[1].abs-1],verts[f[2].abs-1])}
                                            Why create a new PolygonMesh? Rearranging the polygons?

                                            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