Skip to content

Commit 1a7b7c5

Browse files
authored
Merge pull request #15093 from hassadee/dev
Add STL exporter in binary format to menu bar
2 parents 55af39b + cecacf0 commit 1a7b7c5

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

editor/js/Menubar.File.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ Menubar.File = function ( editor ) {
266266
} );
267267
options.add( option );
268268

269-
// Export STL
269+
// Export STL (ASCII)
270270

271271
var option = new UI.Row();
272272
option.setClass( 'option' );
@@ -280,6 +280,20 @@ Menubar.File = function ( editor ) {
280280
} );
281281
options.add( option );
282282

283+
// Export STL (Binary)
284+
285+
var option = new UI.Row();
286+
option.setClass( 'option' );
287+
option.setTextContent( 'Export STL (Binary)' );
288+
option.onClick( function () {
289+
290+
var exporter = new THREE.STLExporter();
291+
292+
saveArrayBuffer( exporter.parse( editor.scene, { binary: true } ), 'model-binary.stl' );
293+
294+
} );
295+
options.add( option );
296+
283297
//
284298

285299
options.add( new UI.HorizontalRule() );

0 commit comments

Comments
 (0)