Skip to content

Conversation

@yomboprime
Copy link
Collaborator

@yomboprime yomboprime commented Jan 8, 2019

This adds BufferGeometryUtils.mergeVertices and modifies the webgl_physics_volume example which used the Geometry one, removing completely the dependency of the example to Geometry.

Works with usual attributes, I've not implemented interleaved ones.

@Mugen87
Copy link
Collaborator

Mugen87 commented Jan 8, 2019

What happens when you attempt to merge vertices but the corresponding uv-coordinates or vertex normals are actually different? Wouldn't you corrupt the data in this case?

@donmccurdy
Copy link
Collaborator

donmccurdy commented Jan 8, 2019

Strong +1 for adding a BufferGeometryUtils.mergeVertices function for BufferGeometry, although I think @gkjohnson's PR #14116 covers some needs (morph targets, configurable tolerance) that this PR does not. Since that PR has stalled for now, merging just this function — after cherry-picking any code we want from the other PR — would work.

@yomboprime
Copy link
Collaborator Author

yomboprime commented Jan 8, 2019

What happens when you attempt to merge vertices but the corresponding uv-coordinates or vertex normals are actually different? Wouldn't you corrupt the data in this case?

Yes, that is what mapIndices() solves in the example. There is no alternative, you are right. The function is not useful with UVs.

@gkjohnson
Copy link
Collaborator

@donmccurdy I'd like to get that PR merged, too. It looks like the milestone keeps getting pushed back but it's unclear why. Maybe @mrdoob can shed some light? I'm happy to make any needed changes to get it merged. If BufferGeometryUtils is the right place for it we can do that to.

@yomboprime
Copy link
Collaborator Author

Strong +1 for adding a BufferGeometryUtils.mergeVertices function for BufferGeometry, although I think @gkjohnson's PR #14116 covers some needs (morph targets, configurable tolerance) that this PR does not. Since that PR has stalled for now, merging just this function — after cherry-picking any code we want from the other PR — would work.

I forgot about morphTargets completely.

I didn't see that PR. I can leave my PR on hold and leave the team decide.

@donmccurdy
Copy link
Collaborator

donmccurdy commented Jan 8, 2019

It looks like the milestone keeps getting pushed back but it's unclear why.

I think the milestone changing with each upcoming release just means we're tentatively willing to include it with the upcoming release (once review and discussion has resolved), but it doesn't block the release. In other words, "awaiting further review." I'll comment there.

numOriginalIndices = indices1.length;

}
else {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: If there is an else statement, it should be on the same line as the closing bracket of the block, like } else {.

https://github.com/mrdoob/three.js/wiki/Mr.doob's-Code-Style%E2%84%A2#if-statement

@mrdoob mrdoob added this to the r101 milestone Jan 9, 2019
@mrdoob
Copy link
Owner

mrdoob commented Jan 9, 2019

@yomboprime Should I merge #14116 instead? Anything that PR is missing?

@yomboprime
Copy link
Collaborator Author

@yomboprime Should I merge #14116 instead? Anything that PR is missing?

Yes, this one only adds the points and lines support, which is generally irrelevant.

@mrdoob
Copy link
Owner

mrdoob commented Jan 10, 2019

I see. Sorry for the duplicated efforts.

Feel free to add the points and lines support once #14116 is merged thought!

@mrdoob mrdoob closed this Jan 10, 2019
@mrdoob mrdoob removed this from the r101 milestone Jan 10, 2019
@yomboprime yomboprime deleted the mergeVertices branch January 19, 2019 01:27
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.

6 participants