Export/Import of .STL files are corrupt


#1

While running Sketchup 8, I cannot import or export a .STL file without errors. I do not know if it’s the export process because I have no other way of opening the file. The extension I am using is Sketchup SLT import/export from the extension warehouse. Does anyone have a work-around for this issue?
Here is my original drawing:
CogII.skp (1.4 MB)
And here is the converted file:
The site will not allow me to upload the .STL file, so here is a picture:


#2

What are the errors you experience? And at what point in your process do you get the error?

Which release of SketchUp 8 do you have? And what version of the STL extension are you using? (Can you also verify you are using the Import/Export extension from SketchUp and not any of the older variants?)

Can you upload the STL to Dropbox or Google drive or anything?


#3

Oops, I neglected to add STL as an acceptable file type so I just fixed that. I even added .GCODE for fun as well.

From the screenshot you included @brainfarth I don’t think you’re seeing an error specifically, rather there is just a lot of junk in there and SketchUp is having a hard time calculating faces. I’ve run into this many times on an STL import and the sad truth is that sometimes you’ve got to spend time cleaning up if you intend to modify the STL much before printing.

Beyond that, @tt_su is a great resource to leverage when it comes to your importing as he’s got a handful of great Extensions that might simplify your workflow.


#4

The error as I see it is after I export the gear as a STL file and try to re-open that STL file, it’s scale has been reduced to about 1/28th of it’s original size. Also, there are lots of new lines on the model.
This is the extension that I have installed:
https://extensions.sketchup.com/en/content/sketchup-stl

I thought that maybe it was only that file, but all of my attempts are the same result.

I’m running SketchUp version 14.1.1282.

The converted file: https://drive.google.com/file/d/0B-m_DlslssL7YjdhMVFpVlREclU/edit?usp=sharing


#5

STL doesn’t contain any unit information. So applications have no way of knowing if an STL is in mm, cm, m or inches.
With the STL exporter you can specify which unit you want to export it to. I think it defaults to the current model units.

When you import you must set the appropriate unit for the file you open. (Not easy if you don’t know what unit it was exported in.)

The STL format stores the geometry in a triangulated mesh. Any face in SketchUp that isn’t a triangle will become triangulated as you see in your screenshot. There is an option upon import to erase edges between coplanar faces that will clean it up.


#6

Great information. The import options were not set correctly and that was my hangup.
Thanks again.


#7

Yea, it’s easy to miss. It would have been much easier if the STL format had a way to define what unit it used. Then manually setting it wouldn’t be needed and we’d avoid this hit and miss. Alas…


#8

Hi, it happens something similar to me. Before, I could export to STL files without any problem, but whe I updated the extension It started not to work. I’m using Sketchup Pro 2013 and everything works fine except this extension. When I click export and ok it does anything (after disappearing the location selection box), and no file is saved. Sketchup does’t appear to have any bug and it continues working as normal.
Here yo can see what the Ruby Console writes:

Error: #<Errno::ENOENT: No such file or directory - D:\Documents\Holder.stl>
C:/Program Files/SketchUp/SketchUp 2013/Plugins/sketchup-stl/exporter.rb:56:in initialize' C:/Program Files/SketchUp/SketchUp 2013/Plugins/sketchup-stl/exporter.rb:56:innew’
C:/Program Files/SketchUp/SketchUp 2013/Plugins/sketchup-stl/exporter.rb:56:in export' C:/Program Files/SketchUp/SketchUp 2013/Plugins/sketchup-stl/exporter.rb:298:indo_options’
C:/Program Files/SketchUp/SketchUp 2013/Plugins/sketchup-stl/SKUI/events.rb:82:in call' C:/Program Files/SketchUp/SketchUp 2013/Plugins/sketchup-stl/SKUI/events.rb:82:intrigger_event’
C:/Program Files/SketchUp/SketchUp 2013/Plugins/sketchup-stl/SKUI/events.rb:78:in each' C:/Program Files/SketchUp/SketchUp 2013/Plugins/sketchup-stl/SKUI/events.rb:78:intrigger_event’
C:/Program Files/SketchUp/SketchUp 2013/Plugins/sketchup-stl/SKUI/window.rb:357:in event_control_callback' C:/Program Files/SketchUp/SketchUp 2013/Plugins/sketchup-stl/SKUI/window.rb:311:incallback_handler’
C:/Program Files/SketchUp/SketchUp 2013/Plugins/sketchup-stl/SKUI/window.rb:269:in send' C:/Program Files/SketchUp/SketchUp 2013/Plugins/sketchup-stl/SKUI/window.rb:269:inadd_callback’
C:/Program Files/SketchUp/SketchUp 2013/Plugins/sketchup-stl/SKUI/window.rb:203:in call' C:/Program Files/SketchUp/SketchUp 2013/Plugins/sketchup-stl/SKUI/window.rb:203:inshow_modal’
C:/Program Files/SketchUp/SketchUp 2013/Plugins/sketchup-stl/SKUI/window.rb:203:in show' C:/Program Files/SketchUp/SketchUp 2013/Plugins/sketchup-stl/exporter.rb:312:indo_options’
C:/Program Files/SketchUp/SketchUp 2013/Plugins/sketchup-stl/exporter.rb:330

