diff --git a/online/online.js b/online/online.js index 471b412..07e449f 100644 --- a/online/online.js +++ b/online/online.js @@ -157,7 +157,7 @@ function install( Asset ) { event.stopPropagation(); //window.alert( "Export of a code is not implemented" ); - getCode( event, funcname, filename, Asset ); + getCode( event, funcname, filename ); } ); @@ -256,7 +256,7 @@ function shareURL( event, name ) { -function getCode( event, name, filename, Asset ) { +function getCode( event, name, filename ) { event.stopPropagation(); diff --git a/src/assets-utils.js b/src/assets-utils.js index a3ae82f..05592c8 100644 --- a/src/assets-utils.js +++ b/src/assets-utils.js @@ -15,7 +15,7 @@ import { DoubleSide, MathUtils, MeshPhysicalMaterial, Shape, Vector2 } from 'thr // rounded vertex = [x,y,radius] class RoundedShape extends Shape { - constructor( path, swap ) { + constructor( path ) { super(); @@ -27,7 +27,7 @@ class RoundedShape extends Shape { for ( var i=0; i< path.length; i++ ) { var point = path[ i ]; - if ( point.length == 2 || (point.length == 3 && point[2]==0) ) { + if ( point.length == 2 || ( point.length == 3 && point[ 2 ]==0 ) ) { // [x, y] v.set( ...point ); diff --git a/src/mug.js b/src/mug.js index 9db5f6f..e1786b0 100644 --- a/src/mug.js +++ b/src/mug.js @@ -74,7 +74,7 @@ class Mug extends THREE.Group { // material var material = ASSETS.defaultMaterial.clone(); - material.flatShading = params.flat; + material.flatShading = params.flat; // body @@ -98,7 +98,7 @@ class Mug extends THREE.Group { var bodyShape = new ASSETS.RoundedShape( points ); var bodyGeometry = new THREE.LatheGeometry( bodyShape.getPoints( 6 ), mC ); - + this.body = new THREE.Mesh( bodyGeometry, material ); this.body.rotation.y = Math.PI/2 + Math.PI/mC; @@ -184,7 +184,7 @@ class Mug extends THREE.Group { mugComplexity: ASSETS.random( 0, 50 )+ASSETS.random( 0, 50 ), handleComplexity: ASSETS.random( 0, 50 )+ASSETS.random( 0, 50 ), - + edges: ASSETS.random( 0, 100 ) > 30, flat: ASSETS.random( 0, 100 ) < 30, }; diff --git a/src/plate.js b/src/plate.js index f84fddb..457807b 100644 --- a/src/plate.js +++ b/src/plate.js @@ -4,7 +4,6 @@ import * as THREE from 'three'; -import { mergeVertices } from 'three/addons/utils/BufferGeometryUtils.js'; import * as ASSETS from './assets-utils.js'; @@ -49,7 +48,7 @@ class Plate extends THREE.Group { // material var material = ASSETS.defaultMaterial.clone(); - material.flatShading = params.flat; + material.flatShading = params.flat; // body @@ -74,13 +73,13 @@ class Plate extends THREE.Group { var bodyShape = new ASSETS.RoundedShape( points, true ); var bodyGeometry = new THREE.LatheGeometry( bodyShape.getPoints( 6 ), pC ); - - + + this.body = new THREE.Mesh( bodyGeometry, material ); this.body.rotation.y = Math.PI/2 + Math.PI/pC; - + this.add( this.body ); - + this.position.set( 0, -pH/2, 0 ); } // Plate.constructor @@ -102,7 +101,7 @@ class Plate extends THREE.Group { plateShape: ASSETS.random( 0, 35, 1 ), plateWidth: ASSETS.random( 0.3, 1, 3 ), plateComplexity: ASSETS.random( 0, 50 )+ASSETS.random( 0, 50 ), - + edges: ASSETS.random( 0, 100 ) > 30, flat: ASSETS.random( 0, 100 ) < 30, };