3

First of all: I'm a skilled developer and a total noob of 3D solid files/drawing. I started playing with webgl and three.js. My task is to port a solid 3D file(i.e. STEP/IGES) to a web page(a sort of a cad viewer).

I started from this example: http://www.johannes-raida.de/jnetcad/RadialEngine.htm

I want to obtain something like the above link with a navigation tree and hide/show layers functionality.

The above link has sever json file, one for layer.

I want to obtain: a threejs-json file for each layer to get the hide/show functionality.

Now, I have a solid file (STEP format: .STP). That file contains layers. I want to obtain a json(three.js) file for each layer.

Questions are:

  • how to export to threejs-json using free software? I read that the best method could be: STEP > Wavefront OBJ [using freecad?] > treejs-json [using blender?] Does the collada format is better than obj?

  • Shoud I have to manually export each single layer to json?

  • Is there an utility out there to generate all the layers(separated files)(json-threejs format) from a 3d file?

gman
  • 100,619
  • 31
  • 269
  • 393
wakeupneo
  • 923
  • 1
  • 10
  • 20

1 Answers1

2

So, I did it by myself. Three.js is a great library but it requires some 3d skills.

Here are my answers:

how to export to threejs-json using free software?

Well, my suggestion is to convert your solid file to DAE, use anything you want. Then open DAE with Blender and use the exporter script of three.js: https://github.com/mrdoob/three.js/tree/master/utils/exporters/blender

Shoud I have to manually export each single layer to json?

No, the 3D file has all the informations about layers. So you can use a single file.

Is there an utility out there to generate all the layers?

I don't have found somethig good out there. If you want to create single layers, you can split the json file created with blender.

wakeupneo
  • 923
  • 1
  • 10
  • 20