Convert autodesk .dwg and .dwf files to three.js json format
Asked Answered
P

1

7

I want to render 3D graphics files of autodesk (.dwg and .dwf) using three.js but three.js requires 3D data to be in json format. So, I need to convert these files to three.js readable json format. I tried searching on the internet but couldn't find any solution. Can anyone tell me a good converter for these files?

Thanks in advance.

Primo answered 12/6, 2015 at 6:9 Comment(0)
S
6

In fact Autodesk already have a converter & wegbl viewer. Go to http://developer.autodesk.com and get a key for View & Data API. There is a server side REST API that allow you to upload a CAD file and convert to a JSON stream. You can hook to it and get the output. Or, even easier, just use the JavaScript client side API to embed the viewer on your website/app

Update

The API was renamed to Model Derivative + Viewer, the first translates the source file (e.g. DWG, RVT and many others) to a web-friendly format that can be viewed on the second, which is based on Three.js (and can be customized).

Sideburns answered 15/6, 2015 at 11:6 Comment(11)
Thank you for you suggestion. I need 3D model data containing all the vertices and other information to separately render the 3D model in my rendering application.Is it possible to download that JSON stream?Primo
after you upload the CAD file and translate (using REST APIs), you can use the JavaScript to download the JSON stream. I'm not sure if there is a public sample, but I know some developers are doing it...Sideburns
Ok, I will try downloading JSON stream using JavaScript. Thanks.Primo
I found this demo on the internet: extract.autodesk.io that serves my purpose. I want to use it for my website. Are there any charges for it's commercial usage?Primo
will have a cost, but so far is not decided yet. If you have a commercial app already, Autodesk team can help on biz side, send your contact to my email (check my first . last name @ autodesk.com)Sideburns
Ok, I will let you know. Thanks.Primo
@Primo did you find a way to convert dwg to json via REST? I looked around a bit and did not find any urls that would enable it. Also nothing from google...Oppugn
Does anyone have an example how to do it? We also want to convert dwg-files to JSON but no clear answer can be found on the netLivery
@ReinVanLeirsberghe please check the sample live at extract.autodesk.io (or code at github.com/cyrillef/workflow-node.js-server-view.and.data.api )Sideburns
Murray, take a look at forge.autodesk.com/blog/forge-svf-extractor-nodejsSideburns
Oh, of course Autodesk have a converter, but they will never share it in form of application. Only allow to use their service. Autodesk is such Autodesk...Rambow

© 2022 - 2024 — McMap. All rights reserved.