File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -98,18 +98,11 @@ export function generateExportMesh(state, options = {}) {
9898 objectGeometry . mergeVertices ( ) ;
9999 objectGeometry . applyMatrix ( new THREE . Matrix4 ( ) . multiplyMatrices ( objectMatrix , matrix ) ) ;
100100
101- const color = material . color . getHex ( ) ;
102- const side = shapeData . fill ? THREE . FrontSide : THREE . DoubleSide ;
103- let materialIndex = materials . findIndex ( exportMaterial => {
104- return exportMaterial . color . getHex ( ) === color && exportMaterial . side === side ;
105- } ) ;
106- if ( materialIndex === - 1 ) {
107- materialIndex = materials . length ;
108- const exportMaterial = new THREE . MeshBasicMaterial ( { color } ) ;
109- exportMaterial . side = side ;
110- materials . push ( exportMaterial ) ;
111- }
101+ const exportMaterial = new THREE . MeshBasicMaterial ( { color : material . color . getHex ( ) } ) ;
102+ exportMaterial . side = shapeData . fill ? THREE . FrontSide : THREE . DoubleSide ;
103+ materials . push ( exportMaterial ) ;
112104
105+ const materialIndex = materials . length ;
113106 if ( unionGeometry ) {
114107 objectGeometry = new THREE_BSP ( objectGeometry , materialIndex ) ;
115108 if ( exportGeometry ) {
You can’t perform that action at this time.
0 commit comments