Autodesk Forge - custom viewer - three.js

We have an existing three.js application and are experimenting with adding support for cad designs. Previously we managed these with some custom rendering of geojson data that we created from DXF files, but now we're looking to use Autodesk Forge to allow support for more data types and pre-process the data before rendering.
As a preface, we cannot simply just use the Forge viewer threejs version as this would involve us rewriting our entire application to be built as extensions on top of the Forge viewer.
So the plan is, for 3D files, I'm looking at downloading the obj/mtl files from the Forge api and loading those directly in vanilla three.js using their OBJLoader2 example. Based off my initial testing, this appears to work and renders to my liking. I can control how the meshes are created and ensure it is optimized to work within my application.
The problem comes when I'm trying to load 2D files as the forge api only lets me download f2d files which as far as I know, I have no way of loading these using vanilla three.js. Any ideas? Is there another format 2D designs will export as that I might be able to load independently?

At the moment I don't know of a simple pipeline to load 2D in plain Three.js. By 2d I am guessing that you mean dwg/dxf, if not the case be more explicit... Forge Model Derivatives REST API doesn't provide another export format from dwg than svf (f2d).
You could convert a 2d dwg into a 3d one by adding a 3d solid to it for example, but then I don't know what the obj export would be, probably not really interesting but you may want to give it a try.
Another option would be to use the Design Automation API with AutoCAD, you could upload a dwg and run some custom dll that would convert the drawing into your custom format that you can then load in your viewer, this will require AutoCAD ObjectARX or .Net API expertise and depending on the complexity of the drawings you plan to handle, may be a fair piece of work.
Finally you may want to consider using the Forge Viewer, even if that means rewriting parts of your app, the viewer is based on Three.js so you may be able to migrate some of your features rather easily, all the UI is just html/css and you can integrate any UI JavaScript framework on top of it. This may end up being a more powerful and flexible solution in the long term than a convoluted pipeline of translations between formats... By exporting 3d to obj you are also loosing all metadata embedded in a CAD file, this may or may not be an issue to you.
I hope that helps

Related

Augmented Reality: superimpose texture over real objects. Is it possible?

Please bear with me as English is not my first language but I will try to explain my question as clearly as I can.
Let's say I have made a 3D scan of a real table, exported it into a ThreeJS scene and created some texture around it.
I would like to view the real object through the camera of a phone, tablet (or any device you might find suitable for the task) and be able to superimpose the texture on the object in the camera view.
The AR app that I intend to develop should be able to detect the real object, the view angle, distance and be able resize the texture on the fly before being applied to the object on camera.
The question I am asking is: it possible to achieve this? If yes, I would like to know which technologies and development tools should I consider and explore. Have you done something similar in the past? I am trying to avoid to go on a path that will end up in a dead end and tears.
Thank you very much for your help.
Three.js is for a web application, as far as I know thereĀ“s not any way to mix a tracking like OpenCV script with Three.js
If you want a Mobile SDK capable of what you say, I suggest Vuforia + Unity.
The choice of technologies depends on the platform where you intend to run this application.
If we're talking mobile applications then you should check out ARKit (iOS) or ARCore (Android), and consider developing a native application instead of relying on JavaScript. The precision and performance of these native libraries is far better than what you'd achieve on your own or in a JavaScript application. This is not something Three.js won't do for you.

Tango for mechanical engineering?

I want to use tango for mechanical design. I would like to put scanned files on Autocad. Scanning existing pipes and steel structures. Is it possible with tango? For example with Zenfone AR?
Where can I find scanned stock samples to try with Autocad?
There are a handful of Tango applications on the Play Store that reconstruct 3D worlds on a scan. Google has written Constructor Developer Tool. The share feature inside Constructor creates a .zip file with a model and texture in .obj and .png formats.
I hope this helps!

interactive Augmented Reality 3D drawer

I'm planning on doing an interactive AR application that will use a laser sensor (for distances), GPS technology to get a location, and then use compass/gyroscope for tracking 6DOF viewfinder
movements. The user can choose from a number of ready-made 3D-models, and should be able to place them by selecting the desired location on the screen.
My target platform will be a 8"-handheld-device, running on windows8.
Any hints what would be the best AR-SDK or 3D-viewer to work with?
thanks in advance!
There are quite a few 3D viewers that are working in the browsers. But most recently and most notably: va3C viewer
It is webgl based app and doesnt require a server, so if your handheld device supports webgl, then you are good to go, however, whether it works on IE or not is questionable ;).
Although based on my experience and your usecase, I believe client side JS libraries do not provide enough access to the device's hardware. So you might have to serve the information like GPS, Gyroscope, from the server side, then gather this on the client using something like socket.io and then mash it up alongside the geometry.
I am trying to do something similar, although havent quite done it yet. Will keep you posted.
Another approach I am exploring is X3DOM, which gives the ability to write 3D data like XML alongside HTML, which is quite declarative and simple to pickup. X3DOM derives from X3D.
Tell me if you need more info.
Also, worth exploring for its motion abilities, is Robot Studio, which is a desktop app with SDK.

AutoCAD format for SCADA system

I am working on project and my task is to export house plan from AutoCAD to some format that is most adaptable for SCADA. Any suggestion will help me. Thanks!
As you didn't specify which HMI/SCADA package, you'll get a general answer. Since ALL packages are basically a GUI, a bitmap (.bmp) graphic will be fine for most, if not all.
One thing I do know for sure, Rockwell's FactoryTalk View will allow you to import a .dxf file, but I think this is the only package that will let you do this. WinCC and InTouch certainly don't have this kind of support.
For the sake of compatibility, an image file would be best.
I'm one of developers of open source Scada-LTS.
We can add functionality of loading svg or 3dx background on view (HMI) in Scada-LTS.
Your dfx file can be converted into svg or x3d format.
For example you may use:
http://kabeja.sourceforge.net to svg convertion.
https://www.blender.org to x3d convertion.
Schneider ClearSCADA is capable of importing dxf files into HMI screens with some limitations
I do a lot of SCADA work and to honest I have yet to come across a package that has a anything but garbage for a graphics editor. The one exception is Wonderware's archestra ide...but for a home project you won't be using that!
I would recommend creating an image for a background (png, jpg, etc) and then laying your animated graphics and data on top of that. My tools of choice are Sketchup for CAD tasks, Inkscape for vector graphic tasks, and Blender for 3d rendering. Then I take the assets created in those tools and bring them into whatever SCADA package I'm working with.

Transparent image overlay software for implementation of design

Useful when implementing a design, to make the design pixel accurate.
I've used the pixel perfect plugin for firefox to do this, but it doesn't seem to work anymore. The best would be a separate program that can be used independently of browser. Any recommendations?
I'm working on a javascript tool for developers to manage image overlays: https://github.com/frontfoot/overlay_me
I found another solution though that is corresponding to your need: http://makiapp.com/
My version of the tool is a bit more developer oriented, as you can have a pack of overlaying images loading automatically per project, and also keeping the possibility to inspect DOM elements while overlaying things.
The makiapp tool is a more accessible, designer oriented, where you can upload a local file.
My tool is at its first stage and need feedback BTW ;)

Resources