Skip to content

QSlim (qslim)

Simplifies a triangle mesh by collapsing the edges of least quadric error first (Garland and Heckbert 1997), each to the quadric's optimum, until the vertex count reaches the target. With a positive eps_rel, every collapse keeps the surface inside an envelope around the input.

Tutorial · Spec source · Defaults · JSON Schema

Cite: Garland and Heckbert 1997, Surface Simplification Using Quadric Error Metrics

Required

application

string · required · one of qslim

Application name must be qslim.

input

string · required

Triangular input mesh.

Key options

output

string · default "out.obj"

Output file name.

target_rel

float · default 0.1

Target number of vertices relative to the number of input vertices.

target_abs

float · default -1

Absolute target number of vertices.

eps_rel

float · default -1

Envelope thickness relative to the bounding box diagonal. Negative (the default): no envelope.

boundary_eps_rel

float · default -1

Thickness of a tube around the open boundary of the input, relative to the bounding box diagonal. When positive, every collapse has to leave each boundary edge that descends from the input's boundary within this distance of the input's boundary edges, and collapses at the boundary are placed on the outline instead of at the quadric's optimum: a collapse along the boundary at the optimum on the edge, one between a boundary vertex and an interior one onto the boundary vertex. Boundary that a collapse opens away from the input's is not judged. Negative (the default): the boundary is held only by the surface envelope (eps_rel), a containment test that does not stop the outline from retracting along the surface -- measured at 20 to 100 times eps on synthetic open surfaces.

use_sample_envelope

bool · default false

Use sample envelope instead of exact one. The sampled envelope is the opt-in for pathological inputs, where one triangle covers millions of tiny ones (Thingi10K has such inputs): there it is much faster for surface simplification.

Other options

history_output

string · default ""

Record every committed operation and save the history here (see wmtk/history): the input surface and its edits, from which the map between input and output is rebuilt (the tracking application). On the memory route no file is written: any non-empty value records the history, and the bytes of the file it would be are returned in the report as history (bytes in Python; history::write_history or wm.write_history saves them). Empty: no recording.

preallocation_factor

float · default 6.0 · min 1.0

Mesh storage (connectivity + attributes) is preallocated to this factor times the live element count at init and consolidation. Operations take fresh slots from that headroom and are retried once it is exhausted. Lower it for pure-decimation runs, raise it for aggressive refinement.

Run control

input_dir

string · default ""

Directory where the input files are located. This is injected by the application and should not be set by the user.

num_threads

int · default 0

Number of threads. 0 runs sequentially and gives the same result on every run; with more threads the order of the operations depends on the schedule, and the result can change slightly from run to run.

log_file

string · default ""

Logs are not just printed on the terminal but also saved in this file.

report

string · default ""

A JSON file that stores information about the result and the method execution, e.g., runtime.

throw_on_fail

bool · default false

Throw exception if the output does not fulfil the desired criteria. No output will be generated.