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:
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.
You can set the export options when you export SOLIDWORKS documents as eDrawings files. As a best practice, distribute drawings and assemblies files in eDrawings format, which always requires updates when referenced parts are modified.
In the dialog box, in Save as type, select eDrawings Web HTML Files (*. html). Search 'Save As Web HTML' in the SOLIDWORKS Knowledge Base.
In a SOLIDWORKS document, click Save As (Standard toolbar) or File > Save As. In the Save As dialog box, in Save as type, select the corresponding eDrawings file type: Part document (*.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With