SketchUp / sketchup-stl

A SketchUp Ruby Extension that adds STL (STereoLithography) file format import and export.
http://extensions.sketchup.com/content/sketchup-stl
MIT License
248 stars 68 forks source link

Error exporting this model #173

Closed thomthom closed 7 years ago

thomthom commented 7 years ago

https://forums.sketchup.com/t/export-to-stl-list-errors/55898/1

FaceBug.zip

Export in mm binary.

SketchUp STL Exporter:
An error occured during export.

undefined method `-' for nil:NilClass
C:/Users/tthomas2/SourceTree/sketchup-stl/src/sketchup-stl/exporter.rb:226:in `get_vertex_order'
C:/Users/tthomas2/SourceTree/sketchup-stl/src/sketchup-stl/exporter.rb:127:in `write_face_binary'
C:/Users/tthomas2/SourceTree/sketchup-stl/src/sketchup-stl/exporter.rb:102:in `call'
C:/Users/tthomas2/SourceTree/sketchup-stl/src/sketchup-stl/exporter.rb:102:in `write_face'
C:/Users/tthomas2/SourceTree/sketchup-stl/src/sketchup-stl/exporter.rb:80:in `block in find_faces'
C:/Users/tthomas2/SourceTree/sketchup-stl/src/sketchup-stl/exporter.rb:77:in `each'
C:/Users/tthomas2/SourceTree/sketchup-stl/src/sketchup-stl/exporter.rb:77:in `find_faces'
C:/Users/tthomas2/SourceTree/sketchup-stl/src/sketchup-stl/exporter.rb:84:in `block in find_faces'
C:/Users/tthomas2/SourceTree/sketchup-stl/src/sketchup-stl/exporter.rb:77:in `each'
C:/Users/tthomas2/SourceTree/sketchup-stl/src/sketchup-stl/exporter.rb:77:in `find_faces'
C:/Users/tthomas2/SourceTree/sketchup-stl/src/sketchup-stl/exporter.rb:84:in `block in find_faces'
C:/Users/tthomas2/SourceTree/sketchup-stl/src/sketchup-stl/exporter.rb:77:in `each'
C:/Users/tthomas2/SourceTree/sketchup-stl/src/sketchup-stl/exporter.rb:77:in `find_faces'
C:/Users/tthomas2/SourceTree/sketchup-stl/src/sketchup-stl/exporter.rb:84:in `block in find_faces'
C:/Users/tthomas2/SourceTree/sketchup-stl/src/sketchup-stl/exporter.rb:77:in `each'
C:/Users/tthomas2/SourceTree/sketchup-stl/src/sketchup-stl/exporter.rb:77:in `find_faces'
C:/Users/tthomas2/SourceTree/sketchup-stl/src/sketchup-stl/exporter.rb:68:in `export'
C:/Users/tthomas2/SourceTree/sketchup-stl/src/sketchup-stl/exporter.rb:341:in `block in do_options'
C:/Users/tthomas2/SourceTree/sketchup-stl/src/sketchup-stl/SKUI/events.rb:82:in `call'
C:/Users/tthomas2/SourceTree/sketchup-stl/src/sketchup-stl/SKUI/events.rb:82:in `block in trigger_event'
C:/Users/tthomas2/SourceTree/sketchup-stl/src/sketchup-stl/SKUI/events.rb:78:in `each'
C:/Users/tthomas2/SourceTree/sketchup-stl/src/sketchup-stl/SKUI/events.rb:78:in `trigger_event'
C:/Users/tthomas2/SourceTree/sketchup-stl/src/sketchup-stl/SKUI/window.rb:357:in `event_control_callback'
C:/Users/tthomas2/SourceTree/sketchup-stl/src/sketchup-stl/SKUI/window.rb:311:in `callback_handler'
C:/Users/tthomas2/SourceTree/sketchup-stl/src/sketchup-stl/SKUI/window.rb:269:in `block in add_callback'
C:/Users/tthomas2/SourceTree/sketchup-stl/src/sketchup-stl/SKUI/window.rb:203:in `call'
C:/Users/tthomas2/SourceTree/sketchup-stl/src/sketchup-stl/SKUI/window.rb:203:in `show_modal'
C:/Users/tthomas2/SourceTree/sketchup-stl/src/sketchup-stl/SKUI/window.rb:203:in `show'
C:/Users/tthomas2/SourceTree/sketchup-stl/src/sketchup-stl/exporter.rb:362:in `do_options'
C:/Users/tthomas2/SourceTree/sketchup-stl/src/sketchup-stl/exporter.rb:375:in `main'
C:/Users/tthomas2/SourceTree/sketchup-stl/src/sketchup-stl/exporter.rb:395:in `block in <module:Exporter>'
SketchUp:1:in `call'
thomthom commented 7 years ago

This is some degenerate face:

face = Sketchup.active_model.find_entity_by_persistent_id(17819)

face.area
#> -60277.677227039174

face.mesh.points
#> []
face.vertices.map(&:position)
#> [Point3d(533.677, 593.799, 482.355), Point3d(422.913, 589.904, 382.243), Point3d(421.302, 497.748, 380.786), Point3d(451.409, 495.798, 407.999), Point3d(531.302, 490.625, 480.208)]