Skip to content

Commit 3ccf990

Browse files
authored
Adds example for CAD file integration (#884)
1 parent 8d0df27 commit 3ccf990

File tree

8 files changed

+121
-0
lines changed

8 files changed

+121
-0
lines changed

.github/workflows/examples_test.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,3 +208,22 @@ jobs:
208208

209209
- name: Stop BaSyx Query Language Example
210210
run: docker compose -f examples/BaSyxQueryLanguage/docker-compose.yml down
211+
212+
test-basyx-cad:
213+
runs-on: ubuntu-latest
214+
name: Test BaSyx CAD file Example
215+
steps:
216+
- uses: actions/checkout@v5
217+
218+
- name: Set up JDK 17
219+
uses: actions/setup-java@v5
220+
with:
221+
java-version: '17'
222+
distribution: 'adopt'
223+
cache: maven
224+
225+
- name: Start BaSyx CAD file Example
226+
run: docker compose -f examples/BaSyxCADFiles/docker-compose.yml up -d
227+
228+
- name: Stop BaSyx CAD file Example
229+
run: docker compose -f examples/BaSyxCADFiles/docker-compose.yml down

examples/BaSyxCADFiles/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# BaSyx Example for integrating CAD Files
2+
3+
This example provides a setup for integrating CAD files into the BaSyx middleware.
4+
It includes a preconfigured AAS with a submodel containing CAD files as part of File Submodel Element.
5+
6+
The BaSyx AAS Web UI is able to display CAD files in the 3D viewer. The following formats are supported for now:
7+
8+
- glTF
9+
- OBJ
10+
- STL
11+
12+
> [!NOTE]
13+
> Other formats like STEP files can still be uploaded and downloaded, but won't be displayed in the 3D viewer.
14+
15+
## How to run the BaSyx + CAD File Example
16+
17+
1. Open a terminal in this folder
18+
2. Run the following command to start the BaSyx containers:
19+
20+
```bash
21+
docker-compose up -d
22+
```
23+
24+
> To run the example containers, you need to have Docker installed on your device.
25+
26+
## View the working Example
27+
28+
To see the working example, open the [BaSyx AAS Web UI](http://localhost:3000) and navigate to a File Submodel Element with a CAD file. You should see a 3D viewer displaying the CAD file under the `Visualization` tab on the right side of the UI.
267 KB
Binary file not shown.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
server.port=8081
2+
basyx.backend=InMemory
3+
basyx.environment=file:aas
4+
basyx.cors.allowed-origins=*
5+
basyx.cors.allowed-methods=GET,POST,PATCH,DELETE,PUT,OPTIONS,HEAD
6+
basyx.aasrepository.feature.registryintegration=http://aas-registry:8080
7+
basyx.submodelrepository.feature.registryintegration=http://sm-registry:8080
8+
basyx.externalurl=http://localhost:8081
9+
spring.servlet.multipart.max-file-size=500MB
10+
spring.servlet.multipart.max-request-size=500MB
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
basyx:
2+
cors:
3+
allowed-origins: '*'
4+
allowed-methods: GET,POST,PATCH,DELETE,PUT,OPTIONS,HEAD
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
basyx:
2+
cors:
3+
allowed-origins: '*'
4+
allowed-methods: GET,POST,PATCH,DELETE,PUT,OPTIONS,HEAD
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
services:
2+
aas-env:
3+
image: eclipsebasyx/aas-environment:2.0.0-SNAPSHOT
4+
container_name: aas-env
5+
environment:
6+
- SERVER_PORT=8081
7+
volumes:
8+
- ./aas:/application/aas
9+
- ./basyx/aas-env.properties:/application/application.properties
10+
ports:
11+
- '8081:8081'
12+
restart: always
13+
depends_on:
14+
aas-registry:
15+
condition: service_healthy
16+
sm-registry:
17+
condition: service_healthy
18+
aas-registry:
19+
image: eclipsebasyx/aas-registry-log-mem:2.0.0-SNAPSHOT
20+
container_name: aas-registry
21+
ports:
22+
- '8082:8080'
23+
environment:
24+
- SERVER_PORT=8080
25+
volumes:
26+
- ./basyx/aas-registry.yml:/workspace/config/application.yml
27+
restart: always
28+
sm-registry:
29+
image: eclipsebasyx/submodel-registry-log-mem:2.0.0-SNAPSHOT
30+
container_name: sm-registry
31+
ports:
32+
- '8083:8080'
33+
environment:
34+
- SERVER_PORT=8080
35+
volumes:
36+
- ./basyx/sm-registry.yml:/workspace/config/application.yml
37+
restart: always
38+
aas-web-ui:
39+
image: eclipsebasyx/aas-gui:SNAPSHOT
40+
container_name: aas-ui
41+
ports:
42+
- '3000:3000'
43+
environment:
44+
AAS_REGISTRY_PATH: http://localhost:8082/shell-descriptors
45+
SUBMODEL_REGISTRY_PATH: http://localhost:8083/submodel-descriptors
46+
AAS_REPO_PATH: http://localhost:8081/shells
47+
SUBMODEL_REPO_PATH: http://localhost:8081/submodels
48+
CD_REPO_PATH: http://localhost:8081/concept-descriptions
49+
restart: always
50+
depends_on:
51+
aas-env:
52+
condition: service_healthy

examples/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,7 @@ See the separate [Node-RED example](BaSyxNodeRED) for a comprehensive setup leve
4545
## BaSyx AAS Query Language Example
4646

4747
See the separate [AAS Query Language Example](BaSyxQueryLanguage) for a comprehensive setup leveraging the AAS Query Language.
48+
49+
## BaSyx Example for integrating CAD Files
50+
51+
See the separate [CAD File Example](BaSyxCADFiles) for a comprehensive setup showcasing how to integrate CAD files into an AAS.

0 commit comments

Comments
 (0)