Maniphest T100310

Unexpected behaviour with Curve to Mesh geometry node's profile curve orientation
Closed, Resolved

Assigned To
Iliya Katueshenock (Moder)
Authored By
Tomás Cejas (TomasCJ)
Aug 10 2022, 3:50 AM
Tags
  • BF Blender
  • Geometry Nodes
Subscribers
Iliya Katueshenock (Moder)
Tomás Cejas (TomasCJ)

Description

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: NVIDIA GeForce GTX 1050/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 516.40

Blender Version
Broken: version: 3.2.0, branch: master, commit date: 2022-06-08 10:22, hash: rBe05e1e369187.
Also tested in version 3.0.0 with the same results.

Worked: unknown

Short description of error

The orientation of the profile curve used in the Curve to Mesh node changes abruptly, non smoothly, between very slightly different positions or orientations of the input curve. This happens in a way that is not easily predictable or fixable.

Exact steps for others to reproduce the error

An example is given with the following scenario:


A curve line is slightly rotated (in this case by the Y axis, but also works for others), and then converted to mesh with a triangular profile curve. The triangular shape makes the sudden orientation change more evident, which happens when changing rotation values near (but not exactly) zero. The rotation value for which this "flip" occurs seems to change with the profile curve used (for example, a 5-sided circle). The "flip" is sometimes between more than 2 different orientations, as shown below.

The value at which this flip happens is unpredictable, enormously difficulting the use of this node for certain scenarios where a smooth transition is required. If the flip is an unavoidable feature, it should at least happen in a predictable way. But the best behaviour would be, in my opinion, that it didn't change abruptly at all, as there's no apparent reason for this to happen in cases like these.

Probably related to T80979 ?

Event Timeline

Tomás Cejas (TomasCJ) created this task.Aug 10 2022, 3:50 AM
Tomás Cejas (TomasCJ) added a project: Geometry Nodes.
Iliya Katueshenock (Moder) closed this task as Resolved.EditedAug 10 2022, 4:05 AM
Iliya Katueshenock (Moder) claimed this task.
Iliya Katueshenock (Moder) added a subscriber: Iliya Katueshenock (Moder).

This is not a bug, but a limitation of mathematics.
For correct rotation you need 3 branches of space. 1 - tangent, it is always there. But the calculation of the normal depends on the angle and can essentially be called random. Of course, this is not noise, but you can see the dependence on the angle. If 0 - then just one axis. If there is a slope, then the axis is in the direction of the slope. This hasn't been fixed yet, as it would need to have a normal that you could capture and rotate as a position.

Tomás Cejas (TomasCJ) added a comment.Aug 10 2022, 6:37 PM

Does this also explain why there are more than 2 "flips" (show in the picture), and they are not exactly at zero? I would've expected a limitation like this one to make it flip between 2 very different rotations at exactly zero rotation (or some other predictable value), but not 3 at seemingly arbitrary values like here.

In any case, thank you for the explanation

Iliya Katueshenock (Moder) added a comment.Aug 10 2022, 6:43 PM

Your data is sooo close to 0 and the rounding is doing its job. There is no way to complicate the algorithm so that it would be without abrupt switches, since in any case this is a calculation for a random branch in a random direction to the left to the limit