Skip to content

Conversation

joseAndresGomezTovar
Copy link
Contributor

Add new Input Properties.
stlModelFiles string[] - List of stl model files

Add new Input Properties.
stlModelFiles 	string[] 	- 	List of stl model files
window.addEventListener('resize', this.onWindowResize, false)

const meshCreations = this.stlModels.map((modelPath, index) => this.createMesh(modelPath, this.meshOptions[index]))
let meshCreations: any = null;
Copy link
Member

@KillerCodeMonkey KillerCodeMonkey Dec 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add the correct type Promise<THREE.Mesh>[]


const meshCreations = this.stlModels.map((modelPath, index) => this.createMesh(modelPath, this.meshOptions[index]))
let meshCreations: any = null;
if (Array.isArray(this.stlModels) &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to check. default value is an empty array, just check the lengthh

const geometry: THREE.BufferGeometry = await this.stlLoader.loadAsync(path)
async createMesh(path: string, meshOptions: MeshOptions = {}, parse: boolean = false): Promise<THREE.Mesh> {
let geometry: THREE.BufferGeometry = null;
if (!parse) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please switch the condition so you are checking the truthy case :)

window.addEventListener('resize', this.onWindowResize, false)

const meshCreations = this.stlModels.map((modelPath, index) => this.createMesh(modelPath, this.meshOptions[index]))
let meshCreations: Promise<THREE.Mesh>[] = null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one last thing: please set the initial value to an empty array :)

@KillerCodeMonkey KillerCodeMonkey merged commit 890721a into codaline-io:master Dec 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants