sketchucation logo sketchucation
    • Login
    ⚠️ Attention | Having issues with Sketchucation Tools 5? Report Here

    Hiding edges with fill_from_mesh

    Scheduled Pinned Locked Moved Developers' Forum
    13 Posts 2 Posters 503 Views 2 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.
    • thomthomT Offline
      thomthom
      last edited by

      ❓
      Both got a smooth_flags argument. Is it not working for you? I use fill_from_mesh for my Teapot plugin - smooth edges no problem.

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

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

        No, I had weld set to true. Probably why it won't smooth - since you don't weld the edges together.

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

        1 Reply Last reply Reply Quote 0
        • C Offline
          cjthompson
          last edited by

          I tried using entities.fill_from_mesh(mesh,false,8) and entities.add_faces_from_mesh(mesh,8). it only works on faces with four or less edges.

          Are these the same arguments that you are using?

          1 Reply Last reply Reply Quote 0
          • C Offline
            cjthompson
            last edited by

            even when I set weld to true, I still get the triangulation.

            here is an example:
            I start with this. then I use mesh = face.mesh
            untriangulated.JPG

            but when I try adding the mesh to the entities, it triangulates regardless of the flag setting:
            triangulated.JPG

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

              @cjthompson said:

              I tried using entities.fill_from_mesh(mesh,false,8) and entities.add_faces_from_mesh(mesh,8). it only works on faces with four or less edges.

              Are these the same arguments that you are using?

              You only smooth the edges - that does not hide the edges. Only affects the shading of the connected faces. You must Soft the edges, use 4 or 12.

              See this post for screenshot example of what smooth vs soft vs hidden does: http://forums.sketchucation.com/viewtopic.php?f=15&t=23239&p=196887#p196744

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

              1 Reply Last reply Reply Quote 0
              • C Offline
                cjthompson
                last edited by

                ok. I tried that, but I want to seperate faces that aren't coplanar.

                Basically, I'm trying to go from a face to a mesh, then back to a face again, so there is no visible difference between the original and the face from the mesh. It sounds like that isn't really possible.

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

                  hmm... I've not tried to do that...

                  what if... you use the mesh you get from the face as a temporary mesh. Then iterate the polygons in that mesh and recreate a new one - but in the new one you add negative indexes for the edges you want to hide?

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

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

                    Are you trying to make a script that triangulates the geometry while making it look the same as the original?

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

                    1 Reply Last reply Reply Quote 0
                    • C Offline
                      cjthompson
                      last edited by

                      this script isn't for any use in particular, I'm just trying to get the hang of polygon meshes.

                      the best way to describe what I'm doing is trying to turn all model entities into a mesh, delete the original entities, then put the mesh back, hopefully keeping the original stucture.

                      @thomthom said:

                      what if... you use the mesh you get from the face as a temporary mesh. Then iterate the polygons in that mesh and recreate a new one - but in the new one you add negative indexes for the edges you want to hide?

                      the problem isn't getting the negative numbers, it's making Sketchup recognize those numbers. it seems to completely ignore them. (if you puts face.mesh.polygons, you can see that there are already negative numbers there).

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

                        mesh = Geom::PolygonMesh.new #<Geom::PolygonMesh:0xf631898> mesh.add_point [0,0,0] 1 mesh.add_point [100,0,0] 2 mesh.add_point [0,100,0] 3 mesh.add_point [100,100,0] 4 mesh.add_polygon(1,-2,3) 1 mesh.add_polygon(-2,3,4) 2 Sketchup.active_model.active_entities.fill_from_mesh(mesh) true

                        This sample produces two faces where the edge between them is soft.
                        Note that in my example I don't use any smooth_flags argument. I think that the optional smooth_flags argument overrides the negative indexes if you use it.

                        (also, my example is a bit messed up as the two faces have opposite normals.)

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

                        1 Reply Last reply Reply Quote 0
                        • C Offline
                          cjthompson
                          last edited by

                          It looks like that's what the problem was. Now I just have to figure out how to combine meshes. 😄

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

                            That would either be using Entities.add_faces_from_mesh for each mesh - if its ok to merge them in the Entities collection.

                            Otherwise you need to iterate one mesh and add all the polygons to the other.

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

                            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