Configuration Example

This example shows all possible configurations for 3D visualization. You can configure the visualization settings for your application either through environment variables or by sending HTTP requests to specific routes. This documentation provides detailed instructions on how to configure the camera, orbitControls and scene settings.

Camera Configuration

The camera settings can be configured with the following environment variables:

Table 1 Camera Configuration

Property

Default Value

Description

V3DVISU_CAMERA__POSITION

[10, 10, 10]

The default position of the camera in the scene.

V3DVISU_CAMERA__FOV

15

The field of view for the camera.

This is an example of a docker compose file using the camera settings parameters:

docker-compose.camera.yml

 1services:
 2  codemeter:
 3    hostname: codemeter
 4    image: artifactory.vorausrobotik.com/docker/voraus-codemeter:1.0.0
 5    environment:
 6      LICENSE_SERVER: host.docker.internal
 7    extra_hosts:
 8      - host.docker.internal:host-gateway
 9
10  voraus-3d-visu:
11    image: artifactory.vorausrobotik.com/docker/voraus-3d-visu:0.15.1
12    hostname: voraus-3d-visu
13    ports:
14      - 8077:80
15    environment:
16      CODEMETER_HOST: codemeter
17      V3DVISU_CAMERA__FOV: "70"
18      V3DVISU_CAMERA__POSITION: "[1, 1, 1.6]"
19    depends_on:
20      - codemeter

The following picture shows the result of the configuration:

The 3D visualization with custom camera settings

Fig. 34 The 3D visualization with custom camera settings

Orbit Controls Configuration

The orbit controls settings can be configured with the following environment variables:

Table 2 OrbitControls Configuration

Property

Default Value

Description

V3DVISU_ORBITCONTROLS__DISTANCE_MIN

1

The minimum distance for the orbit controls.

V3DVISU_ORBITCONTROLS__DISTANCE_MAX

20

The maximum distance for the orbit controls.

V3DVISU_ORBITCONTROLS__SCREEN_SPACE_PANNING

False

Enables or disables screen space panning.

V3DVISU_ORBITCONTROLS__INITIAL_TARGET

[0, 0, 0]

Sets the initial target for the orbit controls.

This is an example of a docker compose file using the orbit controls settings parameters:

docker-compose.orbit-controls.yml

 1services:
 2  codemeter:
 3    hostname: codemeter
 4    image: artifactory.vorausrobotik.com/docker/voraus-codemeter:1.0.0
 5    environment:
 6      LICENSE_SERVER: host.docker.internal
 7    extra_hosts:
 8      - host.docker.internal:host-gateway
 9
10  voraus-3d-visu:
11    image: artifactory.vorausrobotik.com/docker/voraus-3d-visu:0.15.1
12    hostname: voraus-3d-visu
13    ports:
14      - 8077:80
15    environment:
16      CODEMETER_HOST: codemeter
17      V3DVISU_CAMERA__POSITION: "[9, 0, 3.5]"
18      V3DVISU_ORBITCONTROLS__DISTANCE_MIN: "2"
19      V3DVISU_ORBITCONTROLS__DISTANCE_MAX: "30"
20      V3DVISU_ORBITCONTROLS__SCREEN_SPACE_PANNING: "False"
21      V3DVISU_ORBITCONTROLS__INITIAL_TARGET: "[-0.3, 0, 0.8]"
22    depends_on:
23      - codemeter

The following picture shows the result of the configuration:

The 3D visualization with custom orbit control settings

Fig. 35 The 3D visualization with custom orbit control settings

Scene Configuration

The scene can be configured with the following environment variables:

Table 3 Scene Configuration

Property

Default Value

Description

V3DVISU_SCENE__COLOR

#ddd

The default color of the scene background.

V3DVISU_SCENE__GRID__ENABLED

True

Whether the grid is enabled in the scene.

V3DVISU_SCENE__GRID__SIZE

