Expand description
Typed attribute / parameter names — compile-time witnesses for ɴsɪ
NSIParam_t identifiers.
On the C side, ɴsɪ uses a single NSIParam_t struct everywhere. On the
Rust side that single C concept splits into two semantic roles, both of
which boil down to the same underlying type:
Attribute<T>— properties set on a node (govern how the scene looks):P,Pw,fov,transformationmatrix,uknot, …Parameter<T>— optional arguments to a function (govern how the call behaves):streamformat,errorhandler,stoppedcallback, …
Parameter<T> is just a type alias for Attribute<T> — the conceptual
split exists so the constants and docs read more naturally, but the
machinery is identical.
End-users normally don’t write these types out — they just reference the
exported consts through the parameter macros:
nsi::point_slice!(POSITION, &points) // node attribute (was: P)
nsi::string!(STREAM_FORMAT, "nsi") // function parameter to NSIBeginRenderer- or app-specific entries are added in downstream crates without
touching this one — Attribute::new is const:
ⓘ
pub const MY_RENDERER_THING: Attribute<f32> = Attribute::new("custom_thing");Structs§
- Attribute
- Typed name of an ɴsɪ attribute.
Constants§
- BUCKET_
ORDER bucket-order(currentlybucketorder) — bucket traversal pattern ("horizontal","spiral", …).- CALLBACK_
ERROR callback.error(currentlyerrorhandler) — error-handler callback registered throughNSIBegin.- CALLBACK_
STOP callback.stop(currentlystoppedcallback) — callback fired when an interactive render stops.- FIELD_
OF_ VIEW field-of-view(currentlyfov) — perspective camera FOV in degrees.- FILENAME
filename(currentlyshaderfilename) — OSL shader filename.- MATRIX
matrix(currentlytransformationmatrix) — 4×4 row-major matrix (f64).- OVERSAMPLING
oversampling— pixel oversampling rate.- POSITION
position(currentlyP) — Cartesian control points / vertices.- RESOLUTION
resolution— pixel resolution of ascreennode,[width, height].- STREAM_
FILENAME stream.filename(currentlystreamfilename) — output file path whenNSIBeginis invoked in stream-to-file mode.- STREAM_
FORMAT stream.format(currentlystreamformat) — output stream format forNSIBegin("nsi","binarynsi","autonsi").- STREAM_
PATH_ REPLACEMENT stream.path-replacement(currentlystreampathreplace) — substitution pairs applied to paths in the output stream.- TRIM_
CURVES_ CURVE_ COUNT trim-curves.curve-count(currentlytrimcurves.ncurves) — curves per loop.- TRIM_
CURVES_ CV_ COUNT trim-curves.cv-count(currentlytrimcurves.n) — control-point count per trim curve.- TRIM_
CURVES_ KNOT trim-curves.knot— concatenated knots; total length = Σ(n[i] + order[i]).- TRIM_
CURVES_ LOOP_ COUNT trim-curves.loop-count(currentlytrimcurves.nloops) — number of trim loops on a NURBS surface.- TRIM_
CURVES_ MAX trim-curves.max— parametric end per trim curve.- TRIM_
CURVES_ MIN trim-curves.min— parametric start per trim curve.- TRIM_
CURVES_ ORDER trim-curves.order— order per trim curve (degree + 1).- TRIM_
CURVES_ SENSE trim-curves.sense— one per loop.0= keep inside,1= keep outside (hole).- TRIM_
CURVES_ U trim-curves.u— concatenated u control values; length = Σn[i].- TRIM_
CURVES_ V trim-curves.v— concatenated v control values; length = Σn[i].- TRIM_
CURVES_ W trim-curves.w— concatenated weights; length = Σn[i].- U_COUNT
u.count(currentlynu) — control-point count along u.- U_KNOT
u.knot(currentlyuknot) — knot vector along u; length =nu + uorder.- U_ORDER
u.order(currentlyuorder) — order along u (degree + 1, ≥ 2).- V_COUNT
v.count(currentlynv) — control-point count along v.- V_KNOT
v.knot(currentlyvknot) — knot vector along v; length =nv + vorder.- V_ORDER
v.order(currentlyvorder) — order along v (degree + 1, ≥ 2).- WEIGHTED_
POSITION weighted-position(currentlyPw) — rational (weighted homogeneous) control points: xyzw.
Type Aliases§
- Color3
F32 - RGB color with
f32components. - Color4
F32 - RGBA color with
f32components. - Matrix3
F32 - 3×3 matrix with
f32components. - Matrix4
F32 - 4×4 matrix with
f32components. - Matrix4
F64 - 4×4 matrix with
f64components. - Normal3
F32 - 3D normal with
f32components. - Parameter
- Typed name of an ɴsɪ function-parameter — alias of
Attribute<T>. - Point2
F32 - 2D point with
f32components — typically a parametric (u, v) coordinate. - Point3
F32 - 3D point with
f32components — Cartesian position. - Point4
F32 - 4D point with
f32components — rational/weighted homogeneous (xyzw). - Vector2
F32 - 2D vector with
f32components. - Vector3
F32 - 3D vector with
f32components.