Shared foundation for Kit-CAE agent skills. Contains import APIs, visualization commands, stage discovery, format references, and utility scripts used by cae-visualization and cae-capture. Not invoked directly by users - loaded as a dependency by other CAE skills.
Instrucciones de origen · Vista previa de solo lectura
name
cae-core
description
Shared foundation for Kit-CAE agent skills. Contains import APIs, visualization commands, stage discovery, format references, and utility scripts used by cae-visualization and cae-capture. Not invoked directly by users - loaded as a dependency by other CAE skills.
Reference library for other CAE skills (cae-visualization, cae-capture).
When formats or APIs change, update files here once.
Purpose
Shared foundation for Kit-CAE agent skills (cae-visualization, cae-capture, cae-streaming). Centralizes preflight, launch flags, import APIs, stage discovery, and the Z-up coordinate convention so the other skills do not re-document the same primitives.
Prerequisites
A built Kit-CAE checkout. Validate with the steps in ## Preflight Checklist below.
Instructions
Run preflight — verify each check in ## Preflight Checklist before any other action.
Launch Kit-CAE — pick the right .kit file and pass the launch flags from ## Launching Kit-CAE.
Run a script — invoke any helper in with the pattern shown in ().
Apply the critical rules — Z-up convention, OmniSci stage discovery,
and top-level imports — see ## Critical Rules and ## Z-Up Coordinate System.
Reference the API — detailed call patterns live in references/kit-cae-api.md; format-specific stage layout lives in references/formats.md.
Examples
Bundled scripts (invoke via the run_script pattern in ## Running Scripts):
Script
Purpose
scripts/inspect_cgns.py
Inspect a CGNS file: bases, zones, datasets, flow solutions, fields.
scripts/inspect_vtk.py
Inspect a VTK file and list its fields.
scripts/query_stats.py
Query field min/max/mean for a stage path.
scripts/warmup.py
Compile the Kit shader cache by launching briefly and exiting.
See references/kit-cae-api.md for additional code patterns.
Limitations
Kit-CAE skills inspect and visualize CAE datasets — they do not modify source files. Workflows require an interactive Kit-CAE session with a renderer; headless operation requires a virtual display. Time-varying data is supported only for formats that expose a time index.
Preflight Checklist
Kit-CAE repo present? — look for repo.sh at the root
All native formats, including VTK, CGNS, EnSight, OpenFOAM, NPZ, and EDEM
omni.cae_vtk.kit
Legacy workflows that directly import the VTK Python package
For browser-streamed sessions (long-lived Kit-CAE that a remote client
watches and drives), see skills/cae-streaming/SKILL.md. That skill ships
a streaming-enabled .kit template, a launcher, and a handler-registration
reference. Do not use the "Script shutdown (MANDATORY)" template below for
streaming listeners — they must run until the app is signaled.
Basic (headless)
cd <kit-cae-dir>
./repo.sh launch -n <kit_file> -- --exec scripts/<script>.py --no-window
Render-Product Capture (MANDATORY for clean output)
Settings that affect the renderer MUST be launch args, never carb.settings
mid-render (ERROR_DEVICE_LOST):
Hard rule: Every Python script runs inside Kit-CAE via ./repo.sh launch ... --exec.
Never call python3 or system Python directly — the host Python environment is
unknown and unsupported. Kit's --exec provides the only guaranteed Python
environment (numpy, pxr, omni.*, carb, etc.). This applies to eval validators,
data generators, inspection scripts, and any new script you write.
references/extensibility.md — Custom format onboarding architecture
Critical Rules
All omni.* imports at top level — never inside functions (UnboundLocalError)
Wait ≥600 frames before first capture; 120+ extra for first capture in session
--no-window for headless; --exec for script execution
Always create a bounding box before frame_prims
Use omni.cae.kit for every native file-format plugin
CGNS: paths under import root directly; dots/spaces → underscores
Import mesh-like NPZ data with schema="CGNS"; no association patch is needed
Velocity as separate scalars → pass all component instance names to fieldNames
stage.GetPrimAtPath() never returns None — use prim.IsValid()
Gf.Vec2f/Gf.Vec3f require Python float, not numpy types
Kit-CAE is Z-up — orbit in X-Y plane, elevate along Z
Viewport evidence is authoritative for visualization work. USD attributes,
transforms, and logs can be correct while runtime-rendered CAE output is
stale, hidden, or unchanged. Capture and inspect frames before declaring success.
CAE viz operators may render through IndeX, Fabric, or USDRT. Time-sampled USD
attributes are not guaranteed to drive rendered output. If playback looks
static, prove a static pose first, then drive current/default values from a
Kit timeline or update callback.
Debug visualizations incrementally: import → static operator visible → color
domain correct → hiding/composition → camera → animation → capture.
Z-Up Coordinate System
Kit-CAE sets upAxis = 'Z'. Camera math must account for this.
Use AddTransformOp() with full matrix — Euler angles break in Z-up.
Camera must be a NEW prim (not /OmniverseKit_Persp).
Axis Alignment Rotation
If geometry's primary axis isn't Z, rotate the import prim:
xformable = UsdGeom.Xformable(stage.GetPrimAtPath("/World/<import_root>"))
xformable.AddRotateYOp().Set(-90.0) # RotY(-90°): world_x=-local_z, world_z=local_x# Recompute orbit center in world space after rotation