Skip to content

Commit d1375d6

Browse files
authored
Merge pull request mrdoob#18106 from Mugen87/dev29
Editor: Add PLYExporter.
2 parents 26dc9ee + 6605afd commit d1375d6

File tree

4 files changed

+42
-0
lines changed

4 files changed

+42
-0
lines changed

editor/index.html

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
<script src="../examples/js/exporters/ColladaExporter.js"></script>
4040
<script src="../examples/js/exporters/GLTFExporter.js"></script>
4141
<script src="../examples/js/exporters/OBJExporter.js"></script>
42+
<script src="../examples/js/exporters/PLYExporter.js"></script>
4243
<script src="../examples/js/exporters/STLExporter.js"></script>
4344

4445
<script src="../examples/js/renderers/Projector.js"></script>

editor/js/Menubar.File.js

+36
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,42 @@ Menubar.File = function ( editor ) {
266266
} );
267267
options.add( option );
268268

269+
// Export PLY (ASCII)
270+
271+
var option = new UI.Row();
272+
option.setClass( 'option' );
273+
option.setTextContent( strings.getKey( 'menubar/file/export/ply' ) );
274+
option.onClick( function () {
275+
276+
var exporter = new THREE.PLYExporter();
277+
278+
exporter.parse( editor.scene, function ( result ) {
279+
280+
saveArrayBuffer( result, 'model.ply' );
281+
282+
} );
283+
284+
} );
285+
options.add( option );
286+
287+
// Export PLY (Binary)
288+
289+
var option = new UI.Row();
290+
option.setClass( 'option' );
291+
option.setTextContent( strings.getKey( 'menubar/file/export/ply_binary' ) );
292+
option.onClick( function () {
293+
294+
var exporter = new THREE.PLYExporter();
295+
296+
exporter.parse( editor.scene, function ( result ) {
297+
298+
saveArrayBuffer( result, 'model-binary.ply' );
299+
300+
}, { binary: true } );
301+
302+
} );
303+
options.add( option );
304+
269305
// Export STL (ASCII)
270306

271307
var option = new UI.Row();

editor/js/Strings.js

+4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ var Strings = function ( config ) {
2020
'menubar/file/export/glb': 'Export GLB',
2121
'menubar/file/export/gltf': 'Export GLTF',
2222
'menubar/file/export/obj': 'Export OBJ',
23+
'menubar/file/export/ply': 'Export PLY',
24+
'menubar/file/export/ply_binary': 'Export PLY (Binary)',
2325
'menubar/file/export/stl': 'Export STL',
2426
'menubar/file/export/stl_binary': 'Export STL (Binary)',
2527
'menubar/file/publish': 'Publish',
@@ -325,6 +327,8 @@ var Strings = function ( config ) {
325327
'menubar/file/export/glb': '导出GLB',
326328
'menubar/file/export/gltf': '导出GLTF',
327329
'menubar/file/export/obj': '导出OBJ',
330+
'menubar/file/export/ply': '导出PLY',
331+
'menubar/file/export/ply_binary': '导出PLY(二进制)',
328332
'menubar/file/export/stl': '导出STL',
329333
'menubar/file/export/stl_binary': '导出STL(二进制)',
330334
'menubar/file/publish': '发布',

editor/sw.js

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ const assets = [
3636
'../examples/js/exporters/ColladaExporter.js',
3737
'../examples/js/exporters/GLTFExporter.js',
3838
'../examples/js/exporters/OBJExporter.js',
39+
'../examples/js/exporters/PLYExporter.js',
3940
'../examples/js/exporters/STLExporter.js',
4041

4142
'../examples/js/renderers/Projector.js',

0 commit comments

Comments
 (0)