-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5c2b098
commit 59a33b0
Showing
9 changed files
with
186 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
FROM python:3.6 | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
automake \ | ||
bison \ | ||
build-essential \ | ||
cmake \ | ||
libboost-dev \ | ||
libgl1-mesa-dev \ | ||
libglu1-mesa-dev \ | ||
libharfbuzz-dev \ | ||
libpcre3-dev \ | ||
libsm6 \ | ||
wget | ||
|
||
WORKDIR /tmp/build | ||
|
||
ARG SWIG_VERSION=3.0.9 | ||
ARG FREETYPE_VERSION=2.6.3 | ||
ARG OCE_VERSION=0.18.3 | ||
ARG SMESH_VERSION=6.7.6 | ||
ARG PYTHONOCC_CORE_VERSION=0.18.1 | ||
|
||
COPY build-files/build_swig.sh /tmp | ||
COPY build-files/build_freetype.sh /tmp | ||
COPY build-files/build_oce.sh /tmp | ||
COPY build-files/build_smesh.sh /tmp | ||
COPY build-files/build_pythonocc_core.sh /tmp | ||
|
||
copy convert-stl.py / | ||
|
||
RUN chmod +x ../*.sh | ||
RUN chmod +x /convert-stl.py | ||
|
||
RUN ../build_swig.sh $SWIG_VERSION | ||
RUN ../build_freetype.sh $FREETYPE_VERSION | ||
RUN ../build_oce.sh $OCE_VERSION | ||
RUN ../build_smesh.sh $SMESH_VERSION | ||
RUN ../build_pythonocc_core.sh $PYTHONOCC_CORE_VERSION | ||
|
||
|
||
|
||
WORKDIR / | ||
|
||
RUN apt-get remove --auto-remove -y \ | ||
automake \ | ||
bison \ | ||
build-essential \ | ||
cmake \ | ||
libboost-dev \ | ||
libpcre3-dev \ | ||
wget && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
COPY entrypoint.sh /entrypoint.sh | ||
RUN chmod +x /entrypoint.sh | ||
ENTRYPOINT ["/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: '.STEP to .STL Action' | ||
description: 'Convert videos in the folder to the given format' | ||
inputs: | ||
step-file: | ||
description: 'original file' | ||
required: true | ||
default: '' | ||
output-folder: | ||
description: 'Folder in which converted file is stored' | ||
required: true | ||
default: 'output' | ||
outputs: | ||
time: # id of output | ||
description: 'The time we greeted you' | ||
runs: | ||
using: 'docker' | ||
image: 'Dockerfile' | ||
args: | ||
- ${{ inputs.file }} | ||
- ${{ inputs.output-folder }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
FREETYPE_VERSION=$1 | ||
|
||
wget -q https://download.savannah.gnu.org/releases/freetype/freetype-$FREETYPE_VERSION.tar.gz | ||
tar -xf freetype-$FREETYPE_VERSION.tar.gz | ||
./freetype-$FREETYPE_VERSION/configure | ||
make | ||
make install | ||
rm -rf * .* | ||
echo -en "\007" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
OCE_VERSION=$1 | ||
|
||
wget -q https://github.com/tpaviot/oce/archive/OCE-$OCE_VERSION.tar.gz | ||
tar -xf OCE-$OCE_VERSION.tar.gz | ||
cmake ./oce-OCE-$OCE_VERSION | ||
make -j$(nproc --all) | ||
make install/strip | ||
rm -rf * .* | ||
echo -en "\007" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
PYTHON_OCC_CORE_VERSION=$1 | ||
|
||
wget -q https://github.com/tpaviot/pythonocc-core/archive/$PYTHON_OCC_CORE_VERSION.tar.gz | ||
tar -xf $PYTHON_OCC_CORE_VERSION.tar.gz | ||
|
||
cmake ./pythonocc-core-$PYTHON_OCC_CORE_VERSION \ | ||
-DPYTHON_INCLUDE_DIR=/usr/local/include/python3.6m \ | ||
-DPYTHON_LIBRARY=/usr/local/lib/libpython3.6m.so \ | ||
-DPYTHONOCC_WRAP_SMESH=TRUE | ||
|
||
make -j$(nproc --all) | ||
make install | ||
rm -rf * .* | ||
echo -en "\007" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
SMESH_VERSION=$1 | ||
|
||
wget -q https://github.com/tpaviot/smesh/archive/$SMESH_VERSION.tar.gz | ||
tar -xf $SMESH_VERSION.tar.gz | ||
cmake smesh-$SMESH_VERSION | ||
make -j$(nproc --all) | ||
make install | ||
rm -rf * .* | ||
echo -en "\007" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
SWIG_VERSION=$1 | ||
|
||
wget -q https://github.com/swig/swig/archive/rel-$SWIG_VERSION.tar.gz | ||
tar -xf rel-$SWIG_VERSION.tar.gz | ||
cd swig-rel-$SWIG_VERSION | ||
./autogen.sh | ||
cd .. | ||
./swig-rel-$SWIG_VERSION/configure | ||
make | ||
make install | ||
rm -rf * .* | ||
echo -en "\007" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from OCC.STEPControl import STEPControl_Reader | ||
from OCC.StlAPI import StlAPI_Writer | ||
import sys | ||
|
||
input_file = sys.argv[1][0] | ||
output_file = sys.argv[1][1] | ||
|
||
|
||
step_reader = STEPControl_Reader() | ||
step_reader.ReadFile( input_file ) | ||
step_reader.TransferRoot() | ||
myshape = step_reader.Shape() | ||
print("File read") | ||
|
||
# Export to STL | ||
stl_writer = StlAPI_Writer() | ||
stl_writer.SetASCIIMode(True) | ||
stl_writer.Write(myshape, output_file) | ||
print("Written") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
#!/bin/sh -l | ||
|
||
OIFS="$IFS" | ||
IFS=$'\n' | ||
for IN in `find $1 -iname "*.*"` | ||
do | ||
OUT=${IN/$1/$3} | ||
DIR=$(dirname $OUT) | ||
FILE_NAME="${IN##*/}" | ||
FILE_EXTENSION="${FILE_NAME##*.}" | ||
FILE_TYPE=".stl" | ||
mkdir -p "$DIR" | ||
|
||
echo "Converting $IN" | ||
python convert-stl $IN ${OUT/$FILE_EXTENSION/$FILE_TYPE} | ||
|
||
|
||
done | ||
IFS="$OIFS" |