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!
    Mac User? | Join the Rayscaper Beta for Mac Learn More

    [Plugin] PLY Importer

    Scheduled Pinned Locked Moved Plugins
    33 Posts 7 Posters 111.1k Views 7 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.
    • D
      driven
      last edited by

      yep, there some very good .ply figures out there for just dropping in for a render and casting off... and group scale and move well enough.

      cheers
      jhon

      learn from the mistakes of others, you may not live long enough to make them all yourself...

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

        I've been looking around at the various ruby based importers for SketchUp and I see that no one uses the Importer class. If this class is used the importer can be found in the native import list which would be very nice.
        http://code.google.com/apis/sketchup/docs/ourdoc/importer.html

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

        1 Reply Last reply
        Reply Quote 0
        • J
          Jim
          last edited by

          Yeah, I used it on a ascii/binary .stl importer I wrote - works well.

          Hi

          1 Reply Last reply
          Reply Quote 0
          • charly2008C
            charly2008
            last edited by

            Hi Jim,

            Thank you very much. It works very well.

            Charly

            He who makes no mistakes, makes nothing

            1 Reply Last reply
            Reply Quote 0
            • J
              Jim
              last edited by

              @charly2008 said:

              Thank you very much. It works very well.

              Thanks, I am as surprised as you. 😆

              Hi

              1 Reply Last reply
              Reply Quote 0
              • T
                tomws
                last edited by

                <Newbie alert>
                I'm trying to understand how to use this plugin (ultimately want to use it to import a terrain mesh). I've 'installed' the plugin and, to try it out, I copied the simple cube shown in http://paulbourke.net/dataformats/ply/ into a file called 'simple_cube.ply' as follows:
                ply
                format ascii 1.0 { ascii/binary, format version number }
                comment made by Greg Turk { comments keyword specified, like all lines }
                comment this file is a cube
                element vertex 8 { define "vertex" element, 8 of them in file }
                property float x { vertex contains float "x" coordinate }
                property float y { y coordinate is also a vertex property }
                property float z { z coordinate, too }
                element face 6 { there are 6 "face" elements in the file }
                property list uchar int vertex_index { "vertex_indices" is a list of ints }
                end_header { delimits the end of the header }
                0 0 0 { start of vertex list }
                0 0 1
                0 1 1
                0 1 0
                1 0 0
                1 0 1
                1 1 1
                1 1 0
                4 0 1 2 3 { start of face list }
                4 7 6 5 4
                4 0 4 5 1
                4 1 5 6 2
                4 2 6 7 3
                4 3 7 4 0

                I then open SketchupPro V8 and select this plugin from the plugin menu. I select the 'simple_cube.ply' file and get the following result on the Ruby Console:
                Error: #<NoMethodError: undefined method times' for nil:NilClass> C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/jf_ply_importer.rb:104:in parse_faces'
                C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/jf_ply_importer.rb:102:in each' C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/jf_ply_importer.rb:102:in parse_faces'
                C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/jf_ply_importer.rb:51:in parse' C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/jf_ply_importer.rb:208:in ply_import'
                C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/jf_ply_importer.rb:231
                C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/jf_ply_importer.rb:104:in `call'
                C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/jf_ply_importer.rb:104

                Uh, what am I doing wrong?

                And, if I get past this, what units should I set my vertices to (currently in feet, inches, fractional inches)?

                Thanks in advance,
                Tom

                1 Reply Last reply
                Reply Quote 0
                • J
                  Jim
                  last edited by

                  Hi Tom,

                  From the paragraph just before the example you copied... "The comments in brackets are NOT part of the file, they are annotations to this example."

                  Remove them and the file will import.

                  Hi

                  1 Reply Last reply
                  Reply Quote 0
                  • T
                    tomws
                    last edited by

                    😳 Ooops. I feel like such a dweeb...

                    Thanks for being kind.

                    May I infer from the resulting cube, that 'units' are in inches and I need to convert all my dimensions to float inches?

                    Tom

                    Update: Worked like a champ! Thanks for your help!

                    1 Reply Last reply
                    Reply Quote 0
                    • J
                      Jim
                      last edited by

                      @unknownuser said:

                      May I infer from the resulting cube, that 'units' are in inches and I need to convert all my dimensions to float inches?

                      Well, the .ply file format does not specify units at all, but SketchUp defaults to inches internally.

                      It's possible to add a units selection dialog for the importer, but the easiest thing to do is just scale the imported geometry to get the size you need.

                      Hi

                      1 Reply Last reply
                      Reply Quote 0
                      • J
                        Jim
                        last edited by

                        Just a note - my .ply plugin has been adopted by SketchUp, and the code is being hosted on Github. It should soon be available in the Extensions Warehouse.

                        Hi

                        1 Reply Last reply
                        Reply Quote 0
                        • D
                          driven
                          last edited by

                          that's great news jim

                          didn't you say " - it's hardly worth the effort for such an obscure file format. "

                          john

                          learn from the mistakes of others, you may not live long enough to make them all yourself...

                          1 Reply Last reply
                          Reply Quote 0
                          • K
                            kaas
                            last edited by

                            @jim said:

                            ...It should soon be available in the Extensions Warehouse.

                            It didn't make the warehouse? I cant find it searching for 'ply'. Has it been renamed maybe? Trying the one on github now.

                            1 Reply Last reply
                            Reply Quote 0
                            • J
                              Jim
                              last edited by

                              The code is probably not up to par for an official release to the EW. I wrote a lot of code years ago while I was out of work and had a lot of time. That was about 5 years ago. Since then, I have not had the time or energy to maintain the plugins and earn a living at the same time.

                              The code on Github is currently the best version to download.

                              Hi

                              1 Reply Last reply
                              Reply Quote 0

                              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                              With your input, this post could be even better 💗

                              Register Login
                              • 1
                              • 2
                              • 2 / 2
                              • First post
                                Last post
                              Buy SketchPlus
                              Buy SUbD
                              Buy WrapR
                              Buy eBook
                              Buy Modelur
                              Buy Vertex Tools
                              Buy SketchCuisine
                              Buy FormFonts

                              Advertisement