Skip to content

Commands

Global Options

xconvert [OPTIONS] COMMAND [ARGS]...
OptionDescription
--license PATHPath to XVR1 license file (overrides env / default location)
--versionPrint version and exit
-v, --verboseIncrease log verbosity (-v = INFO, -vv = DEBUG)
--helpShow help and exit

xconvert convert

Convert a 3D file to GLB (or FBX / OBJ / STL).

xconvert convert [OPTIONS] INPUT_FILE

Arguments

ArgumentRequiredDescription
INPUT_FILEYesPath to the source 3D file

Options

OptionTypeDefaultDescription
-o, --outpath<input>.glb next to inputOutput file path
-f, --formatglb|fbx|obj|stlglbOutput format
--file-typecad|mesh|pointcloudauto-detectedOverride file type detection
--optimize / --no-optimizeflagdisabledRun mesh decimation pass
--target-ratiofloat 0.01–1.0Face reduction ratio (used with --optimize)
--rmsfloat0.04RMS quality target as fraction of bounding-box diagonal
--hausdorfffloat (µm)Hausdorff tolerance in microns; enables HDB decimation mode
--lodsint 1–3Number of LOD levels to generate alongside the main output
--chunk / --no-chunkflagdisabledSpatially chunk output for browser streaming
--chunk-sizefloatautoWorld-space chunk cube size override
-w, --workersint4CPU worker threads
--work-dirpathsystem tempTemp directory for intermediate files
--jsonflagdisabledEmit newline-delimited JSON progress on stdout
--helpShow help and exit

Examples

bash
# Basic conversion
xconvert convert assembly.step --out assembly.glb

# With 3 LODs and spatial chunking (for XViewr viewer)
xconvert convert assembly.step --out assembly.glb --lods 3 --chunk

# Aggressive decimation
xconvert convert large.glb --optimize --target-ratio 0.2

# Hausdorff-bounded decimation (preserves geometry within 50µm)
xconvert convert precise.step --hausdorff 50

# CI with JSON progress stream
xconvert convert model.step --json 2>/dev/null

xconvert decimate

Decimate an existing GLB into multiple LOD levels.

xconvert decimate [OPTIONS] INPUT_GLB

Arguments

ArgumentRequiredDescription
INPUT_GLBYesPath to source GLB file

Options

OptionTypeDefaultDescription
-o, --out-dirpath<input>_decimated/Output directory
--rmsfloat0.04RMS quality target — lower = higher quality, more faces
--hausdorfffloat (µm)Hausdorff tolerance in µm; enables HDB mode instead of RMS
--initial-factorfloatOverride initial face-count fraction for binary search
-w, --workersint4Parallel worker processes
--jsonflagdisabledEmit newline-delimited JSON progress
--helpShow help and exit

Output

out-dir/
├── lod0.glb        # Highest quality (binary-search RMS target)
├── lod1.glb        # 75% of lod0 faces
├── lod2.glb        # 15% of lod0 faces
└── lod3.glb        # 4% of lod0 faces

Examples

bash
xconvert decimate model.glb --out-dir model_lods/

# Tighter quality (fewer faces removed)
xconvert decimate model.glb --rms 0.01 --out-dir model_lods/

xconvert chunk

Spatially partition a GLB into browser-streamable chunks with LOD.

xconvert chunk [OPTIONS] INPUT_GLB

Arguments

ArgumentRequiredDescription
INPUT_GLBYesPath to source GLB file

Options

OptionTypeDefaultDescription
-o, --out-dirpath<input>_chunks/Output directory for chunks
--obj-dirpathPre-built OBJ decimation directory from xconvert decimate; skips re-decimation
--rmsfloat0.04RMS target for auto-decimation (ignored when --obj-dir is supplied)
--min-cubesintconfig defaultMinimum number of spatial chunks
--max-cubesintconfig defaultMaximum number of spatial chunks
--target-primsintconfig defaultTarget primitives per chunk
--max-vertsintconfig defaultMax vertices per chunk
-w, --workersint4Worker threads
--jsonflagdisabledEmit newline-delimited JSON progress
--helpShow help and exit

Output

out-dir/
├── manifest.json
├── lod0/
│   ├── chunk_0000_lod0.glb
│   ├── chunk_0001_lod0.glb
│   └── ...
└── lod1/
    ├── chunk_0000_lod1.glb
    └── ...

Examples

bash
# Chunk an existing GLB (runs decimation automatically)
xconvert chunk model.glb --out-dir model_chunks/

# Reuse decimation output from a previous decimate run (faster)
xconvert chunk model.glb --obj-dir model_lods/ --out-dir model_chunks/

xconvert info

Inspect a 3D file or verify binary tool availability.

xconvert info [OPTIONS] [INPUT_FILE]

Arguments

ArgumentRequiredDescription
INPUT_FILENoPath to 3D file to inspect

Options

OptionDescription
--jsonOutput inspection results as JSON
--check-binariesReport status of bundled native binaries and exit (no file required)
--helpShow help and exit

Examples

bash
# Check all native binaries are present
xconvert info --check-binaries

# Inspect a file
xconvert info model.glb
xconvert info model.step --json

JSON Progress Protocol

All commands support --json to emit newline-delimited JSON events on stdout. Logs always go to stderr, keeping the JSON stream clean.

bash
xconvert convert model.step --json

Event types:

typeFieldsDescription
startfile, formatConversion started
progressstage, progress (0–100), messageStage update
resultfiles (list of output paths)Completed successfully
errormessage, codeFailed

Example stream:

json
{"type":"start","file":"model.step","format":"glb"}
{"type":"progress","stage":"convert","progress":15,"message":"Parsing STEP geometry"}
{"type":"progress","stage":"convert","progress":80,"message":"Exporting GLB"}
{"type":"result","files":["model.glb","model.edges.json"]}

Environment Variables

VariableDescription
XVIEWR_LICENSE_KEYXVR1 token string or path to a .lic file
XCONVERT_XCAD_BINOverride path to StepParserOCCT binary
XCONVERT_FBX2GLTF_BINOverride path to FBX2glTF binary
DISPLAYX display for headless rendering on Linux (set to :99 in Docker)

XViewr SDK and xConvert CLI documentation.