[three] BufferGeometry.setFromPoints accepts Vector2s as well - #25897
Conversation
The documentation shows examples of this, e.g.: https://threejs.org/docs/#api/extras/curves/EllipseCurve The source code shows how it handles an array of either type: https://github.com/mrdoob/three.js/blob/2f2e5f731/src/core/BufferGeometry.js#L352
|
@fordhurley Thank you for submitting this PR! 🔔 @gyohk @florentpoujol @SereznoKot @omni360 @ivoisbelongtous @piranha771 @qszhusightp @nakakura @s093294 @Pro @efokschaner @PsychoSTS @dhritzkiv @apurvaojas - please review this PR in the next few days. Be sure to explicitly select If no reviewer appears after a week, a DefinitelyTyped maintainer will review the PR instead. |
There was a problem hiding this comment.
Thanks for the improvement.
I approve of the change as is.
Potentially an array of anything with x and y and z? members would suffice, but I always wonder whether three expects these to be vector classed objects even if it doesn't depend on that right now...
|
A definition owner has approved this PR ⭐️. A maintainer will merge this PR shortly. If it shouldn't be merged yet, please leave a comment saying so and we'll wait. Thank you for your contribution to DefinitelyTyped! |
|
Thanks all! |
The documentation shows examples of this, e.g.:
https://threejs.org/docs/#api/extras/curves/EllipseCurve
The source code shows how it handles an array of either type:
https://github.com/mrdoob/three.js/blob/2f2e5f731/src/core/BufferGeometry.js#L352
npm test.)npm run lint package-name(ortscif notslint.jsonis present).If changing an existing definition:
tslint.jsoncontaining{ "extends": "dtslint/dt.json" }.