Skip to content

Conversation

felixwri
Copy link
Contributor

Description

This overrides the setFromPoints method inherited by BufferGeometry so that it can be used to set the vertex positions on a LineGeometry.

const points = curve.getPoints(100);

const geometry = new LineGeometry();
geometry.setFromPoints(points); // Takes Vector3[] or Vector2[]

I think this could be more intuitive since previously, setFromPoints would be suggested by intellisense but would not work.

@Mugen87 Mugen87 added this to the r171 milestone Nov 19, 2024
@Mugen87 Mugen87 merged commit de9b967 into mrdoob:dev Nov 19, 2024
11 checks passed
@Mugen87 Mugen87 changed the title LineGeometry: Override setFromPoints method LineGeometry: Override setFromPoints(). Nov 19, 2024
@Mugen87
Copy link
Collaborator

Mugen87 commented Nov 19, 2024

Nice! setFromPoints() now works as expected with LineGeometry.

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