-
-
Notifications
You must be signed in to change notification settings - Fork 35.1k
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
ExtrudeGeometry: Simplify default value for ExtrudeGeometry options. #28365
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
7a85626
to
ad07155
Compare
const extrudePath = options.extrudePath; | ||
|
||
const uvgen = options.UVGenerator !== undefined ? options.UVGenerator : WorldUVGenerator; | ||
const { curveSegments, steps, depth, extrudePath, UVGenerator: uvgen } = options; |
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.
Can you please explain the UVGenerator: uvgen
pattern? What exactly does it?
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.
Can you please explain the
UVGenerator: uvgen
pattern? What exactly does it?
doc: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment
other link: https://hacks.mozilla.org/2015/05/es6-in-depth-destructuring/
In my Chinglish to explain, most chances are that people do not understand...
These two links should explain
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.
I interpret it like so: Since uvgen
is not directly in options
, it can't be unpacked from options
. So UVGenerator
is unpacked and assigned to uvgen
.
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.
This code does not use ES6 syntax, is it easy to accept?
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.
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.
I still prefer the "dumb" code version yeah...
Related issue: #XXXX
Description
As the title says.