2
0
Эх сурвалжийг харах

Merge pull request #15093 from hassadee/dev

Add STL exporter in binary format to menu bar
Mr.doob 6 жил өмнө
parent
commit
1a7b7c5edf

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

@@ -266,7 +266,7 @@ Menubar.File = function ( editor ) {
 	} );
 	} );
 	options.add( option );
 	options.add( option );
 
 
-	// Export STL
+	// Export STL (ASCII)
 
 
 	var option = new UI.Row();
 	var option = new UI.Row();
 	option.setClass( 'option' );
 	option.setClass( 'option' );
@@ -280,6 +280,20 @@ Menubar.File = function ( editor ) {
 	} );
 	} );
 	options.add( option );
 	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();
+
+		saveArrayBuffer( exporter.parse( editor.scene, { binary: true } ), 'model-binary.stl' );
+
+	} );
+	options.add( option );
+	
 	//
 	//
 
 
 	options.add( new UI.HorizontalRule() );
 	options.add( new UI.HorizontalRule() );