Upload Voxelize.sh
Browse filesAdding voxelize script
- Voxelize.sh +25 -0
Voxelize.sh
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/usr/bin/env bash
|
2 |
+
#Set the following variable according to your setup
|
3 |
+
#####################################################
|
4 |
+
BINVOX_PATH="$HOME/Downloads/binvox"
|
5 |
+
YCB_PATH="$HOME/ycb"
|
6 |
+
MESH_PATH="google_16k/nontextured.stl"
|
7 |
+
#####################################################
|
8 |
+
BINVOX_CMD=$BINVOX_PATH
|
9 |
+
STRT_DIR=$pwd
|
10 |
+
cd $YCB_PATH
|
11 |
+
for obj in $(ls -d */); do
|
12 |
+
OBJ_PATH="$YCB_PATH/$obj$MESH_PATH"
|
13 |
+
OBJ_DIR="$YCB_PATH/$obj"
|
14 |
+
TEMP_FILE="${OBJ_PATH%.*}.binvox"
|
15 |
+
echo "Processing $OBJ_PATH";
|
16 |
+
cd $OBJ_DIR
|
17 |
+
if [ -f "$TEMP_FILE" ]; then
|
18 |
+
rm $TEMP_FILE
|
19 |
+
fi
|
20 |
+
$BINVOX_CMD $OBJ_PATH -ri
|
21 |
+
binvox2bt $TEMP_FILE
|
22 |
+
rm $TEMP_FILE
|
23 |
+
cd $YCB_PATH
|
24 |
+
done
|
25 |
+
cd $STRT_DIR
|