Skip to content
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

Moved THREE.Geometry out of core. #21031

Merged
merged 21 commits into from
Jan 13, 2021
Merged

Moved THREE.Geometry out of core. #21031

merged 21 commits into from
Jan 13, 2021

Conversation

mrdoob
Copy link
Owner

@mrdoob mrdoob commented Jan 8, 2021

Moved Geometry to examples/jsm/deprecated.
Moved DirectGeometry inside of Geometry and added toBufferGeometry() in Geometry.

@mrdoob mrdoob added this to the r125 milestone Jan 8, 2021
@Mugen87
Copy link
Collaborator

Mugen87 commented Jan 8, 2021

BufferGeometry.setFromObject() and BufferGeometry.updateFromObject() also rely on Geometry and have to be removed.

@mrdoob
Copy link
Owner Author

mrdoob commented Jan 9, 2021

The main thing left in this PR are the modifiers and I think the sanest thing to do is to convert them to use BufferGeometry...

Won't be able to work on that until Monday though.

@Mugen87
Copy link
Collaborator

Mugen87 commented Jan 9, 2021

Um, not sure how easy that is. For some modifiers, we should maybe consider if other data structures like a half edge data structure could make sense.

For simplicity, you probably want to convert calls from new BufferGeometry().fromGeometry(); to Geometry.toBufferGeometry() for now.

@Mugen87
Copy link
Collaborator

Mugen87 commented Jan 13, 2021

During my tests I have noticed one issue:

There is now Geometry.toBufferGeometry() but it only works with mesh geometries. We actually need the logic from BufferGeometry.setFromObject() so also lines and point geometries do work.

I would introduce something like Geometry.toBufferGeometryFromObject(). Sounds a bit strange but it should do the trick for these cases.

# Conflicts:
#	examples/jsm/modifiers/SubdivisionModifier.js
#	examples/jsm/modifiers/TessellateModifier.js
#	src/core/DirectGeometry.d.ts
@mrdoob mrdoob marked this pull request as ready for review January 13, 2021 12:08
src/Three.d.ts Outdated Show resolved Hide resolved
@mrdoob mrdoob merged commit af5414c into dev Jan 13, 2021
@mrdoob
Copy link
Owner Author

mrdoob commented Jan 13, 2021

@Mugen87 🙌 🙌 🙌

@Mugen87
Copy link
Collaborator

Mugen87 commented Jan 13, 2021

This is exciting! We've worked so long so it's possible to do this step! Glad to see we've made it! 🙌

@Mugen87
Copy link
Collaborator

Mugen87 commented Jan 13, 2021

FYI: I've setup a forum topic to inform the community about this change:

https://discourse.threejs.org/t/three-geometry-will-be-removed-from-core-with-r125/22401

@GGmemeda
Copy link

GGmemeda commented Feb 2, 2021

Geometry deprecation ,i want to get vertices, faces, faceVertexUvs from bufferGeometry,Is there any other good way?

@Mugen87
Copy link
Collaborator

Mugen87 commented Feb 2, 2021

@GGmemeda Please use the forum for help requests. Similar questions like the following one were already answered there:

https://discourse.threejs.org/t/facevertexuvs-for-buffergeometry/23040

@mjurczyk
Copy link
Contributor

mjurczyk commented Feb 3, 2021

@mrdoob I think that's not possible to change wiki with a PR, so a little note here:
https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4#example-of-scene-with-raw-geometry-light-and-a-material-with-multiple-uv-texture-assignment
Still refers to the original Geometry at the bottom of the doc (mentioned by user 선과 on discord - https://discord.com/channels/685241246557667386/686304808994340865/806395575482056704)

Same applies to:

@Mugen87
Copy link
Collaborator

Mugen87 commented Feb 3, 2021

Thanks for the feedback. I've clean up the Wiki pages.

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.

None yet

4 participants