GeoNodes: Factor parameter in Spline Parameter module for a Curve Circle seems to give the wrong value. #104796

Closed
opened 2023-02-16 00:24:01 +01:00 by Konrad-Trawinski · 4 comments

System Information
Operating system: Windows-10-10.0.19045-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 3080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 527.37

Blender Version
Broken: version: 3.4.1, branch: blender-v3.4-release, commit date: 2022-12-19 17:00, hash: rB55485cb379f7
Worked: (newest version of Blender that worked as expected)

Short description of error
In GeoNodes there seems to be an off-by-one error in how the Factor parameter is obtained from a Curve Circle.

I try to modulate a curve circle in a radial way by a sine wave.
I drive the sine by the Factor output of a Spline Parameter module.
I scale the factor so i can get multiples of the sine along the circle.
Problem: The sine doesn't connect with itself at the end of the circle.
What is left is a little segment that is identical to the unmodulated circle.
This segment turns out to be 1/(circle resolution) in length.

Sooo, i can BUSH FIX this by first subtracting 1.0/(circle res) from 1.0 and then multiply this with the Factor parameter. Hooray! :)
This way the sine connects again at the end and i can freely change the circle resolution or sine frequency without this breaking.

Exact steps for others to reproduce the error

-Add a GeoNodes on an object.

-Add a Curve Circle. Use for instance 512 as resolution.

-Connect the circle to a Set Position node and connect that to the output.

-Add a Vector Multiply node and connect a Position node to the top input.

-Connect the output of the Vector multiply node to the Position input of the Set position node.

-Add a Combine XYZ node and connect the output to the bottom input of the Vector Multiply node.

-Add a Sine node. Multiply the output by 0.2 .

-Add 1.0 to the output of this multiply.

-Connect this to the X and Y inputs of the Combine XYZ node.

-Add a Multiply node and connect the output to the Sine node input.

-Add another Multiply node and connect to the bottom of the previous Multiply node. Set one of the numbers to pi * 2 and the other to 20 (for test purpose).

-Add a Spline Parameter node and connect the Factor output to the top input of the Multiply node that is connected to the Sine node.

-You should now have a wavy circle.

-Notice that at one end of the circle (+X direction if Curve Circle is set to 'Radius') the sine wave does not connect to itself.

To fix the problem:
-Put a new Multiply node between the Spline Parameter node and Multiply node.

-Add a Input->Integer node and set it to 512.

-Connect the Integer node to the Curve Circle node Resolution input.

-Add a Divide node that goes into the bottom input of a Subtract node.

-Set the top number in the Divide node to 1.0 .

-Set the top number of the Subtract node to 1.0 .

-Connect the output of the Subtract node to the bottom input of the Multiply node immediately following the Spline Parameter node.

-Connect the Integer node to the bottom input of the Divide node.

Have fun!!

**System Information** Operating system: Windows-10-10.0.19045-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 3080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 527.37 **Blender Version** Broken: version: 3.4.1, branch: blender-v3.4-release, commit date: 2022-12-19 17:00, hash: `rB55485cb379f7` Worked: (newest version of Blender that worked as expected) **Short description of error** In GeoNodes there seems to be an off-by-one error in how the Factor parameter is obtained from a Curve Circle. I try to modulate a curve circle in a radial way by a sine wave. I drive the sine by the Factor output of a Spline Parameter module. I scale the factor so i can get multiples of the sine along the circle. Problem: The sine doesn't connect with itself at the end of the circle. What is left is a little segment that is identical to the unmodulated circle. This segment turns out to be 1/(circle resolution) in length. Sooo, i can BUSH FIX this by first subtracting 1.0/(circle res) from 1.0 and then multiply this with the Factor parameter. Hooray! :) This way the sine connects again at the end and i can freely change the circle resolution or sine frequency without this breaking. **Exact steps for others to reproduce the error** -Add a GeoNodes on an object. -Add a Curve Circle. Use for instance 512 as resolution. -Connect the circle to a Set Position node and connect that to the output. -Add a Vector Multiply node and connect a Position node to the top input. -Connect the output of the Vector multiply node to the Position input of the Set position node. -Add a Combine XYZ node and connect the output to the bottom input of the Vector Multiply node. -Add a Sine node. Multiply the output by 0.2 . -Add 1.0 to the output of this multiply. -Connect this to the X and Y inputs of the Combine XYZ node. -Add a Multiply node and connect the output to the Sine node input. -Add another Multiply node and connect to the bottom of the previous Multiply node. Set one of the numbers to pi * 2 and the other to 20 (for test purpose). -Add a Spline Parameter node and connect the Factor output to the top input of the Multiply node that is connected to the Sine node. -You should now have a wavy circle. -Notice that at one end of the circle (+X direction if Curve Circle is set to 'Radius') the sine wave does not connect to itself. To fix the problem: -Put a new Multiply node between the Spline Parameter node and Multiply node. -Add a Input->Integer node and set it to 512. -Connect the Integer node to the Curve Circle node Resolution input. -Add a Divide node that goes into the bottom input of a Subtract node. -Set the top number in the Divide node to 1.0 . -Set the top number of the Subtract node to 1.0 . -Connect the output of the Subtract node to the bottom input of the Multiply node immediately following the Spline Parameter node. -Connect the Integer node to the bottom input of the Divide node. Have fun!!
Konrad-Trawinski added the
Severity
Normal
Status
Needs Triage
Type
Report
labels 2023-02-16 00:24:02 +01:00

