Skip to content

Fix nurbs example: drop .array_len() on flat slices, add umin/umax/vm…#29

Merged
virtualritz merged 1 commit into
masterfrom
fix/nurbs-example-array-len
May 9, 2026
Merged

Fix nurbs example: drop .array_len() on flat slices, add umin/umax/vm…#29
virtualritz merged 1 commit into
masterfrom
fix/nurbs-example-array-len

Conversation

@virtualritz
Copy link
Copy Markdown
Owner

…in/vmax

The renderer rejected uknot, vknot, and every trimcurves.* array attribute with E6007 (wrong type), then E6020 (required attributes missing) because the rejected ones look absent. Cause: the example called .array_len(N) on these, which encodes the value as a single fixed-size N-tuple (type[N], count=1, arraylength=N). NSI expects flat slices for them: count=N, arraylength=0, i.e. plain f32_slice! / i32_slice! without .array_len().

Use .array_len(N) only for parameters whose type is a fixed-size N-tuple (e.g. screen.resolution = int[2]).

Also add umin/umax/vmin/vmax (default 0..1) to mirror RiNuPatch's explicit surface domain.

…in/vmax

The renderer rejected `uknot`, `vknot`, and every `trimcurves.*` array
attribute with E6007 (wrong type), then E6020 (required attributes
missing) because the rejected ones look absent. Cause: the example
called `.array_len(N)` on these, which encodes the value as a single
fixed-size N-tuple (`type[N]`, count=1, arraylength=N). NSI expects
flat slices for them: `count=N, arraylength=0`, i.e. plain
`f32_slice!` / `i32_slice!` without `.array_len()`.

Use `.array_len(N)` only for parameters whose type is a fixed-size
N-tuple (e.g. `screen.resolution = int[2]`).

Also add `umin`/`umax`/`vmin`/`vmax` (default 0..1) to mirror
`RiNuPatch`'s explicit surface domain.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@virtualritz virtualritz merged commit 6d84470 into master May 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant