sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Export faces and vertices plugin to CSV - does one exist?

    Scheduled Pinned Locked Moved Plugins
    10 Posts 4 Posters 1.1k Views 4 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.
    • N Offline
      Nyal Mellor
      last edited by

      Here's what I am looking for...

      A way to extract vertices and faces (think this is correct terminology) to a CSV.

      Vertices would have X, Y, Z coordinates with a number ID
      Faces would be triangulated sets of X, Y, Z coordinates

      e.g.

      Vertices:
      1 0, 0, 0
      2 1, 0, 0
      3 1, 1, 0
      4 0, 1, 0

      Faces
      1 2 3
      1 3 4

      1 Reply Last reply Reply Quote 0
      • BoxB Offline
        Box
        last edited by

        I don't know about Faces but you can certainly export Vertices
        http://sketchucation.com/forums/viewtopic.php?p=298614#p298614
        Also Search the pluginstore and the extension warehouse for csv and see if there is anything to suit.

        1 Reply Last reply Reply Quote 0
        • N Offline
          Nyal Mellor
          last edited by

          Thanks. I think some of the 3D exports will export faces and this information could be reused but I haven't dug into it yet. I'm not enough of a Sketchup expert to know how to write some code to do this.

          1 Reply Last reply Reply Quote 0
          • T Offline
            Trogluddite
            last edited by

            @nyal mellor said:

            Thanks. I think some of the 3D exports will export faces and this information could be reused

            This is certainly possible - I have done something similar here, exporting as OBJ, then using a custom Ruby script to parse out the vertices and faces.

            I think that whatever file type you export from SU, you're going to need to do some processing on the output. You may find the free mesh editor 'MeshLab' useful - this can read and write a huge range of 3D files - many of them are simple text data if you look at them in Notepad, so you can choose whichever gives you the least work to do.

            Assuming that you may need to do the editing by hand, the '3D triangulated surface (.GTS)' format looks like a good candidate. This is a simple text format containing lists of numbers - first the vertices (three numbers per line), then edges (indexes of the end vertices), then triangles (three vertex indexes). A line at the file start declares how many of each there are. The vertex index is not explicitly written at the start of each line - they are assumed to be in whatever order they are listed in the file (this is pretty common in all 'text' 3D files). If you can manage without the explicit numbering, then the editing is simple - simply replace space characters with commas in a text editor, and delete the 'edges' section that you don't need.

            1 Reply Last reply Reply Quote 0
            • sdmitchS Offline
              sdmitch
              last edited by

              Check Personal Messages for a possible solution.

              Nothing is worthless, it can always be used as a bad example.

              http://sdmitch.blogspot.com/

              1 Reply Last reply Reply Quote 0
              • N Offline
                Nyal Mellor
                last edited by

                Thanks for the help so far. sdmitch I tried your plugin and it works 95%. There are a couple of triangulated faces that it generates that are reversed and also there are a couple of triangular faces that it generates that are not there in the model. I've ensured the model is solid and has no internal faces, or at least I think I have. It says I don't have enough posts to send you a PM yet.

                http://www.acousticfrontiers.com/wp-content/uploads/2014/10/Capture.png

                1 Reply Last reply Reply Quote 0
                • sdmitchS Offline
                  sdmitch
                  last edited by

                  Not sure how I would ever figure out if a face is reversed or how it generates faces that didn't exist. Perhaps there is a break in an edge that is not a corner.

                  Nothing is worthless, it can always be used as a bad example.

                  http://sdmitch.blogspot.com/

                  1 Reply Last reply Reply Quote 0
                  • N Offline
                    Nyal Mellor
                    last edited by

                    I thought that might be the case but I verified the model is solid with the Outer Shell tool. The method Trogluddite proposed seems to produce a cleaner output but the export from MeshLab isn't working properly...only half the vertices are exported from MeshLab for some reason.

                    1 Reply Last reply Reply Quote 0
                    • N Offline
                      Nyal Mellor
                      last edited by

                      OK I figured this out and will post here for others who may need to do similar thing.

                      Here's the method:

                      1. export from sketchup to OBJ format. Even with sketchup OBJ export set to not export lines and textures it still does, which makes the OBJ very hard to understand. I think this is a sketchup bug
                      2. import from OBJ using MeshLab
                      3. do whatever cleanup you need. In my case I need to remove zero area faces
                      4. export from MeshLab to OBJ, deselect all tick boxes during export, result is that OBJ file is now clean..first section is vertices, second is faces. Note GTS export from MeshLab seems to have a bug as it does not export all vertices
                      5. import to Excel as space delimited file
                      6. copy and paste into your other programs

                      Success!

                      1 Reply Last reply Reply Quote 0
                      • sdmitchS Offline
                        sdmitch
                        last edited by

                        In my limited tests, it seems to me that my plugin works as expected. However I can't know if what I'm testing is anything like reality. So if you could post a model of the sample depicted in your previous post, it would be appreciated.

                        Nothing is worthless, it can always be used as a bad example.

                        http://sdmitch.blogspot.com/

                        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