Thank you for your attention!


#9

What about the exporter inserting “.#{unit_abbrev}” between the user filename and the “.stl” extension ?

Like: “gear28.mm.stl” or “gear28.in.stl


#10

If that’s not good enough, does the STL format allow comment lines ?

If so,… then the SketchUp exporter could write specially tagged “magic comments” that have this information.

Then the importer could read these "magic comments."
ie:

# SKP - SketchUp version: 14.1.1282
# SKP - stl exporter: 2.1.4
# SKP - model unit: mm

#11

It may catch on as a useful convention for humans, but other software will not likely support it.

Comments are not supported. There is a 80 character header that could be used. Netfabb adds unit info there, but it is far from a standard.


#12

@mmusicoc

The actual error was eaten by the forum. After this:

Error #

There should have been a less-than symbol < along with the type of error.

Can you re-post the error message using code tags (the </> button on the editor.)


#13

I was specifically referring to SketchUp’s STL plugin, and Thomas’ comment of how the unit needs to be set manually while importing.

I don’t think other apps would care if the was a unit substring in the middle of a filename. They’d just ignore it.

But the SketchUp STL importer could “notice it” just before the extension. So to that end the plugin also writes STL files, so it could also insert these substrings into the filenames (according to a plugin option, if you wish.)

The plugin could also support the “Netfabb” convention, at the same time.


#14

I’d be in favor of adding Netfabs unit comments to the STL extension. I’d rather not create yet another non-standard convention though.


#15

Lists a couple of attributes that might be put into the header as:
“COLOR=RRGGBBAA,MATERIAL=RRRRRRRRHHHHHHHHLLLLLLLL”

I did not find any mention of Netfabb attributes, nor any specification in the available Netfabb manuals.

I would think the various parties involved would want to have a FORMAT attribute such as: “FORMAT=Netfabb” etc.

Perhaps even a EXPORT attribute that names the application that wrote out the STL file.

Just ideas.


#16

I can not find a reference to where I got this information. Now I am not sure netfabb uses the header for units.


#17

For reference:


#18

Here is the error:

`Error: #<Errno::ENOENT: No such file or directory - D:\Documents\Untitled-5495c284.stl>

C:/Program Files/SketchUp/SketchUp 2013/Plugins/sketchup-stl/exporter.rb:56:in initialize' C:/Program Files/SketchUp/SketchUp 2013/Plugins/sketchup-stl/exporter.rb:56:innew’
C:/Program Files/SketchUp/SketchUp 2013/Plugins/sketchup-stl/exporter.rb:56:in export' C:/Program Files/SketchUp/SketchUp 2013/Plugins/sketchup-stl/exporter.rb:298:indo_options’
C:/Program Files/SketchUp/SketchUp 2013/Plugins/sketchup-stl/SKUI/events.rb:82:in call' C:/Program Files/SketchUp/SketchUp 2013/Plugins/sketchup-stl/SKUI/events.rb:82:intrigger_event’
C:/Program Files/SketchUp/SketchUp 2013/Plugins/sketchup-stl/SKUI/events.rb:78:in each' C:/Program Files/SketchUp/SketchUp 2013/Plugins/sketchup-stl/SKUI/events.rb:78:intrigger_event’
C:/Program Files/SketchUp/SketchUp 2013/Plugins/sketchup-stl/SKUI/window.rb:357:in event_control_callback' C:/Program Files/SketchUp/SketchUp 2013/Plugins/sketchup-stl/SKUI/window.rb:311:incallback_handler’
C:/Program Files/SketchUp/SketchUp 2013/Plugins/sketchup-stl/SKUI/window.rb:269:in send' C:/Program Files/SketchUp/SketchUp 2013/Plugins/sketchup-stl/SKUI/window.rb:269:inadd_callback’
C:/Program Files/SketchUp/SketchUp 2013/Plugins/sketchup-stl/SKUI/window.rb:203:in call' C:/Program Files/SketchUp/SketchUp 2013/Plugins/sketchup-stl/SKUI/window.rb:203:inshow_modal’
C:/Program Files/SketchUp/SketchUp 2013/Plugins/sketchup-stl/SKUI/window.rb:203:in show' C:/Program Files/SketchUp/SketchUp 2013/Plugins/sketchup-stl/exporter.rb:312:indo_options’
C:/Program Files/SketchUp/SketchUp 2013/Plugins/sketchup-stl/exporter.rb:330`

Thank you very much for your support! Mario


#19

Can you edit that post, select the whole error message and mark it up as Preformatted Text?


#20

Sorry, I think I solved the problem! If I saved the .skp just before exporting the stl it worked well…