07.08.2023 • C3D Vision, C3D Web Vision

C3D Labs Visualization Tools: Functionality Available to Native and Web Applications

C3D Labs offers two visualization components, C3D Vision, and C3D Web Vision, as part of the C3D Toolkit package. This paper covers these components, their core capabilities, and how they can be used in engineering applications.

C3D Labs Visualization Tools: Functionality Available to Native and Web Applications, photo 1

Our target audience is those who are still considering which visualization module to use in their engineering applications, browsing the market for such solutions, and checking out our offerings.

C3D Vision

C3D Vision module is a highly popular C3D Toolkit component, and its prospective users may have many questions about its true capabilities. Frankly, most such questions arise from certain misunderstandings. Please do not think that C3D Vision is an end-user desktop application (CAD, BIM, etc.) It is not.

You certainly know what “end-user” means, but for clarity let us introduce some terms and definitions. They will help us understand what the Vision component does.

Any application can be divided into two key parts: the math, and the graphical user interface (GUI). The math part implements the core functionality: what the application is designed to do. Engineering software products may perform a very extensive range of functions. The product is usually decomposed into individual modules (components) for each specific task. The math part may also consist of many such components.

C3D Labs Visualization Tools: Functionality Available to Native and Web Applications, photo 2

A graphical user interface is the “showcase” of your application. The GUI ultimately defines the user experience your product provides. The GUI represents your product objects and functions as graphical on-screen components: buttons, lists, windows, etc.

C3D Labs Visualization Tools: Functionality Available to Native and Web Applications, photo 3

Another highly important component of any application is the math-to-GUI layer which implements the logic of user-to-product interaction.

C3D Labs Visualization Tools: Functionality Available to Native and Web Applications, photo 4

As an example, let us take a simple end-user application: C3D Viewer.

Its math part consists of several modules described below. The Viewer application is completed: the math modules are integrated with the GUI through the user experience logic. The math modules are:

  • the visualization module for model rendering;
C3D Labs Visualization Tools: Functionality Available to Native and Web Applications, photo 5
A scene with a model opened (selected by the orange rectangle)

  • the geometric kernel which does all the geometric math
C3D Labs Visualization Tools: Functionality Available to Native and Web Applications, photo 6
A kernel application: weight/CoG estimation for an individual model element (selected by the orange rectangle)

  • import/export from/to a range of file formats.

C3D Viewer’s GUI consists of the main window, dialog boxes, and ribbon with buttons.

C3D Labs Visualization Tools: Functionality Available to Native and Web Applications, photo 7

When you install a new application, you just run it and use it without much thinking about the software product structure, logic behind it, etc

OK, we are done with the “end-user application” concept. Now it is time to move on to the math modules.

C3D Labs Visualization Tools: Functionality Available to Native and Web Applications, photo 8

From a developer’s viewpoint, a module provides a software development kit (SDK) set of tools. Such modules can be highly specialized and focused on specific tasks. They do not support any math-to-GUI logic, but their functionality is accessible to third-party developers. To summarize: these components are intended exclusively for such developers. It is more than true about C3D Vision as well.

C3D Labs Visualization Tools: Functionality Available to Native and Web Applications, photo 9

So, what’s the bottom line? C3D Vision is a library that provides visualization capabilities and tools to integrate them into your application. It is intended for expert developers. The module comes with the header files, and two libraries (static c3dvision.lib, and dynamic c3dvision.dll). The libraries are the compiled Vision’s source files.

Now it is time to learn more about the Vision’s features.

The component is primarily responsible for rendering 2D and 3D geometric models using OpenGL. It provides a set of intuitive rendering functions which makes it much easier for the engineering software to handle the geometry rendering. So, C3D Vision is a full-scale visualization engine.

C3D Labs Visualization Tools: Functionality Available to Native and Web Applications, photo 10
C3D Vision-generated scene and a VS application (written in C++) with the Vision test scenes

The component library is implemented in C++. It currently supports both Windows and Linux. There is a C# wrapper, so the visualization engine can also be used in .NET applications.

