From cb5dc998360828da652d66a384809e74f2c0ed2c Mon Sep 17 00:00:00 2001 From: Thomas Thomassen Date: Tue, 25 Feb 2014 13:27:12 +0100 Subject: [PATCH 1/6] Adding Sublime Text project with settings set up to follow the style guide. --- .gitignore | 1 + SketchUp STL.sublime-project | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 .gitignore create mode 100644 SketchUp STL.sublime-project diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5ab1b2e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.sublime-workspace diff --git a/SketchUp STL.sublime-project b/SketchUp STL.sublime-project new file mode 100644 index 0000000..e8859a2 --- /dev/null +++ b/SketchUp STL.sublime-project @@ -0,0 +1,23 @@ +{ + "folders": + [ + { + "follow_symlinks": true, + "path": "." + } + ], + "settings": + { + "default_encoding": "UTF-8", + "ensure_newline_at_eof_on_save": true, + "rulers": + [ + 80 + ], + "show_encoding": true, + "show_line_endings": true, + "tab_size": 2, + "translate_tabs_to_spaces": true, + "trim_trailing_white_space_on_save": true + } +} From 0e48d521d537981ec208ae1a205f1d2cf69b5c40 Mon Sep 17 00:00:00 2001 From: Thomas Thomassen Date: Tue, 25 Feb 2014 13:27:54 +0100 Subject: [PATCH 2/6] Removing unnecessary whitespace. --- src/sketchup-stl.rb | 16 ++--- src/sketchup-stl/css/base.css | 2 +- src/sketchup-stl/exporter.rb | 4 +- src/sketchup-stl/html/importer.html | 10 +-- src/sketchup-stl/importer.rb | 6 +- src/sketchup-stl/js/base.js | 28 ++++---- src/sketchup-stl/js/importer.js | 10 +-- src/sketchup-stl/loader.rb | 6 +- src/sketchup-stl/translator.rb | 82 ++++++++++++------------ src/sketchup-stl/utils.rb | 14 ++-- src/sketchup-stl/webdialog_extensions.rb | 22 +++---- 11 files changed, 100 insertions(+), 100 deletions(-) diff --git a/src/sketchup-stl.rb b/src/sketchup-stl.rb index 362b3ed..ee78ce0 100644 --- a/src/sketchup-stl.rb +++ b/src/sketchup-stl.rb @@ -10,32 +10,32 @@ module CommunityExtensions module STL - + PLUGIN_ROOT_PATH = File.dirname(__FILE__) PLUGIN_PATH = File.join(PLUGIN_ROOT_PATH, 'sketchup-stl') PLUGIN_STRINGS_PATH = File.join(PLUGIN_PATH, 'strings') - + Sketchup::require File.join(PLUGIN_PATH, 'translator') options = { :custom_path => PLUGIN_STRINGS_PATH, :debug => false } @translator = Translator.new('STL.strings', options) - + # Method for easy access to the translator instance to anything within this # project. - # + # # @example # STL.translate('Hello World') def self.translate(string) @translator.get(string) end - + extension = SketchupExtension.new( STL.translate('STL Import & Export'), File.join(PLUGIN_PATH, 'loader.rb') ) - + extension.description = STL.translate( 'Adds STL file format import and export. ' << 'This is an open source project sponsored by the SketchUp team. More ' << @@ -44,8 +44,8 @@ def self.translate(string) extension.version = '2.0.3' extension.copyright = '2012 Trimble Navigation, released under Apache 2.0' extension.creator = 'J. Foltz, N. Bromham, K. Shroeder, SketchUp Team' - + Sketchup.register_extension(extension, true) - + end # module STL end # module CommunityExtensions diff --git a/src/sketchup-stl/css/base.css b/src/sketchup-stl/css/base.css index f67f96d..b56c365 100644 --- a/src/sketchup-stl/css/base.css +++ b/src/sketchup-stl/css/base.css @@ -36,4 +36,4 @@ html { button { width: 80px; height: 25px; -} \ No newline at end of file +} diff --git a/src/sketchup-stl/exporter.rb b/src/sketchup-stl/exporter.rb index 8186175..903f0b6 100644 --- a/src/sketchup-stl/exporter.rb +++ b/src/sketchup-stl/exporter.rb @@ -44,7 +44,7 @@ def self.select_export_file end def self.export(path, options = OPTIONS) - file = File.new(path , 'w') + file = File.new(path , 'w') if options['stl_format'] == STL_BINARY file.binmode @write_face = method(:write_face_binary) @@ -66,7 +66,7 @@ def self.find_faces(file, entities, scale, tform) face_count = 0 entities.each do |entity| if entity.is_a?(Sketchup::Face) - write_face(file, entity, scale, tform) + write_face(file, entity, scale, tform) face_count += 1 elsif entity.is_a?(Sketchup::Group) || entity.is_a?(Sketchup::ComponentInstance) diff --git a/src/sketchup-stl/html/importer.html b/src/sketchup-stl/html/importer.html index 8834f47..4d53ba4 100644 --- a/src/sketchup-stl/html/importer.html +++ b/src/sketchup-stl/html/importer.html @@ -2,7 +2,7 @@ Import STL Options - + @@ -18,7 +18,7 @@
Geometry - +