We want to embed a 3D CAD viewer into our web-based collaboration platform. It would work similar to the one offered by Opencascade. You can see it here.
We do not charge for the use of our platform and we would prefer an open source option if it is available (Opencascade viewer is not open source).
Does Autodesk Forge have a similar offering?
Thanks!
CAD viewer solution for a WEB can be split into several pieces:
On-server converter of CAD model.
Conversion of CAD file into intermediate format. You might need a lot of Data Connectors in case if you need supporting wide range of CAD formats, or restrict functionality to import vendor-neutral formats like STEP.
Generation of Web-friendly triangulation-based 3D model. This step might include model simplification in case if you have to deal with large models.
Server backend implementing business logic and backend for 3D viewer. The complexity of 3D Viewer backend depends on functionality provided with it and ability of viewer to handle extra-large models. In simplest case, this might be just a file server providing 3D model in format like glTF.
Client part, e.g. HTML+JavaScript code for displaying 3D model using WebGL, as well as GUI and application-specific logic. The viewer might just display 3D model (in which case it is barely distinguishable from non-CAD viewers), or give many features like Shaded and Wireframe (not just mesh edges) modes, picking sub-parts, Clipping Boxes, clipping with capping, annotations, dimensions, explode view, HLR view, a bunch of them!
Although it is technically possible loading some small CAD models directly in the Browser, in general this task is expected to reside on server to improve user experience and give some protection to intellectual properties (of CAD models). The converter may be based on Open CASCADE Technology, which is an open source framework, in case if STEP/IGES input file formats are enough (output could be your custom file format or glTF 2.0, for instance). But in case of native CAD formats support (like CATIA and others) you will unlikely find any free open-source libraries.
The Web viewer itself relies on WebGL and normally can be based on any traditional JavaScript-based library like Three.js (or existing 3D Viewer on top), or may rely on C++-based engine (again, Open CASCADE Technology can be build as WebAssembly module). WebAssembly-based viewer may give some performance benefits and it is more friendly to C++ developers (but apparently - less friendly to JavaScript developers). There is a hidden issue, though, as many open-source C++ libraries commonly have LGPL license - pretty good for desktop, but might have legality issues in case of a Web application. In contrast, WEB-based libraries are normally more proprietary-friendly with permissible licenses ignoring open-source software ideas put into licenses like (L)GPL.
In general, 3D CAD Viewer definition is very wide, and requirements list in your question are very basic and unclear - just to embed 3D Viewer in your WEB application. You may write your own Web Viewer based on open source components, or consider commercial options already implementing features you are looking for, and aware of / providing some solutions for handling tricky problems.
Looks like Forge Viewer fits the bill perfectly and covers most of the features available with the demo ;)
You may experience/preview Viewer following this link using a model of your own here and follow here to build up a MVP here...
For the features that are not readily/built-in out of the box Viewer is highly extensible and offers API making it pretty straight forward to develop extensions following here and also the blogs/tutorials available here.
Related
At https://forge.autodesk.com/en/docs/model-derivative/v2/developers_guide/supported-translations/ I can check the formats currently supported by Autodesk Forge. Are you working towards enabling expression of the datasets in Geopackage (see https://www.ogc.org/standards/geopackage) and RDF/Turtle (https://www.w3.org/TR/rdf-schema/ and https://www.w3.org/TR/turtle/)?
While there are a few exceptions (like the OBJ or FBX files that are very common for 3D data exchange), Forge is typically used with design formats used in architecture, engineering, construction, manufacturing, or media & entertainment. I don't know if the formats you mention fall into any of these categories, but if they do, I'd be happy to bring them up with the Forge team as a suggestion.
If the Geopackage or RDF files are meant to provide some additional context to other types of designs (like DWG drawings, for example), please note that you can load them yourself, and add their information into the DWG loaded in the viewer using the viewer's JavaScript API.
I am working on a Revit plugin to run on Forge (Design Automation app) that exports a 3D view through a custom exporter. As an input argument, it requires the name (or ElementID) of one of the 3D views from the Revit model. Is there a way to query the name of the views of a Revit model through other Forge solutions (like Data Management API)?
I couldn't find anything, if there is not an http api for that I assume I have to do it as part of my plugin run. What's the best to do that then?
Should I have a separate plugin that extracts the view names?
Thank you so much!
From your description, it appears that you have very little experience with Revit API add-ins. Maybe you should take a look at the getting started material first and work through the video tutorial. It explains a lot of important fundamentals, including covering this current question of yours.
The (almost) one and only way to retrieve elements from the Revit database is to use a filtered element collector. That would be the method of choice to find the element id of the 3D view you are looking for.
You cannot have searched very exhaustively, because many discussions by The Building Coder on the custom exporter and other topics include a code snippet showing how to pick a 3D view suitable for exporting.
To ensure you really have a 3D view set up just as you need it, you might prefer creating a new one from scratch.
Out of curiosity, is your task associated with the discussion thread on Revit API vs. ReCap API for historic project?
I am an App developer with no experience with AutoCAD at all, and for my current project I need to convert DWG files into Spatial Data - ESRI Shapefile / GeoJSON, etc.
Given that DWG is a proprietary format owned by Autodesk, the Autodesk Forge API becomes my only option to interpret such file. I have been evaluating the Model Derivative API for a week now, and what I found is that it won't work for my purposes. It has only 3 output formats (f2d, f3d, rvt) for DWG files and none of them fits my purpose.
For this reason, I started to look at others API's in the platform and ended up finding the Design Automation API which might be helpful, however it lacks documentation.
One of the examples in the API is the PlotToPdf activity that exports a DWG into a PDF. I wonder if there is a way to export other formats other than PDF.
I tried to find the possible "commands" in the interface by listing all the activities, workItems and AppPackages but none of these end-points returned me any useful information.
So here are my questions?
How can I can convert a DWG into a non Autodesk format? Being more specifically, the output must be an open format that I can interpret without using proprietary tools.
If the answer for the first question is Autodesk Forge API, which one should I use?
In case I should be using Design Automation API for that, where can I find complementary documentation once the one provided is lacking details?
I would say that Design Automation API is the best option if you don't have (or don't want) AutoCAD running (or any other DWG compatible desktop app).
To be complete: Design Automation includes an instance of AutoCAD running on the cloud, where you can upload a .DWG with a sequence of commands (script) and a .NET custom app to execute more advanced routines. Then download the results. By default, neither AutoCAD nor Design Automation can export to GIS formats (like those you mentioned), only some verticals, like Civil 3D or Map 3D, but these are not available on Design Automation. As you mentioned, Model Derivative API (via REST calls) don't have what you need, it's focused on metadata, not the specifications of the geometry.
Design Automation API supports the same commands AutoCAD Console does. For DXF creation, you can use DXFOUT command, your script would be something like (not tested):
FILEDIA
0
DXFOUT
outputfilename.dxf
QUIT
As per comment, it's a huge effort to just convert to .DXF. I'm not familiar with other libraries do perform the same task.
Now I'm not an expert on GIS data formats, but you may consider move from .DWG to .DXF then an approach like described here.
I don't quite understand this point that you are making in the comments:
I would only use the API to convert DWG to DXF, which means a huge waste of resources considering the monthly cost of the API and the time to develop and maintain the interface.
Can you clarify? Are you saying that transaction cost for Design Automation is too high? Or are you saying that development cost associated with deploying the script that Augusto gave you is too high?
Thanks
Right now the derivativeApi is the way to go for this: You can convert any input format from this list (https://developer.autodesk.com/en/docs/model-derivative/v2/overview/supported-translations/) to the "intermediate format" svf and the convert the svf file to obj for example. This will also create a material file which can be downloaded seperately. I am evaluation the forge api right now and can produce obj from dwg files right now.
Are there any advantage of using TVML over custom App (media based App not a game) for Apple TVOS? From what I read from Apple's documentation I could not figure out any such advantage (though it mostly talks about TVML/TVJs).
For iOS (Swift, Objective C) developers, using custom seems like easier, faster and with more possibilities.
I think whatever templates are provided by Apple can be build using UIKit because internally it is UIKit. Right?
[Update]
Let me rephrase my original question as the answers so far are not given any points in favour of custom App. I agree that #shirefriendship has some real valid points in favour of TVML (biggest one is- > App changes possible w/o an App update). Are there any advantages of using custom over TVML? Like anything not in reach of TVML?
Having already built an application using TVML/JS and now working on a native application I would say that the Javascript option is aimed more towards beginners or basic applications.
TVML applications provide an easier, faster way to build standard applications with common features/user interface. We used it to rapidly build a prototype of an application. Now that we've launched the application and it's getting some uplift (featured in What to Watch and Top Free Apps UK) we are now rebuilding it natively to add additional features such as analytics, crash reporting, custom interfaces and other bits to increase re-circulation and custom recommendations.
#shirefriendship's answer provides a good explanation to the benefits of TVML applications and I think this is a good option for beginners, prototype applications or even basic applications.
Native applications provide alot more control over how the application looks, works and feels. Having access to most of the iOS SDK's allows you to do more such as integrating Cloudkit, develop 2D & 3D games and more.
Once we have finished development of our native TV application I'll update the answer with some more information such as development time between the two different versions, features in the application etc.
UPDATE: To answer your second question, yes you can pretty much develop ANY user interface / template using UIKit, the TVML templates provide user interfaces that would be commonly used / quite handy. Using UIKit you could replicate or customize any of the pre-defined templates or build something completely new.
It is true that you have more flexibility with custom UIKit code. With enough time, you could potentially create an app that behaves similarly to a TVML/TVJS app...but why reinvent the wheel?
There are certain advantages to using TVML Templates, even if you are primarily a Swift/Obj-C developer.
TVML templates provide a familiar experience for the user. Have you
ever used the Netflix TV app, or HBO GO, or iTunes? They all use
TVML Templates and have a distinct look and feel to them. This cuts down drastically on design time.
Templates are incredibly easy to implement, even with very little
JavaScript experience. Auto-layout is taken care of for you. Lazy
loading images occurs automatically. The behavior of every UI
element on the screen has already been taken care of by Apple.
The templates are structured yet customizable. Templates are plug
and play, but you can still customize certain aspects of the UI
elements Styles and Attributes
You can host your TVML/TVJS files on a web server. This allows you
to make changes to your app without your user needing to download an
update to your app.
You can mix and match TVML with custom UIKit. Want Custom behavior with UIKit sometimes, but for standard views, you'd prefer a template? Why choose? You can have BOTH in the same app. Check out my answer here that describes how: How To Mix UIKit and TVML Within One App
When in doubt, try it out! Mess around with the Catalog App from Apple and see if you like TVML templates. You might surprise yourself.
MSK
The primary advantage of TVML is that it is all javascript which appeals to a broader base of developers.
Not sure about your second question regarding developing templates via UIKit
I am creating a software for calculating gearbox parts using Swing and OpenGL (with JOGL).
With this software the calculated parts are shown in 3D. The following picture shows an example part:
At first the geometry is specified/calculated (tip/root Diameter, width, number of teeth...) and out of this data the 3D-part is created. This example part is made with JOGL-Code because it's easy to use for me and can be integrated in a Swing-GUI.
Now a played around a bit with JavaFX Application GUI's and decided to continue making my software in JavaFX because it offers everything i need, looks much better and so on. The problem is I can't use my JOGL-OpenGL graphics.
So here are the possibilities for me:
Search for a way to integrate OpenGL-graphics in a JavaFX-Application - but I googled a bit and this seems to be quite difficult and the possible solutions seem to be very slow.
Use JavaFX integrated 3D-graphics (TriangleMesh) - but this is difficult to understand and I can't find good examples to learn it.
Any other solution?
Can you please help me finding a good solution? What would you do? My favorite would be to continue using OpenGL, but is there any good solution for this yet?
If you are looking for some JavaFX 3D resources that may help you decide whether its already mature or not, these are available, among others:
3DViewer here from the OpenFJX project.
InteractiveMesh importers and browser.
F(X)yz, a new JavaFX 3D library that provides additional primitives, composite objects, controls and data visualizations that the base JavaFX 8 3D packages do not have.
Multimodel3DFX, repository contains the code for the example shown on the article "Building Castles in the Sky. Using JavaFX 3D to model historical treasures" published in Oracle Java Magazine, issue from November/Dicember 2014.
Using a PolyLine3D from F(X)yz and the Multimodel3DFX plaftorm I was able to extrude a 2D polyline of a spur gear, so you can see how it's rendered in a JavaFX 3D subscene:
These are also mathematical 3D models generated using the F(X)yz library, all of them based on TriangleMesh.
As you can see, JavaFX 3D API, with its pros and cons, can be easily extended to achieve complex tasks.