diff --git a/.github/workflows/examples_test.yml b/.github/workflows/examples_test.yml index b10496c0a..cedd4ea7d 100644 --- a/.github/workflows/examples_test.yml +++ b/.github/workflows/examples_test.yml @@ -208,3 +208,22 @@ jobs: - name: Stop BaSyx Query Language Example run: docker compose -f examples/BaSyxQueryLanguage/docker-compose.yml down + + test-basyx-cad: + runs-on: ubuntu-latest + name: Test BaSyx CAD file Example + steps: + - uses: actions/checkout@v5 + + - name: Set up JDK 17 + uses: actions/setup-java@v5 + with: + java-version: '17' + distribution: 'adopt' + cache: maven + + - name: Start BaSyx CAD file Example + run: docker compose -f examples/BaSyxCADFiles/docker-compose.yml up -d + + - name: Stop BaSyx CAD file Example + run: docker compose -f examples/BaSyxCADFiles/docker-compose.yml down diff --git a/examples/BaSyxCADFiles/README.md b/examples/BaSyxCADFiles/README.md new file mode 100644 index 000000000..5583f4657 --- /dev/null +++ b/examples/BaSyxCADFiles/README.md @@ -0,0 +1,28 @@ +# BaSyx Example for integrating CAD Files + +This example provides a setup for integrating CAD files into the BaSyx middleware. +It includes a preconfigured AAS with a submodel containing CAD files as part of File Submodel Element. + +The BaSyx AAS Web UI is able to display CAD files in the 3D viewer. The following formats are supported for now: + +- glTF +- OBJ +- STL + +> [!NOTE] +> Other formats like STEP files can still be uploaded and downloaded, but won't be displayed in the 3D viewer. + +## How to run the BaSyx + CAD File Example + +1. Open a terminal in this folder +2. Run the following command to start the BaSyx containers: + +```bash +docker-compose up -d +``` + +> To run the example containers, you need to have Docker installed on your device. + +## View the working Example + +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. diff --git a/examples/BaSyxCADFiles/aas/CADAAS.aasx b/examples/BaSyxCADFiles/aas/CADAAS.aasx new file mode 100644 index 000000000..f55d41c56 Binary files /dev/null and b/examples/BaSyxCADFiles/aas/CADAAS.aasx differ diff --git a/examples/BaSyxCADFiles/basyx/aas-env.properties b/examples/BaSyxCADFiles/basyx/aas-env.properties new file mode 100644 index 000000000..5c8c022c1 --- /dev/null +++ b/examples/BaSyxCADFiles/basyx/aas-env.properties @@ -0,0 +1,10 @@ +server.port=8081 +basyx.backend=InMemory +basyx.environment=file:aas +basyx.cors.allowed-origins=* +basyx.cors.allowed-methods=GET,POST,PATCH,DELETE,PUT,OPTIONS,HEAD +basyx.aasrepository.feature.registryintegration=http://aas-registry:8080 +basyx.submodelrepository.feature.registryintegration=http://sm-registry:8080 +basyx.externalurl=http://localhost:8081 +spring.servlet.multipart.max-file-size=500MB +spring.servlet.multipart.max-request-size=500MB diff --git a/examples/BaSyxCADFiles/basyx/aas-registry.yml b/examples/BaSyxCADFiles/basyx/aas-registry.yml new file mode 100644 index 000000000..4fac8db3a --- /dev/null +++ b/examples/BaSyxCADFiles/basyx/aas-registry.yml @@ -0,0 +1,4 @@ +basyx: + cors: + allowed-origins: '*' + allowed-methods: GET,POST,PATCH,DELETE,PUT,OPTIONS,HEAD diff --git a/examples/BaSyxCADFiles/basyx/sm-registry.yml b/examples/BaSyxCADFiles/basyx/sm-registry.yml new file mode 100644 index 000000000..4fac8db3a --- /dev/null +++ b/examples/BaSyxCADFiles/basyx/sm-registry.yml @@ -0,0 +1,4 @@ +basyx: + cors: + allowed-origins: '*' + allowed-methods: GET,POST,PATCH,DELETE,PUT,OPTIONS,HEAD diff --git a/examples/BaSyxCADFiles/docker-compose.yml b/examples/BaSyxCADFiles/docker-compose.yml new file mode 100644 index 000000000..1a86da05b --- /dev/null +++ b/examples/BaSyxCADFiles/docker-compose.yml @@ -0,0 +1,52 @@ +services: + aas-env: + image: eclipsebasyx/aas-environment:2.0.0-SNAPSHOT + container_name: aas-env + environment: + - SERVER_PORT=8081 + volumes: + - ./aas:/application/aas + - ./basyx/aas-env.properties:/application/application.properties + ports: + - '8081:8081' + restart: always + depends_on: + aas-registry: + condition: service_healthy + sm-registry: + condition: service_healthy + aas-registry: + image: eclipsebasyx/aas-registry-log-mem:2.0.0-SNAPSHOT + container_name: aas-registry + ports: + - '8082:8080' + environment: + - SERVER_PORT=8080 + volumes: + - ./basyx/aas-registry.yml:/workspace/config/application.yml + restart: always + sm-registry: + image: eclipsebasyx/submodel-registry-log-mem:2.0.0-SNAPSHOT + container_name: sm-registry + ports: + - '8083:8080' + environment: + - SERVER_PORT=8080 + volumes: + - ./basyx/sm-registry.yml:/workspace/config/application.yml + restart: always + aas-web-ui: + image: eclipsebasyx/aas-gui:SNAPSHOT + container_name: aas-ui + ports: + - '3000:3000' + environment: + AAS_REGISTRY_PATH: http://localhost:8082/shell-descriptors + SUBMODEL_REGISTRY_PATH: http://localhost:8083/submodel-descriptors + AAS_REPO_PATH: http://localhost:8081/shells + SUBMODEL_REPO_PATH: http://localhost:8081/submodels + CD_REPO_PATH: http://localhost:8081/concept-descriptions + restart: always + depends_on: + aas-env: + condition: service_healthy diff --git a/examples/README.md b/examples/README.md index 838562b3f..815bca300 100644 --- a/examples/README.md +++ b/examples/README.md @@ -45,3 +45,7 @@ See the separate [Node-RED example](BaSyxNodeRED) for a comprehensive setup leve ## BaSyx AAS Query Language Example See the separate [AAS Query Language Example](BaSyxQueryLanguage) for a comprehensive setup leveraging the AAS Query Language. + +## BaSyx Example for integrating CAD Files + +See the separate [CAD File Example](BaSyxCADFiles) for a comprehensive setup showcasing how to integrate CAD files into an AAS.