#!/usr/bin/env bash #Set the following variable according to your setup ##################################################### BINVOX_PATH="$HOME/Downloads/binvox" YCB_PATH="$HOME/ycb" MESH_PATH="google_16k/nontextured.stl" ##################################################### BINVOX_CMD=$BINVOX_PATH STRT_DIR=$pwd cd $YCB_PATH for obj in $(ls -d */); do OBJ_PATH="$YCB_PATH/$obj$MESH_PATH" OBJ_DIR="$YCB_PATH/$obj" TEMP_FILE="${OBJ_PATH%.*}.binvox" echo "Processing $OBJ_PATH"; cd $OBJ_DIR if [ -f "$TEMP_FILE" ]; then rm $TEMP_FILE fi $BINVOX_CMD $OBJ_PATH -ri binvox2bt $TEMP_FILE rm $TEMP_FILE cd $YCB_PATH done cd $STRT_DIR