C3D Labs Visualization Tools: Functionality Available to Native and Web Applications, photo 11
A C3D Vision scene and a VS application (written in C#) with test scenes

The component is easily integrated with many custom GUI frameworks. It is required to add a geometry model scene window to the application interface. We’ve made demo projects with MFC (Microsoft) and Qt (The Qt Company) GUI libraries.

The C3D Vision library offers an extensive application programming interface (API) with dozens of classes and functions to control the visualization from within your end-user engineering application.

C3D Labs Visualization Tools: Functionality Available to Native and Web Applications, photo 12

Therefore, C3D Vision, a library for application developers, is a math component as described above. It is not an end-user application.

C3D Web Vision

This component has been gaining popularity fast, so, just like with Vision, tons of questions are arising. Some users, seeing the component name, legitimately consider it to be a “Vision for Web”, while others believe it is an end-user web application. Now we will find out what C3D Web Vision is, and how it incorporates the C3D Vision visualization library.

C3D Labs Visualization Tools: Functionality Available to Native and Web Applications, photo 13

Generally speaking, any typical web application is a client-server system consisting of the server (backend) and the client (frontend). The server and client can run on the same computer or different computers. In either case, they use network protocols for data exchange.

C3D Labs Visualization Tools: Functionality Available to Native and Web Applications, photo 14

A client is a program accessed by multiple end users. There are desktop and web (browser-based) clients. The client has a GUI. It is either installed on the end user’s PC or accessed from the browser.

A server is a program run on a high-performance computer. The server implements business logic for the client. The server receives requests from the clients and shares its resources with them.

C3D Web Vision does not support the client-server architecture described above. Instead, it has two modules for web application development. Let us take a closer look at the modules.

C3D Service

For easier Web Vision to end-user application integration, the component uses the so-called microservice architecture. This architecture divides comprehensive application functionality into individual modules or microservices handling specific business processes. These microservices may use a range of technologies and interact with other application components through their API.

So, C3D Service is a microservice that does the following.

C3D Labs Visualization Tools: Functionality Available to Native and Web Applications, photo 15
A part of the Web Vision integration diagram indicating the C3D Service role (the server side)

1. Managing the Model Structure and Attributes.

The microservice is responsible for model import/export in any exchange format (including .c3d), building the assembly components tree, adding the attributes to it, and constructing the triangulation mesh for model rendering. To import and export files in various exchange formats and manage the model structure, the microservice uses the C3D Converter and C3D Modeler components, respectively.

2. Geometry Cache Management for Quick Loading.

To loading models faster, the service caches the geometry definition. It reduces latency when the model is uploaded to the server, converted from its source format to .c3d, and rendered.

The caching process is quite simple. When a new model is loaded from the repository specified by the developer, the service generates some complex caches to store the geometry and materials definitions. When the same model is reopened, the service queries the cache for the model data and, if found, loads the model directly from the cache.

3. Managing User Connections and Workspaces.

For an active user of a Web Vision-based web application, the microservice creates a session and a dedicated workspace. The service can return the lists of all active users, sessions, and workspaces.

4. Tracking the Service Status.

5. Changing the Service Settings.

The web solution server communicates directly with the C3D microservice. For this, the service provides a REST API with the functionality listed above in items 1-5. Note that the developer can choose any programming language for the server part, because we’ve made an Open API specification the REST API, and you can generate an API client for any Open API Generator-supported language. The specification is swagger.yaml file enclosed with the microservice.

C3D Viewer API

To control the model visualization in the browser, C3D Web Vision has a second module, the @c3dlabs/c3dviewer-api npm package to be used on the client side.

C3D Labs Visualization Tools: Functionality Available to Native and Web Applications, photo 16
A part of the Web Vision integration diagram indicating the @ c3dlabs/c3dviewer-api role (the client side)

The package contains several important components.

1. The c3dvision-wasm npm package. It is a library built from the C3D Vision visualization engine source files. To make the engine work in the web environment, its C++ source files have been converted to WebAssembly with Emscripten.

2. The c3dvision-wasm npm package. It is a library built from the C3D Vision visualization engine source files. To make the engine work in the web environment, its C++ source files have been converted to WebAssembly with Emscripten.

C3D Labs Visualization Tools: Functionality Available to Native and Web Applications, photo 17

3. The TypeScript API provides access to the library on the client side. It includes the packages above as dependencies.

To get started, C3D Viewer API offers a method to initialize an instance of the C3D Vision library. This method takes an object with the C3D microservice settings (hostname and port) as a mandatory argument. It establishes a datalink between Viewer API and C3D Service to transfer the model geometry and render it in Vision.

C3D Labs Visualization Tools: Functionality Available to Native and Web Applications, photo 18
Complete Web Vision integration diagram

Also, note that Web Vision visualization capabilities are somewhat limited compared to the desktop version. The key limitation is no editing: the model is read-only. So, Web Vision is only a viewer.

Now let us consider the Web Vision visualization capabilities provided by the C3D Viewer API and available to web developers.

1. 3D model/scene rendering.

C3D Labs Visualization Tools: Functionality Available to Native and Web Applications, photo 19

2. Managing the scene/model rendering options:

  • changing the background color, lighting conditions, and highlighting components
  • changing the model element colors
  • selecting the rendering type (shaded, shaded and wireframe, wireframe)
  • model elements visibility control.
C3D Labs Visualization Tools: Functionality Available to Native and Web Applications, photo 20

3. Camera controls:

  • rotate, pan, zoom, and rotate the model
  • changing the camera settings
  • standard drawing views.
C3D Labs Visualization Tools: Functionality Available to Native and Web Applications, photo 21

4. Dynamic cross-sections (adding, deleting, editing).

5. Object selection.

C3D Labs Visualization Tools: Functionality Available to Native and Web Applications, photo 22

6. Managing annotation objects:

  • comments, linear and angular dimensions,
  • adding, deleting, and updating the visual properties (text, font, color).

Hopefully, it is now clear that C3D Web Vision is not an end-user web application or a web counterpart to the C3D Vision visualization library, but a component that adds viewer functionality to your web application.

Still, have questions? Or would like a test run of our components? Feel free to contact C3D Labs! You can also download the desktop C3D Viewer, or check out the browser-based C3D Web Viewer.

Artem Maximenko, Junior Programmer C3D Labs
Author:
Artem Maximenko
Junior Programmer C3D Labs
Share
Up