Settings#
This page is the reference for every run setting: its name in each API, its default, its unit and its effect. Performance says which settings to change when a run is slow or uses too much memory. The Developer Guide says when a changed setting takes effect.
The settings form one table, the engine table: the settings table of the clash engine, compatible with Kit. Four surfaces set it, on the canonical API and on the Suite API:
Surface |
Settings type |
Apply |
Read back |
Defaults |
|---|---|---|---|---|
Canonical C |
|
|
|
|
|
|
|
|
|
Suite C |
|
|
|
|
|
A |
|
None |
|
The released packages use the ovstage backend,
and this page describes it. The unpublished reference build, which reads USD through
OpenUSD instead, differs for a few settings; the comments in
<ovclash/ovclash.h> document each difference.
On this page#
Names in each API#
Each row is one setting. A canonical flag is an OVCLASH_SETTINGS_FLAG_<NAME> bit of
ovclash_settings_t::flags; the table gives <NAME>. A Suite Python key is a SettingId
member, its integer value or its name, such as "SETTING_TOLERANCE". “None” means that the
surface cannot set the setting; it keeps its default there.
Canonical setter |
|
|
Suite C field |
Suite Python |
|---|---|---|---|---|
|
flag |
|
|
None; |
|
flag |
|
|
|
|
flag |
None |
|
|
|
flag |
|
|
|
|
|
None |
|
|
|
flag |
|
|
|
|
|
|
|
|
|
flag |
None |
|
|
|
flag |
None |
|
|
|
|
None |
|
|
|
|
None |
|
|
|
flag |
None |
|
|
|
|
None |
None |
None |
|
|
None |
None |
None |
|
flag |
None |
|
|
|
|
None |
|
|
|
|
None |
|
|
|
flag |
None |
|
|
|
|
None |
|
|
|
|
None |
|
|
|
|
|
|
|
|
|
None |
|
|
|
|
None |
|
|
|
|
|
|
Resolved from |
|
flag |
None |
|
|
|
flag |
None |
|
|
|
flag |
|
|
|
|
flag |
|
|
|
|
|
|
|
|
|
flag |
|
|
|
|
flag |
None |
None |
None |
|
flag |
|
|
|
The sections from Scope and selection to Logging give each
setting’s default in the engine table, the table that ovclash_reset_settings writes and that a new
context holds. Each default also gives the setting’s kind: On and Off mark a
flag, and a number marks a numeric value; the surface sections give the C and Python types.
Distances are in stage units, so the stage’s metersPerUnit applies. Every
floating-point value must be finite; a non-finite one is rejected, and the previous value stays.
Scope and selection#
Selection reads these settings when a run selects meshes, so a change applies from the next run. The point size is the exception: a change between the steps of a run applies from that run’s next sample.
Setting |
Default |
Effect |
|---|---|---|
Full scene |
On |
With no scope set, the run traverses the whole stage. With no scope and the flag off, nothing is selected. Setting it, on or off, clears any scope paths. A non-empty |
Ignore invisible prims |
On |
Invisible prims are excluded from mesh and point-cloud selection, so they never clash. |
Subcomponent filtering |
Off |
Skips a pair whose two meshes resolve to the same subcomponent root, the nearest ancestor with |
Point clouds |
Off |
Adds point-vs-mesh queries for |
Point size |
|
Point diameter (a width, not a radius) for point-cloud tests, in stage units, without the prim’s transform scale. A value above 0 applies to every point and is reported as |
Detection#
Setting |
Default |
Effect |
|---|---|---|
Tolerance |
|
Clearance distance in stage units: mesh pairs closer than this count as clashing, so a positive value reports near misses. |
Coplanar |
On |
Keeps coplanar triangle pairs that touch exactly as overlaps. Off discards them. |
Any hit |
Off |
Stops each mesh pair at its first colliding triangle. The pair is still reported, but |
Triangle limit |
|
Caps the colliding triangle pairs recorded per mesh pair. |
Overlap code |
|
Selects the triangle-triangle intersection kernel: 1 a variant of Moller’s triangle-triangle test, 2 a separating-axis test (SAT), 3 a SAT that uses SIMD vector instructions (SIMD SAT). |
Ignore redundant overlaps |
Off |
Drops a pair whose meshes and relative poses repeat a contact already recorded, typically instanced or shared geometry laid out identically. |
Only find duplicates |
Off |
Runs the duplicate-mesh search only. Duplicates are prim pairs with identical mesh data and equal poses within the pose epsilon. The overlap count is then 0, and only the duplicate getters return results. A dynamic query never searches for duplicates, so this flag with a time range finds nothing. |
Broad-phase limit |
|
Caps the candidate pairs of the broad phase. A run whose candidate count exceeds it is cancelled, not truncated; see Broad phase and geometry limits. |
Sort mode |
|
On ovstage only |
When the broad-phase limit cancels a run, the cancellation stays pending. A stepped static run
reports success for the broad-phase step and then rejects the next step. A sampled frame step
that exceeds the limit fails itself. An async run reports the stop from
ovclash_finish_pipeline, which clears it. Otherwise ovclash_reset_context clears it.
Bounds and cooking#
Cooking reads the cooking settings, so a change applies to meshes cooked by the next run. PhysX cooks each mesh into a midphase tree, the per-mesh bounding volume hierarchy that the narrow phase queries for triangles.
Setting |
Default |
Effect |
|---|---|---|
Tight bounds |
On |
Computes rotation-aware world bounds. They shrink the broad-phase candidate set for rotated meshes, at some extra cost. |
Bounds epsilon |
|
Inflates each mesh’s world bounds, as an additive offset in stage units and as a scale factor of 1 + epsilon. A value of 0 or above can only add candidate pairs; the narrow phase still decides. A negative value can shrink the bounds. |
Pose epsilon |
|
Per-element tolerance for comparing two world transforms, in the units of the matrix components (stage units for translation). It decides when meshes share a pose and when a pair is a duplicate. A negative value never matches. |
Quantized |
Off |
Cooks quantized midphase trees: less memory, at some cost in accuracy and speed. |
Triangles per leaf |
|
Triangles per leaf of the cooked midphase tree. Larger leaves cook faster and use less memory; smaller leaves query faster. Values outside 1 to 15 are rejected; 15 is also the maximum. A value of 1 is accepted and read back, but cooking falls back to 15. |
Area epsilon |
|
Minimum triangle area kept during cooking, in squared stage units. Smaller triangles are discarded and never appear in results. |
Penetration depth#
Depth is mesh-only. A point-vs-mesh overlap reports a maxLocalDepth of 0.0 in every mode.
Setting |
Default |
Effect |
|---|---|---|
Max local depth mode |
|
Computes the maximum local penetration depth of each overlap. |
Contact epsilon |
|
Minimum depth in stage units, used only while depth is computed. Overlaps with a smaller |
Contact cutoff |
|
Maximum-depth cutoff of the refined search, in stage units. It applies only while the contact epsilon is 0 or above and the mode is above |
The Suite C ABI and its Python package split the mode into an on/off gate and a mode on another scale:
Suite field |
Values |
|---|---|
|
The gate. 0, the default, maps to |
|
Read only while the gate is on: 0 minimal, 1 medium (the default), 2 high. 3 is rejected. |
The Suite scale is offset by one from ovclash_max_local_depth_mode_t and
ovclash.MaxLocalDepthMode, where 0 is DISABLED and 1, 2 and 3 are MINIMAL, MEDIUM and
HIGH. A canonical value passed in a Suite field therefore selects the next mode up.
The Suite’s depth_epsilon becomes the contact epsilon only while discard_touching_contacts is
set. Otherwise the contact epsilon stays -1.0. Its Suite default is -1.0.
Depth computation costs compares the modes.
Time sampling#
Query times are in seconds, not USD time codes; see Time units.
Setting |
Default |
Effect |
|---|---|---|
Start time, end time |
|
Equal times select a static query with one sample at that time. Otherwise the run samples from the start time; What results are stable gives the sample times. |
Time codes per second |
|
The query’s samples per second. It is not the stage’s time-code rate. |
Purge permanent static overlaps |
On |
In a dynamic run, drops pairs whose two meshes are both transform-static. A mesh counts as static only when its authored transforms prove it; a mesh with an unresolved initial transform value is treated as non-static. No effect on a static query. |
Purge permanent dynamic overlaps |
Off |
In a dynamic run, drops overlaps present in every sampled frame, such as modelling artifacts. No effect on a static query. |
ovclash_create_pipeline reads the three times to plan the steps. The
pipeline keeps that plan, so a later change of the times applies to the
next pipeline.
Each surface sets the times its own way:
Canonical C.
ovclash_set_times(context, start, end, rate), or the three struct fields. A descending range is accepted and takes one sample at the start time.ovclashPython.RunSettings.set_times=Trueappliesstart_time,end_timeandtime_codes_per_second. Withset_times=False, all three native times are 0.0, a static query at time 0. A descending range raisesValueError.Suite C.
start_time,end_timeandtime_codes_per_secondselect the samples.set_timesonly enables theend_time >= start_timecheck.dynamic,static_time,dynamic_start_timeanddynamic_end_timeare persisted query metadata that the runtime does not read; resolve them intostart_timeandend_timeyourself.ovclash_suitePython.ClashDetection.set_settings()resolves the times from the open stage’s timeline:With
SETTING_DYNAMICtrue, the run samples fromSETTING_DYNAMIC_START_TIMEtoSETTING_DYNAMIC_END_TIME. A time of0.0takes the stage’s start or end instead.Otherwise the run is static at
SETTING_STATIC_TIME, clamped to the stage’s time range.The sampling rate is the stage’s own time-codes-per-second rate. The optional
time_codes_per_secondkeyword sets another one; it must be positive.SETTING_DUP_MESHESmakes the run static.
Threading#
No threading control changes which pairs overlap or what is reported about them. On ovstage they do not change the result order either. They also govern report extraction and fetch-and-save frame preparation after detection, so you can change them between detection and fetching.
Setting |
Default |
Effect |
|---|---|---|
Single threaded |
Off |
Runs every phase serially. It overrides both task managers. |
New task manager |
On |
Runs parallel phases on the tasking of Carbonite, NVIDIA’s plugin and runtime framework, with the scheduler’s worker budget, and ignores the task count. Off selects |
Task count |
|
Used only while both other controls are off. The workers are bounded by the task count (0 counts as 1), the hardware concurrency and the available work. The engine clamps the value to 256. |
Validation of the task count differs per surface:
Surface |
Accepted task counts |
|---|---|
Canonical C |
Any value. The engine clamps it to 256, and |
|
1 to 255 while |
Suite C and |
0 to 1000000; larger values are rejected. The engine clamps the value to 256, but read-back returns the value you passed. |
Threading says when to change them, and Threading controls and result order gives the ordering rules.
Logging#
Setting |
Default |
Effect |
|---|---|---|
Log |
Off |
Prints per-phase progress and timing lines to stdout. There is no callback and no way to redirect the output, and the text is not a stable format. |
Collecting diagnostics for a bug report lists the other diagnostic switches.
Settings without effect#
These settings are accepted, stored and read back, and all except the experimental point-cloud flag are persisted with a query. Nothing in a standalone run acts on them, so they never change results:
Setting |
Spellings |
Note |
|---|---|---|
|
|
In Kit it selects the scene traversal of USDRT, Kit’s runtime scene representation. It stays in the table because persisted query settings carry it. |
Experimental point clouds |
|
ovstage never reads it. |
Query metadata |
The Suite fields |
The Suite C runtime does not read them; see Time sampling. They are validated as finite and persisted. |
ROI include and exclude paths |
|
The region-of-interest ROI paths of a query record, persisted and round-tripped. No query reads them, so two queries that differ only in them give identical results. Use an A/B scope, the two search sets of prim paths, instead. |
ovstage context settings#
Two settings of an ovstage context sit outside the engine table:
Setting |
API |
Default |
Effect |
|---|---|---|---|
Matrix decomposition |
|
|
How mesh matrices are decomposed. |
Dynamic matrix cache |
|
On |
Caches sampled transforms in bounded playback windows. Off reads one frame at a time and disables prefetch, the reading of the next playback window on a second worker. It does not change sample times or poses. See Dynamic runs. |
Both raise RuntimeError in Python on a backend without them. Using ovclash with an ovstage
Stage covers the rest of the ovstage-only API.
Defaults that differ between surfaces#
All four surfaces start from the engine table, with these exceptions:
Setting |
Engine table |
Exception |
|---|---|---|
|
On |
|
Time codes per second |
|
|
Depth |
|
The Suite API holds the gate off with mode 1 (medium), which is the same state. |
Pose and area epsilon, bounds epsilon |
|
The Suite defaults hold the exact doubles |
Depth epsilon |
No counterpart |
The Suite default is |
Two read-backs differ from the defaults you might expect:
ClashRuntime.get_run_settings()on a new runtime reports the engine table, notRunSettings():use_usdrt=Trueandtime_codes_per_second=0.0.ovclash_suite_get_run_settingsreports a zero-initialized struct until the first successfulovclash_suite_set_run_settings. The runtime uses the engine table until then.
Canonical C#
ovclash_settings_t in <ovclash/ovclash.h> is a plain struct: a flags bitmask of
ovclash_settings_flag_t values, the counts, limits and epsilons, maxLocalDepthMode, and the
three times. Every field is required, so start from ovclash_reset_settings, which writes the
defaults:
Field |
C type |
Default |
Setting |
|---|---|---|---|
|
|
|
Every on/off setting; Names in each API gives each flag |
|
|
|
Task count |
|
|
|
Sort mode |
|
|
|
Overlap code |
|
|
|
Triangles per leaf |
|
|
|
Triangle limit |
|
|
|
Broad-phase limit |
|
|
|
Pose epsilon, area epsilon |
|
|
|
Bounds epsilon |
|
|
|
Contact epsilon, contact cutoff |
|
|
|
Tolerance |
|
|
|
Point size |
|
|
|
Max local depth mode |
|
|
|
Start time, end time, in seconds |
|
|
|
Time codes per second |
Change fields and apply the whole struct. This function belongs in a C source file of your
program; ctx is a context from ovclash_create_context:
#include <stdio.h>
#include <ovclash/ovclash.h>
/* Applies the engine table with point clouds on and a 0.5 tolerance. Returns 0 on success. */
static int apply_settings(ovclash_context_t* ctx)
{
ovclash_settings_t settings;
ovclash_reset_settings(&settings); /* the engine table */
settings.flags |= OVCLASH_SETTINGS_FLAG_ENABLE_POINT_CLOUDS;
settings.tolerance = 0.5f;
settings.nbTasks = 1000;
if (ovclash_set_settings(ctx, &settings).status != OVCLASH_STATUS_SUCCESS)
{
ovclash_string_t error = ovclash_get_last_error(ctx);
fprintf(stderr, "%.*s\n", (int)error.length, error.ptr);
return 1;
}
ovclash_settings_t live;
ovclash_get_settings(ctx, &live);
printf("nbTasks: %u\n", live.nbTasks); /* prints 256: the engine clamps nbTasks */
return 0;
}
OVCLASH_SETTINGS_FLAG_DEFAULTsetsCOPLANAR,TIGHT_BOUNDS,FULL_SCENE,IGNORE_INVISIBLE_PRIMS,NEW_TASK_MANAGER,PURGE_PERMANENT_STATIC_OVERLAPSandUSDRT. Every other flag is off.ovclash_create_contextseeds a new context fromovclash_reset_settings, so the two agree field for field.ovclash_set_settingsvalidates the whole struct first: finite floats, a non-negativetimeCodesPerSecond,trisPerLeafin 1 to 15 andmaxLocalDepthModeup toHIGH. On a violation it stores nothing. It also clears any scope paths, so set the scope afterwards.A setter changes one value without a whole-struct push. A rejected setter stores nothing.
ovclash_get_settingsreads back the live settings, including per-setter changes.
ovclash Python#
ovclash.RunSettings is a dataclass over a subset of ovclash_settings_t: the fields in the
Names in each API table. Every field is optional and takes its dataclass
default:
Field |
Type |
Default |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
with_updates(**kwargs) returns a copy with the named fields replaced. Run this script with the
Python that has ovclash installed, and replace scene.usda with the path of your stage:
from ovclash import ClashRuntime, RunSettings
runtime = ClashRuntime()
try:
runtime.open_stage("scene.usda")
runtime.set_run_settings(RunSettings().with_updates(enable_point_clouds=True, tolerance=0.5))
# Change one field and keep the others: pass the current settings as the base.
runtime.set_run_settings(runtime.get_run_settings(), tolerance=0.0)
finally:
runtime.destroy()
ClashRuntime.set_run_settings(settings=None, **kwargs) applies settings with kwargs
replacing fields, and returns the effective settings:
Every call resets the settings that
RunSettingsdoes not model to the engine table.Without a base, it starts from
RunSettings(), so fields you do not pass take their dataclass defaults. Passruntime.get_run_settings()as the base to keep them.It raises
ValueErrorfor a value out of range or not finite, before anything is applied. A rejected call leaves the previous settings in place.It closes open overlap reports and discards the pipeline. Completed results stay.
The native context stores no set_times flag, so get_run_settings() reports
set_times=True only when a native time is non-zero. After set_times=False, and on a new
runtime, all three native times are 0.0. A time range enabled from that read-back keeps the
0.0 rate and takes one sample, so pass time_codes_per_second as well.
Suite C#
ovclash_suite_run_settings_t in <ovclash_suite/ovclash_suite_types.h> is a flat struct of
uint32_t flags and counts and double tolerances and times. A flag is 0 for false and non-zero
for true. Every field is required, so start from ovclash_suite_get_default_run_settings, which
fills it with these defaults:
Fields |
C type |
Default |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Names in each API maps each field to its setting. This function belongs in
a C source file of your program; runtime is a runtime from ovclash_suite_create_runtime:
#include <stdio.h>
#include <ovclash_suite/ovclash_suite.h>
/* Applies the Suite defaults with high-mode depth computation. Returns 0 on success. */
static int apply_suite_settings(ovclash_suite_runtime_t* runtime)
{
ovclash_suite_run_settings_t settings;
ovclash_suite_get_default_run_settings(&settings);
settings.compute_max_local_depth = 1;
settings.max_local_depth_mode = 2; /* high, on the Suite scale */
if (ovclash_suite_set_run_settings(runtime, &settings).status != OVCLASH_SUITE_STATUS_SUCCESS)
{
ovclash_suite_string_t error = ovclash_suite_get_last_error(runtime);
fprintf(stderr, "%.*s\n", (int)error.length, error.ptr);
return 1;
}
return 0;
}
ovclash_suite_set_run_settings rejects a struct with any out-of-range field, keeps the previous
settings and names the field in the last-error text. With tris_per_leaf = 16, for example, it
reads tris_per_leaf must be in [1, 15]. It rejects:
a non-finite
double;a value outside the
floatrange in a field that the engine stores asfloat:pose_epsilon,bounds_epsilon,area_epsilon,contact_cutoff,tolerance,point_size_override, anddepth_epsilonwhilediscard_touching_contactsis set;max_local_depth_modeabove 2,nb_tasksabove 1000000,tris_per_leafoutside 1 to 15;a negative
time_codes_per_second;a non-zero
set_timeswithend_timebelowstart_time.
The call also fails while an async pipeline or a fetch, a
fetch-and-save operation that is not yet destroyed, is alive. A scope set
with ovclash_suite_set_scope survives it, in either call order. ovclash_suite_get_run_settings
returns the last accepted struct, including the Suite-only fields that the engine does not store.
ovclash_suite Python#
DEFAULT_SETTINGS is a dict[SettingId, Any] built at import from
ovclash_suite_get_default_run_settings, so the Python defaults match the native ones.
ClashDetection starts from a copy, and ClashDetection.get_default_setting_value(setting_id)
reads one entry.
ClashDetection.set_settings(settings, stage=None, *, time_codes_per_second=None) takes a
partial mapping:
from ovclash_suite import ClashDetection, SettingId
clash = ClashDetection()
try:
clash.set_settings({SettingId.SETTING_TOLERANCE: 0.5, "SETTING_ENABLE_POINT_CLOUDS": True}, "scene.usda")
finally:
clash.destroy()
A key is a
SettingIdmember, its integer value or its name. Other keys are ignored without an error.A missing key takes its
DEFAULT_SETTINGSvalue, so each call sets the whole table.Full-scene traversal is always on.
stagenames the stage file, or a stage object whose root layer names it. A different file is opened, which drops the scope.It raises
ValueErrorfor a resolved value out of range or not finite, andRuntimeErrorwhen the native call rejects the settings or an async operation is alive.
ovclash_suite.RunSettings is the complete Suite payload as a dataclass, and
default_run_settings() returns the native defaults in that form. ClashDetection does not take
it; Persisted query settings does. Each field carries the
ovclash_suite_run_settings_t field of the same name, with the range that Suite C
gives, and Names in each API maps it to its setting. Every field is
optional:
Field |
Type |
Required |
Default or values |
Description |
|---|---|---|---|---|
|
|
No |
|
The Suite C flags of the same names. |
|
|
No |
|
The Suite C flags of the same names. |
|
|
No |
|
The depth mode on the Suite scale, read only while |
|
|
No |
|
The task count. |
|
|
No |
|
Triangles per leaf. |
|
|
No |
|
The intersection kernel. |
|
|
No |
|
The triangle limit. |
|
|
No |
|
Persisted query metadata that the runtime does not read. |
|
|
No |
|
The sampled range, in seconds. |
|
|
No |
|
The query’s samples per second. |
|
|
No |
|
The tolerance and the point size, in stage units. |
|
|
No |
|
The pose and area epsilons. |
|
|
No |
|
The bounds epsilon. |
|
|
No |
|
The depth epsilon and the contact cutoff. |
RunSettings.with_updates(**kwargs) returns a copy with the named fields replaced.
Persisted query settings#
A ClashQuery stores its settings as a JSON object whose keys are the SettingId names, such as
SETTING_TOLERANCE. Generate that text instead of spelling the names by hand:
C:
ovclash_suite_run_settings_to_query_settings_json(settings, buffer, size, &required).Python:
ovclash_suite.run_settings_to_query_settings_json(settings), orrun_settings_to_query_settings_dict(settings)for the decodeddict.
The JSON has one key per SettingId member, and the writer always writes every key. It does not
carry start_time, end_time, time_codes_per_second, set_times or enable_full_scene. Each
key carries one Suite C field, and the default is the value written for
ovclash_suite_get_default_run_settings:
Key |
JSON type |
Suite C field |
Default |
|---|---|---|---|
|
boolean |
|
|
|
boolean |
|
|
|
number |
|
|
|
number |
|
|
|
boolean |
|
|
|
boolean |
|
|
|
boolean |
|
|
|
boolean |
|
|
|
boolean |
|
|
|
boolean |
|
|
|
boolean |
|
|
|
integer |
|
|
|
number |
|
|
|
number |
|
|
|
number |
|
|
|
integer |
|
|
|
number |
|
|
|
boolean |
|
|
|
integer |
|
|
|
boolean |
|
|
|
number |
|
|
|
boolean |
|
|
|
number |
|
|
|
boolean |
|
|
|
boolean |
|
|
|
boolean |
|
|
|
integer |
|
|
|
boolean |
|
|
|
boolean |
|
|
|
number |
|
|
|
integer |
|
|
|
boolean |
|
|
|
number |
|
|
Suite C gives each field’s range. Numbers
are written with 17 significant digits so that they round-trip exactly; the default epsilon
1e-6 is written as 9.9999999999999995e-07. Negative zero is written as -0.0. The text does
not depend on the caller’s locale or floating-point environment. A non-finite field fails the
call.