Support custom NURBS knot vectors #99891
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#99891
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Knot vectors describe which control points influence sections of the evaluated points for NURBS curves. The initial implementation of the new curves type doesn't support custom knot vectors because they are often computed automatically anyway, and it wasn't obvious how to store them efficiently.
A new
knots_mode
type should be added,NURBS_KNOT_MODE_CUSTOM
, which could use knot values imported from other software, manually edited by the user, or adjusted by operations. Ideally the knot vectors would be stored as an optional builtin attribute. However, since more knot values are needed than the number of points, it isn't clear exactly how to store it.Changed status from 'Needs Triage' to: 'Confirmed'
Added subscriber: @HooglyBoogly
NURBS knot vector storage in the Point domain proposal.
To explain it is easiest to start from clamped (Endpoint) non cyclic case.
Order 4 curve with n control points has knot structure is
[ k0 = 0, k1 = 0, k2 = 0, k3 = 0, k4, k5, ..., kn, kn, kn, kn]
with length(n + order)
.Step 1.
Last 3 knots can easily be dropped without loss of information.
This leaves us with
[ k0 = 0, k1 = 0, k2 = 0, k3 = 0, k4, k5, ..., kn]
(n + 1)
values.Step 2.
Store not knot values, but distances between adjacent knots.
[k1 - k0 = 0, k2 - k1 = 0, k3 - k2 = 0, k4 - k3, ..., kn - kn_1]
.We get n values with a cost of loosing
k0
.k0
is unimportant as basis functions use only distances between knot values.So it can always to be
0
.And this is what was needed knot vector expressed as
n
values.Cyclic case.
It isn't affected by this transformation as it's knot vector tail is already calculated from the head.
[ k0, k1, k2, k3, k4, k5, ..., kn + (k0 - k0), kn + (k1 - k0), kn + (k2 - k0), kn + (k3 - k0)]
This actualy covers and clamped case examined above, leading to same code for clamped and cyclic.
[ k0 = 0, k1 = 0, k2 = 0, k3 = 0, k4, k5, ..., kn + (k0 - k0), kn + (k1 - k0), kn + (k2 - k0), kn + (k3 - k0)]
equals
[ 0, 0, 0, 0, k4, k5, ..., kn, kn, kn, kn]
.Bezier cases.
It is solved by the same formula from above as distances in the tail matches distances in the head.
https://archive.blender.org/developer/file/12814/12814512/nurbs_knots.png
Non clamped (Non Endpoint) case.
This is trickier. Blender's non clamped curves have evenly spaced knots and same formula from above applies.
For the future tools modifying knots I see only ones affecting knot values in the interval
[k3, .., kn]
(order is 4 here) as only into it geometry of a curve can be mapped.I would expect other packages also to have uniformly spaced both endings of the knot vector.
If some doesn't their knots can be clamped on import without curve geometry changes.
Though control points would change and re importing back would give same curve geometry with changed control points and changed knots.