Skip to content

fix: prevent geometry shift in Auto-Tangents when spread is 0#3890

Open
Chetansahney wants to merge 1 commit intoGraphiteEditor:masterfrom
Chetansahney:fix-auto-tangents-bug
Open

fix: prevent geometry shift in Auto-Tangents when spread is 0#3890
Chetansahney wants to merge 1 commit intoGraphiteEditor:masterfrom
Chetansahney:fix-auto-tangents-bug

Conversation

@Chetansahney
Copy link

Fixes #3822

Here is the fix to Spread==0 error and the AutoTangents error.
Based on the discussion : https://discord.com/channels/731730685944922173/731738914812854303/1481764902266736660

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves an issue where the Auto-Tangents feature could inadvertently alter geometry when the 'spread' parameter was set to zero. The fix ensures that existing manipulator handles are correctly maintained under these specific conditions, preventing unwanted modifications and preserving the intended shape of the geometry.

Highlights

  • Bug Fix: Addressed a bug in the auto_tangents function that caused unintended geometry shifts when the spread value was zero.
  • Conditional Logic: Introduced a new conditional check within the auto_tangents function to explicitly preserve existing manipulator geometry when preserve_existing is true and spread is 0.0.
Changelog
  • node-graph/nodes/vector/src/vector_nodes.rs
    • Added a conditional check within the auto_tangents function to prevent geometry shifts when spread is 0 and preserve_existing is true.
Activity
  • No specific activity (comments, reviews, progress updates) has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a fix to prevent geometry shifts in the Auto-Tangents node when spread is 0 and preserve_existing is enabled. The added logic correctly preserves the existing manipulator groups in this specific case, preventing their handles from being reset. My review includes a minor suggestion to improve the code style and readability of the new block, aligning it with idiomatic Rust formatting.

Comment on lines +906 to +912

// Changes to the original logic:
if preserve_existing && spread == 0.0
{
new_manipulators_list.push(*curr);
continue;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The added logic is correct. However, it can be formatted more idiomatically to improve readability. The temporary comment and extra blank line can be removed, and the if statement can be formatted using standard Rust style (opening brace on the same line).

 					if preserve_existing && spread == 0.0 {
 						new_manipulators_list.push(*curr);
 						continue;
 					}

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file


Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Add one-off context when rerunning by tagging @cubic-dev-ai with guidance or docs links (including llms.txt)
  • Ask questions if you need clarification on any suggestion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto-Tangents node with spread = 0 and preserve existing = true causes weird change

1 participant