9

With the launch of SolidWorks 2016, Dassault Systèmes has promoted a new web portal that enables the embedding of Edrawings models into web pages: 3dcontentcentral.com. Their web 3D viewer uses WebGL to show model inside a browser window (here you can find a live example). Moreover, there is the possibility to embed an iframe with the viewer to embed it onto another web page, like the following:

<iframe scrolling='no' frameborder='0' allowfullscreen='true'
src='http://www.3dcontentcentral.com/external-site-embed.aspx?format=3D&catalogid=364&modelid=1254&width=250&height=250&edraw=true'
name='PreviewFrame3D' id='PreviewFrame3D' width='400' height='355'>
</iframe>
<br/>
<a href='http://www.3dcontentcentral.com/download-model.aspx?catalogid=364&id=1217'>
Download</a>

The final result is something like the following:

enter image description here

Full screen example

So, is there any chance to export a 3D model (part) in the same way and embed as a WebGL without uploading into 3D Content Central website? I have also access to the Edrawings/SolidWorks SDK (2015), if it could be helpful in any way.

gman
  • 83,286
  • 25
  • 191
  • 301
sentenza
  • 1,336
  • 1
  • 22
  • 44
  • I'm also really really curious about this. I don't want to upload my assemblies to 3DContentcentral. I'd like to keep the model semi private and under my control on my servers. Any other suggestions on how to do this? Bump? – Atomiklan May 11 '16 at 07:00
  • Sorry for the lack of my answer, but I'm still looking for a proper solution for this problem. I think that the first step would be exporting into `*.obj/*.mtl` format and then using **Three.js**. This is the same point expressed on the @ralftar answer. – sentenza Aug 31 '16 at 08:28
  • Any progress on this? It would be nice to find a library that does what Edrawings is doing (very similar to the PDF 3D feature by the way)... – user1156544 Mar 03 '17 at 16:23
  • Actually, I found a proper way to convert a Solid part file into **OBJ** and **MTL** format. I need to find the time to make a complete guide to do all the process, because it's not a single-click procedure. I will post my solution ASAP. – sentenza Mar 04 '17 at 16:45

2 Answers2

4

How to convert a SolidWorks file into a WebGL JSON file

The best solution I came across is simply to use SolidWorks Visualize (formerly Bunkspeed) to export the geometry and the materials using a combination of OBJ and MTL files.

Then, you'll be able to import it into a WebGL scene using the Three.js/OBJLoader. A big problem that can arise is the dimension and the memory required to load the exported file. To solve this latency/memory problem you can then convert the exported OBJ files into Three.js JSON format using the three-obj and minifying them using the minify() method. After that you'll have to load the minified files using the Three.js/BinaryLoader.

Hope this can help someone else.

sentenza
  • 1,336
  • 1
  • 22
  • 44
1

Have a look at the WebGL 3D model viewer using three.js guide at http://www.radiatedpixel.com/wordpress/2013/03/27/webgl-3d-model-viewer-using-three-js/

Export the obj file from SolidWorks.

It should be straight forward to add your own controls via JavaScript.

ralftar
  • 105
  • 8
  • I'm looking for a good macro to export to `obj` and `mtl`. The best one seems to be [this one](https://forum.solidworks.com/thread/54270), but the final result is not so good as expected. I'm using SolidWorks 2016, and I think this macro was made for older versions. – sentenza Aug 31 '16 at 08:30
  • I've found this library: [Open Asset Import Library](https://github.com/assimp) to convert from 40+ formats to OBJ. But sadly it doesn't support STEP or IGES file formats. – sentenza Sep 08 '16 at 07:45