filgf / grow3.js

A library for building recursive 3D structures.
http://grow3.zyxxy.de
MIT License
25 stars 2 forks source link

object reference in three.js #4

Open Steffenmitschelen opened 9 years ago

Steffenmitschelen commented 9 years ago

Hi!

I just came across this project today and found it pretty amazeing! I played with the three.js stl exporter and 3d-printing lately, and wanted to do something with your library. So I setup a basic three.js page (http://mitschelen.de/share/test/) but I had some problems referencing the whole generated object, which geometry I need to pass to the exporter. I wonder if I need to do some more recrusive backwards engineering, like pushing all geometrys into a group by myself, or is there already a way to reference the whole generated objects geometry?

filgf commented 9 years ago

Thanks a lot for the kind words!

The problem seems to be that the stel exporter (https://github.com/envisprecisely/THREE2STL) takes a single geometry and exports it to stl. However, the structure created by grow3 consists of a tree of Object3D-instances. Each object in turn has a geometry attached (f.e. a cube or sphere).

What would be needed would be either an exporter to stl that can handle object trees OR a way to flatten a complete three.js-scene into a single geometry (losing individual material-properties). A starting point for the latter could be THREE.GeometryUtils.merge() that can merge two meshes into one.

For now I'll leave this issue open...

Steffenmitschelen commented 9 years ago

Thanks foor the answer!

I see.., i had some success useing https://gist.github.com/kjlubick/fb6ba9c51df63ba0951f, which can handle the whole scene:

1 2

unfortunately the created STL isn't really suitable for 3D Printing, the mesh holds way too many informations, so i guess i have to use something like THREE.GeometryUtils.merge() or ThreeCSG anyway.

I will give you an update if i find the time to do this:)