Not sure this is incorrect, @HooglyBoogly can you check?

Not sure this is incorrect, @HooglyBoogly can you check?

Just for the record, the Factor parameter does really seem to be scaled wrongly (in sofar as this is not an intended result). So it is not the case that for some reason a part of the sine wave is blanked out and the phase of the sine is still ok.
The actual phase of the sine doesn't match with the curve if you use the Factor to drive it.
Also, to take away the possibility of numerical resolution errors i used a higher accuracy PI constant than the one provided by the PI constant in blender.

To see what i mean you can make a copy of the object i described and then rotate it 180 degrees on the z axis. Make sure that in both objects the number describing how many cycles the sine will produce (20 in my description) is an even number so that the curve will overlap if all goes well.

In the unfixed version you will see the sine doesn't give symmetrical results.

With the fix (by scaling the Factor) everything lines up correctly.

Just for the record, the Factor parameter does really seem to be *scaled* wrongly (in sofar as this is not an intended result). So it is not the case that for some reason a part of the sine wave is *blanked out* and the phase of the sine is still ok. The actual phase of the sine doesn't match with the curve if you use the Factor to drive it. Also, to take away the possibility of numerical resolution errors i used a higher accuracy PI constant than the one provided by the PI constant in blender. To see what i mean you can make a copy of the object i described and then rotate it 180 degrees on the z axis. Make sure that in both objects the number describing how many cycles the sine will produce (20 in my description) is an even number so that the curve will overlap if all goes well. In the unfixed version you will see the sine doesn't give symmetrical results. With the fix (by scaling the Factor) everything lines up correctly.

Hello. The curve factor is a value between 0 and 1. To get a looped match, 0 and 1 must be at the same point. But since this is not the case, there is a gap.
Make a factor by dividing the index of the point by the number of points, then the factor will correspond to this task.
This is not a bug.

Hello. The curve factor is a value between 0 and 1. To get a looped match, 0 and 1 must be at the same point. But since this is not the case, there is a gap. Make a factor by dividing the index of the point by the number of points, then the factor will correspond to this task. This is not a bug.
Blender Bot added
Status
Archived
and removed
Status
Needs Triage
labels 2023-02-16 14:52:35 +01:00

@mod_modder Aah, so if i understand correctly, the Factor parameter doesn't take into account the last segment in closed curves. That was something that wasn't obvious to me.

Anyway, your solution is cheaper than mine, so thanks :)

And sorry to take up your (talking to all of the people involved in dev) valuable time on this marvelous project!!!

@mod_modder Aah, so if i understand correctly, the Factor parameter doesn't take into account the last segment in closed curves. That was something that wasn't obvious to me. Anyway, your solution is cheaper than mine, so thanks :) And sorry to take up your (talking to all of the people involved in dev) valuable time on this marvelous project!!!
Sign in to join this conversation.
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
3 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#104796
No description provided.