Skip to content

Add zero-allocation scalar surface evaluator (nurbs_eval_derivs) - #15

Open
mdmaas wants to merge 1 commit into
HoBeZwe:mainfrom
EpsilonForge:main
Open

Add zero-allocation scalar surface evaluator (nurbs_eval_derivs)#15
mdmaas wants to merge 1 commit into
HoBeZwe:mainfrom
EpsilonForge:main

Conversation

@mdmaas

@mdmaas mdmaas commented Mar 27, 2026

Copy link
Copy Markdown

Adds nurbs_eval_derivs(patch, s, t) which evaluates a NURBS surface and its first partial derivatives at a single scalar point, returning (pos, dpds, dpdt) as three SVector{3}.

The existing API requires wrapping scalars in Vector wrappers and returns nested heap-allocated arrays, making it unsuitable for hot loops. The new path uses MMatrix/MVector scratch buffers sized by Val{degree} type parameters so all intermediates live on the stack — zero heap allocations, fully thread-safe.

Also fixes a minor allocation in derBasisFun!: the slice assignment dersv[jj, :, :] = ders is replaced with an explicit loop to avoid the temporary.

@weymouth

Copy link
Copy Markdown

Thanks! I think this closes #13. @HoBeZwe, is there a way to merge this? Anything not working?

@HoBeZwe

HoBeZwe commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Hi, and sorry for the late reply. I should have time to look at it soon.

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.

3 participants