Skip to content

Conversation

@virtualritz
Copy link
Contributor

@virtualritz virtualritz commented Nov 27, 2025

The valid parameter domain for a B-spline is [knot[degree], knot[n_cv]], not [knot[0], knot[n-1]].

For example, a uniform cubic B-spline with 4 control points has knot vector [0,1,2,3,4,5,6,7]. The existing code returned [0,7] but the correct valid domain is [3,4] - only the center 1/9th of the parameter space.

Discovered because: this caused tessellation to generate geometry in the "phantom" outer regions, leading to overlapping patches when rendering STEP files with uniform B-spline surfaces.

See two images below, this is a STEP viewer I'm working on that uses truck for reading/tessellation.

Screenshot From 2025-11-27 18-44-54 Before domain fix (tessellated patches overlap, see regions with z-buffer fighting). Screenshot From 2025-11-27 13-47-13 After domain fix.

The valid parameter domain for a B-spline is [knot[degree], knot[n_cv]], not [knot[0], knot[n-1]].

For example, a uniform cubic B-spline with 4 control points has knot vector [0,1,2,3,4,5,6,7]. The old code returned [0,7] but the correct valid domain is [3,4] - only the center 1/9th of the parameter space.

Discovered because: this caused tessellation to generate geometry in the "phantom" outer regions, leading to overlapping patches when rendering STEP files with uniform B-spline surfaces.
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