Geometry Node: New Sample Curve #100121

Open
opened 2022-08-01 15:46:51 +02:00 by Iliya Katushenock · 1 comment

Adding support for a random attribute to the sampling node exposed the problem of attribute evaluation ignoring the calculated curve. This design variant is intended to treat the sampling of values from calculated curves as a new attribute-based сontext.

2022-08-01 14-00-56 (video-converter.com).mp4 image.png image.png image.png
The crux of the problem is that a random attribute, when sampled, must be able to have a position behavior. Other behaviors are not covered yet, but may be added later.
Sampling attributes do not belong to the curve and have their own size. Their interpolation may not be linear, but based on the type of curve, which increases the speed for large objects.

Example: sampling a random vector from curve points. You want the vector to keep its length. But even the original implementation of normals kept the length just because of the normalization. Nonlinear interpolation in spline space for a vector has the ability to rotate it without loss of length and incorrect deformations.

Or you want to sample a color. You can set the color for the breakpoints and... Whoa, those are just linear transitions! Handles cannot be used. They are not a domain and this design does not violate that. Simply by sampling an attribute, you can sample it not only from breakpoints, but from handles!

Also, in addition to entering an attribute as the domain of the sampled curve, a segment data node is offered. This low-level node is for primary access to cache data. The sampled attribute input node uses this as its signature. But it can also be useful for the user to be able to use this data, for example, to visualize the operation of a bezier curve.

When sampling, 3 types of values must be present in the scope of the context:

  • Curve data obtained from the visible version of the curve
  • Curve data sampled from its points and handles
  • Sampling destination data. To keep things simple, if multiple post-sampling values are going to be used with geometry definitions, it's best to do this before the sampling node to keep the output of the node to a minimum.

Also sampling features:

  1. The option of sampling a vector in normal/target space + sample position can be used as a variant of the curve mesh deformation
  2. Sampling at an arbitrary point creates freedom to obtain information about the curvature of the surface.

Curve Input:

  • Spline type (Select current type curves / index of type)
  • Select Spline By Type (By type index)

Changed Nodes:

  • Sample Curve
    • Input:
      • Curve
      • Factor / Length
      • Curve (Index)
      • Attribute (Random type) (use SampleCurveContext)
    • Output:
      • Value (Random type)

  • Position:

    • In SampleCurveContext return evaluated_positions
  • Normal:

    • Same Position
  • Curve Tangent:

    • Move TangentFieldInput to Fields Input and add it in SampleCurveContext same position
  • Index:

    • Same position. Index in sampling input index of current curve
  • ID:

    • Same Index. ID is index of current sample. Sampling no has order ad id make sence only for random and same things
  • Spline Length, Parameter, Resolution, Cyclic:

    • Data of spline same changed. Data of point internolated by sampling
  • Context Add:

    • Sample Signature Input:
      • Curve Index
      • Curve Type
      • First Point
      • First Factor

Add Nodes (Valid only in SampleCurveContext):

  • Sample Attribute on Curve:
    • Input:
      • Attribute (Random type)
      • Hadles type ? left/right position : Weight
    • Output:
      • Value (Random type)
  • Sampling Attribute:'
    • Input:
      • Attribute (Random type)
    • Output:
      • Value (Random type)
  • Sample Segment:
    • Output:
      • Previous Point of original curve
      • Factor for interpolatin in current segment

First test version: https://developer.blender.org/P3114

Adding support for a random attribute to the sampling node exposed the problem of attribute evaluation ignoring the calculated curve. This design variant is intended to treat the sampling of values from calculated curves as a new attribute-based сontext. | [2022-08-01 14-00-56 (video-converter.com).mp4](https://archive.blender.org/developer/F13329459/2022-08-01_14-00-56__video-converter.com_.mp4) | ![image.png](https://archive.blender.org/developer/F13329406/image.png) ![image.png](https://archive.blender.org/developer/F13329445/image.png) ![image.png](https://archive.blender.org/developer/F13329439/image.png) | | -- | -- | The crux of the problem is that a random attribute, when sampled, must be able to have a position behavior. Other behaviors are not covered yet, but may be added later. Sampling attributes do not belong to the curve and have their own size. Their interpolation may not be linear, but based on the type of curve, which increases the speed for large objects. Example: sampling a random vector from curve points. You want the vector to keep its length. But even the original implementation of normals kept the length just because of the normalization. Nonlinear interpolation in spline space for a vector has the ability to rotate it without loss of length and incorrect deformations. Or you want to sample a color. You can set the color for the breakpoints and... Whoa, those are just linear transitions! Handles cannot be used. They are not a domain and this design does not violate that. Simply by sampling an attribute, you can sample it not only from breakpoints, but from handles! Also, in addition to entering an attribute as the domain of the sampled curve, a segment data node is offered. This low-level node is for primary access to cache data. The sampled attribute input node uses this as its signature. But it can also be useful for the user to be able to use this data, for example, to visualize the operation of a bezier curve. When sampling, 3 types of values must be present in the scope of the context: - Curve data obtained from the visible version of the curve - Curve data sampled from its points and handles - Sampling destination data. To keep things simple, if multiple post-sampling values are going to be used with geometry definitions, it's best to do this before the sampling node to keep the output of the node to a minimum. Also sampling features: 1. The option of sampling a vector in normal/target space + sample position can be used as a variant of the curve mesh deformation 2. Sampling at an arbitrary point creates freedom to obtain information about the curvature of the surface. --- Curve Input: - Spline type (Select current type curves / index of type) - Select Spline By Type (By type index) --- Changed Nodes: - Sample Curve - Input: - Curve - Factor / Length - Curve (Index) - Attribute (Random type) (use SampleCurveContext) - Output: - Value (Random type) ``` ``` - Position: - In SampleCurveContext return evaluated_positions - Normal: - Same Position - Curve Tangent: - Move TangentFieldInput to Fields Input and add it in SampleCurveContext same position - Index: - Same position. Index in sampling input index of current curve - ID: - Same Index. ID is index of current sample. Sampling no has order ad id make sence only for random and same things - Spline Length, Parameter, Resolution, Cyclic: - Data of spline same changed. Data of point internolated by sampling - Context Add: - Sample Signature Input: - Curve Index - Curve Type - First Point - First Factor --- Add Nodes (Valid only in SampleCurveContext): - Sample Attribute on Curve: - Input: - Attribute (Random type) - Hadles type ? left/right position : Weight - Output: - Value (Random type) - Sampling Attribute:' - Input: - Attribute (Random type) - Output: - Value (Random type) - Sample Segment: - Output: - Previous Point of original curve - Factor for interpolatin in current segment First test version: https://developer.blender.org/P3114
Author
Member

Added subscriber: @mod_moder

Added subscriber: @mod_moder
Philipp Oeser removed the
Interest
Nodes & Physics
label 2023-02-10 08:43:49 +01:00
Iliya Katushenock removed the
Status
Needs Triage
label 2023-08-24 17:30:39 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
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
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
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
EEVEE & Viewport
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
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
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
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#100121
No description provided.