-
Notifications
You must be signed in to change notification settings - Fork 13
New Configuration #431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Configuration #431
Conversation
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; |
There was a problem hiding this comment.
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) && |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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 :)
Rocket
Add new Input Properties.
stlModelFiles string[] - List of stl model files