sketchucation logo sketchucation
    • Login
    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!
    πŸ›£οΈ Road Profile Builder | Generate roads, curbs and pavements easily Download

    PolyFace2PolyMesh

    Scheduled Pinned Locked Moved Plugins
    4 Posts 2 Posters 731 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.
    • honoluludesktopH Offline
      honoluludesktop
      last edited by

      Anyone can help me understand the algorithm to take the dxf of a polyface (abbreviated description of a mesh to save space in the database. Illustrated below as a polyline):
      Illustration 1, collection of polyface points as a polyline.

      , and turn it in to this mesh:
      Illustration 2, collection of polyface points as a mesh.

      The original polyface dxf is a collection of polyline vertex (illustration 1). I need help with the algorithm to read my_points(illustration 1) into my_new_pointsfor the following method taken from the api:

      ` my_face = Sketchup.active_model.entities.add_face my_new_points
      my_mesh = my_face.mesh

      Create a new group that we will populate with the mesh.

      group = Sketchup.active_model.entities.add_group
      f_material = Sketchup.active_model.materials[0]
      f_material.color = "green"
      group.add_faces_from_mesh my_mesh, 0, f_material`


      Dxf, collection of points in the form of a polyface.

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

        @honoluludesktop said:

        [ruby:9hkapi4s]my_face = Sketchup.active_model.entities.add_face my_new_points
        my_mesh = my_face.mesh

        This part won't work.
        add_face require coplanar points and creates a flat face.

        You need to create the mesh from skratch:
        PolygonMesh.new

        I just quickly scanned that doc - but from I gather a mesh is a rectangular mesh?

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

        1 Reply Last reply Reply Quote 0
        • honoluludesktopH Offline
          honoluludesktop
          last edited by

          Hmm......, appears you are right. Maybe I have the wrong algorithm? Well, I guess PolyFace2MeshPolygonMesh will remain unimplemented in my translator.

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

            The algorythm in your posted .doc file looks sound - it's just that you need to create a PolygonMesh from scratch - not via a Face.

            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