Choosing an API Layer#
ovclash, the clash detection library for USD scenes, has two supported API layers, the canonical API and the Suite API. Each has a C ABI (application binary interface) and one Python package. Neither layer is deprecated. Pick by need, not by recency.
One library. Both C ABIs are compiled into the one
ovclashshared library. There is no separate Suite library to link. The Suite C ABI is implemented on top of the canonical C ABI.Two peer Python packages.
ovclashbinds the canonical C ABI, andovclash_suitebinds the Suite C ABI. Neither package wraps the other, and a name that exists in both is a different object in each. Both packages ship in theovclashwheel and share one loader, so the native library loads once.Same shape. Every C entry point except a few string getters returns a status struct. Values come back in out-parameters, and ownership is explicit.
No shared handles. You can use both APIs in one process, but they share no handles. Only the optional ovstage headers share types; see Language mapping.
Product features are Suite-only. Persistence, export and
.clashDetectioncontainer support exist only in the Suite API, because they are product behavior, not engine behavior.
Comparison#
Canonical ( |
Suite ( |
|
|---|---|---|
Use when |
You want direct engine control with the least indirection: open a stage, scope it, run the pipeline, and read overlaps and overlap reports. |
You want the product workflow without assembling it: run a named query, store the results and export them. |
C handles |
|
|
Python classes |
|
|
C status |
|
|
Persistence |
None. Results live only in the context. The next run, |
SQLite |
Export |
None. |
HTML and JSON: |
Python report buffers |
Borrowed, zero-copy |
Owned copies. |
Async start |
|
|
Async handle release |
|
|
Asynchronous Pipelines covers both async handles and both Python
AsyncPipeline classes.
The same query in both packages#
The two programs of this section run one static query on
time_sampled.usda and print the one overlap. The stage ships in samples/data/, both in the
wheel’s ovclash package and in the SDK archive. Run the programs from that directory, or pass the stage’s
full path.
With ovclash:
from ovclash import ClashRuntime
with ClashRuntime() as runtime:
runtime.open_stage("time_sampled.usda")
runtime.set_scope(["/Root/Xform_Primitives/Cube"], ["/Root/Xform_Primitives/Plane"])
runtime.run_pipeline()
for index in range(runtime.get_overlap_count()):
record = runtime.get_overlap_record(index)
print(record.name0, record.name1, record.type.name, record.nb_elements)
/Root/Xform_Primitives/Cube /Root/Xform_Primitives/Plane MESH_VS_MESH 10
With ovclash_suite:
from ovclash_suite import ClashDetection
clash = ClashDetection()
try:
clash.open_stage("time_sampled.usda")
clash.set_scope_paths(["/Root/Xform_Primitives/Cube"], ["/Root/Xform_Primitives/Plane"])
clash.run_pipeline()
for index in range(clash.get_nb_overlaps()):
overlap = clash.get_overlap_data(index)
print(overlap.name0, overlap.name1, overlap.type.name, overlap.nb_elements)
finally:
clash.destroy()
/Root/Xform_Primitives/Cube /Root/Xform_Primitives/Plane NORMAL 10
The differences in this small case:
ClashRuntimeis a context manager.ClashDetectionis not, so destroy it explicitly.The scope setters differ:
set_scope()records the scope for the next pipeline, andset_scope_paths()applies it to the runtime at once.The same overlap reports
MESH_VS_MESHin one package andNORMALin the other; see Same names, different types.
To store the result, the Suite API adds ClashData and fetch_and_save_overlaps(); see
Suite Workflows.
Same names, different types#
These names exist in both Python packages: AsyncPipeline, BackendInfo,
backend_info, OverlapReportFlag, OverlapType, PipelineStepData, QueryStats and
RunSettings. Each package defines its own type or function under that name. Import from one
package and stay there. Do not pass a value from one package to the other.
The differences:
Name |
|
|
|---|---|---|
|
A curated subset of the native settings. |
The complete native run-settings payload. |
|
Defaults to |
Defaults to |
|
Defaults to |
Defaults to |
|
A |
An |
|
Applies |
Only enables the |
|
With legacy multithreading ( |
Accepts |
|
The pair type of an overlap: |
The classification of a clash record: |
|
Has |
Has no |
|
Has |
Has no |
|
Has |
Has no |
OverlapReportFlag and QueryStats have the same members and values in both packages. Only
the class differs.
The two OverlapType enums by value:
Value |
|
|
|---|---|---|
|
|
No member |
|
|
|
|
No member |
|
|
No member |
|
|
|
|
Two values are easy to misread:
OverlapTypevalue1isPOINT_VS_MESHinovclashandNORMAL(mesh-vs-mesh) inovclash_suite. BothUNDEFINEDmembers are0x7FFFFFFF, not zero. Compare a value with==against the member you mean, and never test it with!= 0.max_local_depth_modeis offset by one:1isMINIMALinovclashand medium inovclash_suite. Penetration depth describes both scales.
import ovclash
import ovclash_suite
print(ovclash.OverlapType(1).name) # POINT_VS_MESH
print(ovclash_suite.OverlapType(1).name) # NORMAL
print(ovclash.RunSettings().max_local_depth_mode.name) # DISABLED
print(ovclash_suite.RunSettings().max_local_depth_mode) # 1, the Suite's medium mode
print(ovclash.RunSettings is ovclash_suite.RunSettings) # False
Settings maps every setting across the C structs and both Python packages, with its default and effect.
Language mapping#
C / C++ |
Python |
|
|---|---|---|
Canonical |
|
|
Suite |
|
|
The headers and link artifacts ship only in the SDK archive. The wheel ships no headers.
C API Conventions gives the status, string and input rules of both C ABIs. The comments in the headers that the language mapping names are the per-function reference; References in the package lists every header.
Each C ABI also has an optional header whose functions only the ovstage build exports:
include/ovclash/ovclash_ovstage.handinclude/ovclash_suite/ovclash_suite_ovstage.h.The Suite ovstage header includes the canonical one. It reuses its
ovclash_ovstage_owner_operation_fnandovclash_ovstage_binding_ttypes, and with the binding its optionalovclash_ovstage_composition_t.
The Suite-only workflows have their own pages:
Persistence for stores, records and saving detection results
SQLite store for
.ovclashdbfilesDirectory Serializer for JSON directory stores
Export for HTML and JSON
Legacy Containers for
.clashDetectionfiles
Kit compatibility#
The wheel ships a third Python package, omni.physxclashdetectioncore. It is not a peer of the
other two. It is a Kit-free compatibility package that re-exports
ovclash_suite names, so existing Kit imports keep resolving outside Kit.
Use it only to port code that already imports it.
New code imports
ovclash_suitedirectly.
Kit Compatibility lists what the package covers and what it does not.
Which skill to read#
A skill is a focused playbook, Markdown plus code snippets, that teaches an agent or a person one
task with ovclash. The skills ship in skills/ at the package root, in the wheel and in the SDK
archive, and References in the package lists them with
the other references that ship. Four API skills each cover one API in one language:
Skill |
API |
Language |
|---|---|---|
|
Canonical |
Python |
|
Canonical |
C/C++ |
|
Suite |
Python |
|
Suite |
C/C++ |
One task skill, skills/ovclash-clash-processor/, needs no code: it runs queries on your own
stages from the command line with The Clash Processor.
The skill catalog, skills/README.md at the package root, which
References in the package also lists, says when to use
each skill.