Command Line Application - MacCurdyLab/OpenVCAD-Public GitHub Wiki

Command Line Application

OpenVCAD can be built into a standalone command-line application that can be used to .VCAD files into PNG stacks, .VDB files, or binary voxel files. This documentation provides an overview on how to use this command line application.

Basic Usage

The command line OpenVCAD can be used as following:

./VCAD_Studio_cli <.vcad filename> -o <directory for output> -m <path/to/materials.json file> --slice

This command will open a .VCAD script file and slice it into PNG stacks using the supplied material definition file.

The <.vcad filename> is required and may be anywhere in the command. The -o output directory, -m material config path, and --slice parameters are optional and can be specified in any order. If the output directory is omitted, the program will export files to the same director that the executable is running. If the -m flag is omitted, then the program will use the default configuration provided in <OPEN_VCAD_INSTALL_DIR/configs/testing.json>. If the --slice flag is omitted the program will not generate a PNG stack.

Advanced Usage

The program can also be used to convert .VCAD files into OpenVDB grids using the --vdb flag. This will save a single file that contains two 3D-grids: 1. a scalar field level-set that represents the geometry of the iso-surface, and 2. a grid that contains the material values for the geometry. The following command can be used to generate a .VDB file.

./openvcad_cli <.vcad filename> --vdb

Full Command Help Listing:

The help menu can be displayed by using ./openvcad_cli -h. The following is the help listing:

Usage: ./openvcad_cli [options] input.vcad
OpenVCAD Multi-material compiler

Options:
  -?, -h, --help                          Displays help on commandline options.
  --help-all                              Displays help including Qt specific
                                          options.
  -v, --version                           Displays version information.
  -m, --materials <material_config.json>  The material config file to use
  -o, --out <vcad_output>                 The output path to save the sliced
                                          files to
  -s, --slice, --stack                    Slice the input file into a stack of
                                          PNGs
  --vdb, --openvdb                        Export the input file as a VDB file
  --binvox, --binary                      Export the input file as a binary
                                          voxel file
  --mesh                                  Export the input file as a mesh file

Arguments:
  input_file                              The input file to slice