mrdoob / three.js

JavaScript 3D Library.
https://threejs.org/
MIT License
102.68k stars 35.37k forks source link

Half Edge Structure for Custom Models. #24360

Closed T4G2 closed 2 years ago

T4G2 commented 2 years ago

As I was working on my bachelor thesis, I needed to create a Half Edge Structure for any given model. I had problems that I had no way to access already created HalfEdge Class in /examples/jsm/math/ConvexHull.js. Also the problem is that this structure is only used in ConvexHull.js however it could be used to create HalfEdge structure from any 3D Model. ) Describe the solution you'd like

This Issue is related to following Issue: OBJLoader loses information about Vertex ID. #24361

LeviPesin commented 2 years ago

Can you please file a PR?

Mugen87 commented 2 years ago

Moving HalfEdge is fine however it will break the examples/js code path. Besides, I don't think adding HalfEdgeStructure without a concrete use case in the library makes sense.

T4G2 commented 2 years ago

Well @Mugen87 , I'm right now using this HalfEdge Structure to implement MMP Algorithm to find geodesics, so I may be able to Push this algorithm as well

Mugen87 commented 2 years ago

see https://github.com/mrdoob/three.js/issues/24359#issuecomment-1188847789

It's probably better if your code is put into a separate repository.

erasta commented 2 years ago

Excuse me for intervening, but I also needed the HalfEdge and Face classes from ConvexHull.js, but since they're not exported, i had to copy them to my own repo. Would it be possible to export those by changing the last line? from export { ConvexHull }; to export { ConvexHull, Face, HalfEdge, VertexNode, VertexList }; This will also better reflect the documentation, as those classes are shown there. Thank you.

Mugen87 commented 2 years ago

Exporting these classes is okay. Would you like to make a PR?

erasta commented 2 years ago

Yes, thank you, will do shortly.