20

Number of divisions. Infinite grid has priority over size. Set fade distance to false to use.

V3DVISU_SCENE__GRID__INFINITE_GRID

True

Whether grid extends infinitely. Has priority over size. Set fade distance to false to use.

V3DVISU_SCENE__GRID__FADE_DISTANCE

50

The distance at which the grid starts to fade.

V3DVISU_SCENE__GRID__FADE_STRENGTH

2

The strength of the grid fade effect.

V3DVISU_SCENE__GRID__CELL_SIZE

0.1

The size of each cell in the grid.

V3DVISU_SCENE__GRID__CELL_COLOR

#cfcfcf

The color of the grid cells.

V3DVISU_SCENE__GRID__CELL_THICKNESS

1

The thickness of the grid cells.

V3DVISU_SCENE__GRID__SECTION_SIZE

1

The size of each section in the grid.

V3DVISU_SCENE__GRID__SECTION_COLOR

#bbbbbb

The color of the grid sections.

V3DVISU_SCENE__GRID__SECTION_THICKNESS

1

The thickness of the grid sections.

This is an example of a docker compose file which configures a dark mode using the scene settings parameters:

docker-compose.scene.yml

 1services:
 2  codemeter:
 3    hostname: codemeter
 4    image: artifactory.vorausrobotik.com/docker/voraus-codemeter:1.0.0
 5    environment:
 6      LICENSE_SERVER: host.docker.internal
 7    extra_hosts:
 8      - host.docker.internal:host-gateway
 9
10  voraus-3d-visu:
11    image: artifactory.vorausrobotik.com/docker/voraus-3d-visu:0.15.1
12    hostname: voraus-3d-visu
13    ports:
14      - 8077:80
15    environment:
16      CODEMETER_HOST: codemeter
17      V3DVISU_SCENE__COLOR: "#222"
18      V3DVISU_SCENE__GRID__ENABLED: "True"
19      V3DVISU_SCENE__GRID__INFINITE_GRID: "False"
20      V3DVISU_SCENE__GRID__SIZE: "4"
21      V3DVISU_SCENE__GRID__FADE_DISTANCE: "20"
22      V3DVISU_SCENE__GRID__FADE_STRENGTH: "0.1"
23      V3DVISU_SCENE__GRID__CELL_SIZE: "0.2"
24      V3DVISU_SCENE__GRID__CELL_THICKNESS: "0.8"
25      V3DVISU_SCENE__GRID__CELL_COLOR: "#454545"
26      V3DVISU_SCENE__GRID__SECTION_SIZE: "2"
27      V3DVISU_SCENE__GRID__SECTION_COLOR: "#555"
28      V3DVISU_LOGO: "voraus-gradient-white"
29    depends_on:
30      - codemeter

The following image shows the result of the configuration:

The 3D visualization with custom scene settings

Fig. 36 The 3D visualization with custom scene settings

General Purpose

The logo can be configured with the following environment variable:

Table 4 Logo Configuration

Property

Default Value

Description

V3DVISU_LOGO

voraus-gradient-black

Logo shown in the corner of the screen (voraus-gradient-white, voraus-white, voraus-black).

The debug mode can be enabled with the following environment variable:

Table 5 Debug Configuration

Property

Default Value

Description

V3DVISU_DEBUG

False

Activate the debug mode.

It is useful for debugging during development and enables the following features:

Ruler (Measurement Tool)

The ruler can be used to measure distances between points in the scene.

  • Hold Ctrl to activate the tool, snapping to the origin of objects.

  • Hold Ctrl + Shift to snap to surfaces.

  • Hold Ctrl + Alt to snap to vertices.

Server Configuration

The server settings can be configured with the following environment variables:

Table 6 Host Configuration

Property

Default Value

Description

V3DVISU_ALLOWED_HOSTS

[]

Allowed hosts for outbound requests, such as URLs from which models can be loaded.