Browse Source

Add STL exporter in binary format to menu bar

Hassadee Pimsuwan 6 years ago
parent
commit
b63ec3e8ca
1 changed files with 15 additions and 1 deletions
  1. 15 1
      editor/js/Menubar.File.js

+ 15 - 1
editor/js/Menubar.File.js

@@ -265,7 +265,7 @@ Menubar.File = function ( editor ) {
 	} );
 	options.add( option );
 
-	// Export STL
+	// Export STL (ASCII)
 
 	var option = new UI.Row();
 	option.setClass( 'option' );
@@ -279,6 +279,20 @@ Menubar.File = function ( editor ) {
 	} );
 	options.add( option );
 
+	// Export STL (Binary)
+	
+	var option = new UI.Row();
+	option.setClass( 'option' );
+	option.setTextContent( 'Export STL (Binary)' );
+	option.onClick( function () {
+
+		var exporter = new THREE.STLExporter();
+
+		saveString( exporter.parse( editor.scene, { binary: true } ), 'model-binary.stl' );
+
+	} );
+	options.add( option );
+	
 	//
 
 	options.add( new UI.HorizontalRule() );