From ec4bff651866fd977e34f0250732b79d5fc9dfba Mon Sep 17 00:00:00 2001 From: Alex38Lyon <55714436+Alex38Lyon@users.noreply.github.com> Date: Fri, 28 Aug 2026 09:07:01 +0200 Subject: [PATCH] Add workflow to convert PLY to STL/OBJ This workflow automatically converts PLY files to STL and OBJ formats upon push events. --- .github/workflows/ConvertPLYtoSTL_OBJ.yml | 41 +++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/ConvertPLYtoSTL_OBJ.yml diff --git a/.github/workflows/ConvertPLYtoSTL_OBJ.yml b/.github/workflows/ConvertPLYtoSTL_OBJ.yml new file mode 100644 index 0000000..246b095 --- /dev/null +++ b/.github/workflows/ConvertPLYtoSTL_OBJ.yml @@ -0,0 +1,41 @@ +name: Convert PLY to STL/OBJ + +on: + push: + paths: + - '**/*.ply' + +jobs: + convert: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: actions/setup-python@v7 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install trimesh numpy + - name: Convert PLY files + run: | + python -c " + import trimesh + import glob + import os + + for f in glob.glob('**/*.ply', recursive=True): + print(f'Conversion de {f}') + mesh = trimesh.load(f) + stl = os.path.splitext(f)[0] + '.stl' + obj = os.path.splitext(f)[0] + '.obj' + mesh.export(stl) + mesh.export(obj) + print(f' -> {stl}') + print(f' -> {obj}') + " + + - name: Commit converted files + uses: stefanzweifel/git-auto-commit-action@v7 + with: + commit_message: "Auto-convert PLY to STL/OBJ"