Scientific object kinds
| Kind | Creation/import path | Use |
|---|---|---|
VTP | XML import or in-memory polydata | Points, lines, trajectories, triangle/polygon surfaces. |
VTU | XML import or in-memory unstructured | Unstructured cells, including supported tetra/hexa fields. |
VTI | XML import or in-memory image | Structured scalar/vector fields, volume rendering, slices, isosurfaces. |
ISOSURFACE | gx3de_scientific_isosurfaces | Explicit derived surface(s) from a VTI/image scalar. |
In-memory construction
CORE copies points, cell connectivity and numeric arrays. Arrays are identified by stable enumeration index inside one immutable scientific object; names are metadata and may be empty. Associations are point or cell. Components may range from 1 to 16, while the array classifier labels 1-component scalar and 3-component vector arrays specially.
| Descriptor | Key contract |
|---|---|
gx3de_scientific_polydata_spec | Points + polydata cells + arrays. |
gx3de_scientific_image_spec | Inclusive I/J/K extent, origin, spacing, invertible 3×3 direction matrix, arrays and byte budget. |
gx3de_scientific_unstructured_spec | Points + unstructured cells + arrays and byte budget. |
Inspection without VTK leakage
Use gx3de_scientific_info_get, gx3de_scientific_grid_info_get, point/cell queries and array-info/value calls to inspect the immutable dataset numerically. No VTK data object or pointer crosses the ABI.
Presentation roles
gx3de_scientific_field_roles selects scalar, vector and radius arrays; gx3de_scientific_presentation selects colormap/range, sphere glyphs and vector arrows. These choices do not rewrite source arrays. Tube radius in the field-role descriptor is presentation state for line/trajectory objects.
Direct RGB/RGBA in dev-40
gx3de_scientific_color_array_set(object,index) binds a point-associated array with exactly 3 or 4 finite normalized components in [0,1]. The setter validates the entire array atomically: invalid input leaves the previous binding unchanged. Pass -1 to clear.
| Priority | Color source |
|---|---|
| 1 | Bound direct RGB/RGBA array (dev-40). |
| 2 | Enabled scalar coloring using scalar role + colormap/range. |
| 3 | Object style color. |
For alpha, dev-40 composes independent factors: clamp(object opacity × scientific opacity-array value × direct RGBA alpha, 0, 1). Missing factors are 1. RGB has no direct-alpha factor. The display RGBA is derived at render time; source arrays are unchanged.
Sampled density vs particle clouds
| Need | Use | Reason |
|---|---|---|
| Sampled scalar/vector scientific field at points | Scientific polydata + arrays + glyph/point presentation | Preserves array semantics, scalar/direct color, opacity array, scientific picking and ordinary object behavior. |
| Explicit atoms/beads/geometric spheres | gx3de_particle_cloud | Per-particle geometric radius/color with lightweight scene-owned cloud semantics. |
| Continuous density / volumetric scalar | Scientific image/VTI + volume transfer / isosurfaces / slices | Represents a continuous sampled grid rather than isolated geometric particles. |
Glyph and renderer limits in dev-40
The former unexplained 20,000 sphere-glyph ceiling is replaced by a 100,000-instance safety cap, still subject to the effective scene display-triangle budget. Above 20,000 glyphs the VTK sphere source uses lower 8×6 tessellation instead of 12×8. A scene can still return GX3DE_RANGE before 100,000 if its accumulated display geometry exceeds the policy budget.
Isosurfaces and vector sampling
gx3de_scientific_isosurfaces creates explicit derived objects from a named scalar. gx3de_scientific_vector_samples performs deterministic stride sampling from a selected point-vector array; it is intended for predictable glyph presentation/inspection rather than stochastic subsampling.