Repository navigation
New node: 'Mesh Gradient Value' - #4081
YohYamasaki wants to merge 16 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new "Mesh" gradient type, adding UI support in the gradient tool and implementing an initial SVG rendering path that approximates the mesh by subdividing it into an 8x8 grid of polygons. Feedback identifies critical bugs in the rendering logic, including potential panics if the geometry has fewer than four points or segments and an incorrect return statement that prevents subsequent elements from rendering. Additionally, the reviewer noted that the mesh colors are currently hardcoded and that the Vello and SVG stops table implementations are still placeholders.
4b7a823 to
847b8e9
Compare
15fcaac to
d5f0140
Compare
5785002 to
231773c
Compare
6575890 to
f097784
Compare
e5de2e0 to
ededf6c
Compare
55d7bda to
4ef8f6f
Compare
|
@cubic-dev-ai Please review |
@YohYamasaki I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 36 files
Tip: cubic used a learning from your PR history. Let your coding agent read cubic learnings directly with the cubic MCP.
Re-trigger cubic
|
@cubic-dev-ai Please review |
@YohYamasaki I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 36 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 36 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 2 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
1 issue found across 2 files (changes from recent commits).
Confidence score: 3/5
- In
node-graph/libraries/rendering/src/renderer/mesh_gradient.rs, the guard accepts a singularparent_transform * mesh_transformwhen both columns are nonzero, allowing a collapsed output transform to reach displacement-map construction and potentially produce incorrect rendering; check the smallest singular value before proceeding.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="node-graph/libraries/rendering/src/renderer/mesh_gradient.rs">
<violation number="1" location="node-graph/libraries/rendering/src/renderer/mesh_gradient.rs:1025">
P2: When `parent_transform * mesh_transform` is singular but both columns are nonzero, this guard accepts a collapsed output transform and proceeds to build the displacement map. Check the smallest singular value before rendering the patch.</violation>
</file>
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
| // so a local space that reaches the output non-uniformly displaces both axes by the wrong amount there. | ||
| let mesh_to_output = (self.parent_transform * self.mesh_transform).matrix2; | ||
| let output_scales = DVec2::new(mesh_to_output.x_axis.length(), mesh_to_output.y_axis.length()); | ||
| if !output_scales.is_finite() || output_scales.min_element() <= f64::EPSILON { |
There was a problem hiding this comment.
P2: When parent_transform * mesh_transform is singular but both columns are nonzero, this guard accepts a collapsed output transform and proceeds to build the displacement map. Check the smallest singular value before rendering the patch.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At node-graph/libraries/rendering/src/renderer/mesh_gradient.rs, line 1025:
<comment>When `parent_transform * mesh_transform` is singular but both columns are nonzero, this guard accepts a collapsed output transform and proceeds to build the displacement map. Check the smallest singular value before rendering the patch.</comment>
<file context>
@@ -1009,15 +1016,20 @@ impl<'mesh, 'field> SvgMeshPatchRenderer<'mesh, 'field> {
+ // so a local space that reaches the output non-uniformly displaces both axes by the wrong amount there.
+ let mesh_to_output = (self.parent_transform * self.mesh_transform).matrix2;
+ let output_scales = DVec2::new(mesh_to_output.x_axis.length(), mesh_to_output.y_axis.length());
+ if !output_scales.is_finite() || output_scales.min_element() <= f64::EPSILON {
return;
}
</file context>
8210179 to
edf1d71
Compare
|
@cubic-dev-ai Please review |
@YohYamasaki I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 68 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
|
!build (Run ID 35975976695) |
Wasm: 40.62 MB — JS: 0.46 MB — CSS: 0.09 MB — Fonts: 0.30 MB — Images: 0.09 MB — All Assets: 41.57 MB |
Closes #3990
Screen.Recording.2026-09-23.at.21.38.56.mp4
Add Coons patch-based mesh gradient paint and an experimental editing tool.
Neither Vello nor SVG has native rendering support for mesh gradients, so we rasterize them by the custom pipeline. The SVG export has an option to use displacement map method instead.
Known limitations