GeometryNodes: CurveToMesh assumes radius=1, read radius assumes radius=0 if non-existing #116577

Open
opened 2023-12-27 11:52:00 +01:00 by D0ppelgaenger · 4 comments

System Information
Operating system: Windows-10-10.0.22621-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 2060/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 535.98

Blender Version
Broken: version: 4.1.0 Alpha, branch: main, commit date: 2023-12-25 19:48, hash: 140f5f619dcf
Worked: -

Short description of error
If the curve used in a curve to mesh does not have a radius attribute, it assumes a radius of 1m.
If you however try to view/use the radius attribute via the read radius, it assumes a radius of 0m.

I understand that it makes sense from a usability standpoint, that Curve to Mesh assumes a radius of 1. That way, you aren't forced to assign a radius to a curve every time, just to be able to use curve to mesh "correctly".
I also understand that a non-existing attribute by default reads 0.
Yet, I think that it is incorrect for both values to not be the same.
In my usecase I capture the radius attribute before converting it to a mesh and want to use that information later on the mesh.
However, the radius I captured is not the same one, that is actually used in the curve to mesh operation, which makes my calculations incorrect (if radius not implicitly assigned used set curve radius).

Exact steps for others to reproduce the error

  1. Add GeometryNodesModifier to default cube.
  2. Create new NodeTree.
  3. Add a "CurvePrimitve - Arc" (or other primitive).
  4. Add a "Curve to Mesh" with a "CurveCircle" as profile.
  5. Connect the viewer to the Arc and a "Geomety - Read - Radius" and connect and view the attribute on the curve's controlpoints.
  6. The read attribute is 0, however ctm assumes a value of 1.
**System Information** Operating system: Windows-10-10.0.22621-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 2060/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 535.98 **Blender Version** Broken: version: 4.1.0 Alpha, branch: main, commit date: 2023-12-25 19:48, hash: `140f5f619dcf` Worked: - **Short description of error** If the curve used in a curve to mesh does not have a radius attribute, it assumes a radius of 1m. If you however try to view/use the radius attribute via the read radius, it assumes a radius of 0m. I understand that it makes sense from a usability standpoint, that Curve to Mesh assumes a radius of 1. That way, you aren't forced to assign a radius to a curve every time, just to be able to use curve to mesh "correctly". I also understand that a non-existing attribute by default reads 0. Yet, I think that it is incorrect for both values to not be the same. In my usecase I capture the radius attribute before converting it to a mesh and want to use that information later on the mesh. However, the radius I captured is not the same one, that is actually used in the curve to mesh operation, which makes my calculations incorrect (if radius not implicitly assigned used set curve radius). **Exact steps for others to reproduce the error** 1. Add GeometryNodesModifier to default cube. 2. Create new NodeTree. 3. Add a "CurvePrimitve - Arc" (or other primitive). 4. Add a "Curve to Mesh" with a "CurveCircle" as profile. 5. Connect the viewer to the Arc and a "Geomety - Read - Radius" and connect and view the attribute on the curve's controlpoints. 6. The read attribute is 0, however ctm assumes a value of 1.
D0ppelgaenger added the
Priority
Normal
Type
Report
Status
Needs Triage
labels 2023-12-27 11:52:01 +01:00
D0ppelgaenger changed title from GeometryNodes: CurveToMesh assumes radius=1, read radius assumes radius=0 to GeometryNodes: CurveToMesh assumes radius=1, read radius assumes radius=0 if non-existing 2023-12-27 11:54:09 +01:00
Iliya Katushenock added the
Interest
Geometry Nodes
Interest
Nodes & Physics
labels 2023-12-27 13:26:35 +01:00

Thanks for report, this looks wrong, i agree. Main issue now is in the fact that to fix this we have to break all geometry nodes setups.

Thanks for report, this looks wrong, i agree. Main issue now is in the fact that to fix this we have to break all geometry nodes setups.
Author

Yes. That is unfortunately true if the fix would be that the ctm (curve to mesh) would just assume a radius of 0.
But I don't think that setting a default radius of 1 on every newly created curve, whether primitive or created via different method, would break existing setups.
Since the value of 1 is assumed in the ctm (think that is the only node that uses the radius attribute) and every other usecase (I can imagine) one would assign their own radius value anyway, which would overwrite the default.

My current workaround is to not use the Geometry - Read - Radius, but to read the radius from a named attribute node and using the "exists" boolean to switch between 1 if it does not exist and the radius value, if it exists.
image

Yes. That is unfortunately true if the fix would be that the ctm (curve to mesh) would just assume a radius of 0. But I don't think that setting a default radius of 1 on every newly created curve, whether primitive or created via different method, would break existing setups. Since the value of 1 is assumed in the ctm (think that is the only node that uses the radius attribute) and every other usecase (I can imagine) one would assign their own radius value anyway, which would overwrite the default. My current workaround is to not use the **Geometry - Read - Radius**, but to read the radius from a **named attribute** node and using the "exists" boolean to switch between 1 if it does not exist and the radius value, if it exists. ![image](/attachments/4fe65ff3-f63f-4c2d-b359-ace5364aa440)
Member

But I don't think that setting a default radius of 1 on every newly created curve, whether primitive or created via different method, would break existing setups.

To me it seems quite likely that any change in that low level area will cause breakages. It's not entirely obvious what radius should be used by default. For points we also use other radii by default sometimes.

The best way forward here may be to just make the fallback value configurable. That would remove any ambiguity which is nice.

> But I don't think that setting a default radius of 1 on every newly created curve, whether primitive or created via different method, would break existing setups. To me it seems quite likely that any change in that low level area will cause breakages. It's not entirely obvious what radius should be used by default. For points we also use other radii by default sometimes. The best way forward here may be to just make the fallback value configurable. That would remove any ambiguity which is nice.
Member

The default we've settled on for newly created curves is 0.01. I still hope we can transition to using that everywhere without breaking existing setups. The hardest part is probably reading a nonexistent radius attribute with the named attribute node though.

The default we've settled on for newly created curves is 0.01. I still hope we can transition to using that everywhere without breaking existing setups. The hardest part is probably reading a nonexistent radius attribute with the named attribute node though.
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#116577
No description provided.