Normals generated by Curve to Points node aren't always perpendicular to the curve #94522

Open
opened 2021-12-31 00:29:48 +01:00 by slowburn · 10 comments

System Information
Operating system: Windows-10-10.0.19043-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 3060 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 497.09

Blender Version
Broken: version: 3.1.0 Alpha, branch: master, commit date: 2021-12-26 20:08, hash: 20b438d523

Short description of error
For curves with sharp corners, like poly splines or bezier splines with vector handles, the normals are not perpendicular to the straight curve segments, but bend around corners. This makes it impossible to properly align instances to the curve.

instance_rotate.jpg

Exact steps for others to reproduce the error

  • Create curve with sharp corners
  • Add Geometry nodes modifier and use Curve to Points node to generate points
  • Use either Normal or Rotation output to drive the rotation of instances, like in the example
**System Information** Operating system: Windows-10-10.0.19043-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 3060 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 497.09 **Blender Version** Broken: version: 3.1.0 Alpha, branch: master, commit date: 2021-12-26 20:08, hash: `20b438d523` **Short description of error** For curves with sharp corners, like poly splines or bezier splines with vector handles, the normals are not perpendicular to the straight curve segments, but bend around corners. This makes it impossible to properly align instances to the curve. ![instance_rotate.jpg](https://archive.blender.org/developer/F12782541/instance_rotate.jpg) **Exact steps for others to reproduce the error** - Create curve with sharp corners - Add Geometry nodes modifier and use Curve to Points node to generate points - Use either Normal or Rotation output to drive the rotation of instances, like in the example
Author

Added subscriber: @slowburn

Added subscriber: @slowburn
Member

Added subscriber: @PratikPB2123

Added subscriber: @PratikPB2123
Member

Added subscriber: @JacquesLucke

Added subscriber: @JacquesLucke
Member

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'
Member

Please provide the .blend file to make it easier for us to reproduce the problem.
What's probably happening here is that the normal is interpolated between the control points. To work around this you could resample the curve to a poly spline that does not have intermediate points.

Please provide the .blend file to make it easier for us to reproduce the problem. What's probably happening here is that the normal is interpolated between the control points. To work around this you could resample the curve to a poly spline that does not have intermediate points.
Author

Here's the file. As you can see it happens with Poly splines as well.
And you're right, there's some interpolation going on, I'm just not sure if it's intentional. According to the manual, Curve to Points node should return a proper normal at each generated point instead of some interpolated value from the control points. Or at least there should be a way to control when this interpolation happens.
curve_normals.blend

One workaround I found is to scale the control handles to 0, but it doesn't eliminate the problem completely. And it would be nice to have a proper fix anyway.

2022-01-10_20-13-37.mp4

Here's the file. As you can see it happens with Poly splines as well. And you're right, there's some interpolation going on, I'm just not sure if it's intentional. According to the manual, Curve to Points node should return a proper normal at each generated point instead of some interpolated value from the control points. Or at least there should be a way to control when this interpolation happens. [curve_normals.blend](https://archive.blender.org/developer/F12799341/curve_normals.blend) One workaround I found is to scale the control handles to 0, but it doesn't eliminate the problem completely. And it would be nice to have a proper fix anyway. [2022-01-10_20-13-37.mp4](https://archive.blender.org/developer/F12799516/2022-01-10_20-13-37.mp4)
Member

Added subscriber: @HooglyBoogly

Added subscriber: @HooglyBoogly
Member

I guess a fix is to make a different version of of the interpolation of attributes to evaluated points, but I think there are multiple use cases here.

  1. Few control points, large angles, and vector handles: interpolation is unwanted, since it makes a sharp curve smooth.
  2. Smooth curve with many control points and no purposeful hard angles: interpolation might be desired, since the goal is to look smooth anyway.

Or maybe it would make sense to require having a higher resolution curve for the second case, and always avoid interpolation.

To change this, I think the sample curve node and the curve to points node would have to be refactored. We might also have to redefine the tangents as the direction vector from one evaluated point to the next (which might make sense anyway, since we decided that a point attribute value conceptually applies to the following edge).

I guess a fix is to make a different version of of the interpolation of attributes to evaluated points, but I think there are multiple use cases here. 1. Few control points, large angles, and vector handles: interpolation is unwanted, since it makes a sharp curve smooth. 2. Smooth curve with many control points and no purposeful hard angles: interpolation might be desired, since the goal is to look smooth anyway. Or maybe it would make sense to require having a higher resolution curve for the second case, and always avoid interpolation. To change this, I think the sample curve node and the curve to points node would have to be refactored. We might also have to redefine the tangents as the direction vector from one evaluated point to the next (which might make sense anyway, since we decided that a point attribute value conceptually applies to the following edge).
Member

Changed status from 'Needs User Info' to: 'Confirmed'

Changed status from 'Needs User Info' to: 'Confirmed'
Member

Since the solution isn't obvious and would have to be discussed, I think this is more of a design task.

Since the solution isn't obvious and would have to be discussed, I think this is more of a design task.
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
4 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#94522
No description provided.