Skip to content

Commit

Permalink
Eslinted a few files
Browse files Browse the repository at this point in the history
  • Loading branch information
boytchev committed Jun 28, 2024
1 parent 00087ca commit 3f13ec3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
4 changes: 2 additions & 2 deletions online/online.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

} );

Expand Down Expand Up @@ -256,7 +256,7 @@ function shareURL( event, name ) {



function getCode( event, name, filename, Asset ) {
function getCode( event, name, filename ) {

event.stopPropagation();

Expand Down
4 changes: 2 additions & 2 deletions src/assets-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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 );
Expand Down
6 changes: 3 additions & 3 deletions src/mug.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class Mug extends THREE.Group {

// material
var material = ASSETS.defaultMaterial.clone();
material.flatShading = params.flat;
material.flatShading = params.flat;

// body

Expand All @@ -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;

Expand Down Expand Up @@ -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,
};
Expand Down
13 changes: 6 additions & 7 deletions src/plate.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


import * as THREE from 'three';
import { mergeVertices } from 'three/addons/utils/BufferGeometryUtils.js';
import * as ASSETS from './assets-utils.js';


Expand Down Expand Up @@ -49,7 +48,7 @@ class Plate extends THREE.Group {

// material
var material = ASSETS.defaultMaterial.clone();
material.flatShading = params.flat;
material.flatShading = params.flat;

// body

Expand All @@ -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
Expand All @@ -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,
};
Expand Down

0 comments on commit 3f13ec3

Please sign in to comment.