pmndrs / three-stdlib

📚 Stand-alone library of threejs examples designed to run without transpilation in node & browser
https://npmjs.com/three-stdlib
MIT License
704 stars 117 forks source link

fix(utils): `toCreasedNormals()`: call `toNonIndexed()` only on indexed geometries (#268) #269

Closed kpvhn closed 1 year ago

kpvhn commented 1 year ago

Why

BufferGeometryUtils.toCreasedNormals() produces a warning by BufferGeometry.toNonIndexed() if the provided geometry is already non-indexed:

THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed.

It should not produce the warning.

resolves #268

What

This changes BufferGeometryUtils.toCreasedNormals() to call BufferGeometry.toNonIndexed() only if the provided geometry is indexed. Otherwise, it will just use the original geometry, as has been the case before: BufferGeometry.toNonIndexed() returns this if the geometry is non-indexed.

Checklist

codesandbox-ci[bot] commented 1 year ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 7bfe779736dfc2a7747b948803113de6389e27e5:

Sandbox Source
Vanilla Configuration
github-actions[bot] commented 1 year ago

:tada: This PR is included in version 2.23.11 :tada:

The release is available on:

Your semantic-release bot :package::rocket: