Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement: Limit scale value in 3DP to avoid object dimension setting to 0 #586

Merged

Conversation

jane-rose
Copy link
Contributor

No description provided.

@jane-rose jane-rose added the Type: Improvement An improvement to a current feature label Nov 27, 2020
|| parentEVec.y * meshObject.scale.y < 0.01
|| parentEVec.z * meshObject.scale.z < 0.01
) {
shouldDisableScale = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

break or return

Copy link
Contributor Author

Choose a reason for hiding this comment

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

inside 'forEach' can't use break or return, i change it to 'every'

Copy link
Contributor

Choose a reason for hiding this comment

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

You can return the value of Array.every()

shouldApplyScaleToObjects(parentEVec) {
  return this.object.children.every((meshObject) => {
    if (condition) {
      return false; // should disable 
    }
    return true;
  });
}

@jane-rose jane-rose force-pushed the improve-to-limit-the-scale-value branch from 7ba0712 to 8ee1c9a Compare November 30, 2020 12:22
@jane-rose jane-rose force-pushed the improve-to-limit-the-scale-value branch from 8ee1c9a to e8b7b0e Compare November 30, 2020 12:26
@parachvte parachvte changed the title Improvement: Limit setting scale vale in 3DP Improvement: Limit scale value in 3DP to avoid object dimension setting to 0 Nov 30, 2020
@parachvte
Copy link
Contributor

LGTM

@parachvte parachvte merged commit 01b0057 into Snapmaker:master Nov 30, 2020
@jane-rose jane-rose deleted the improve-to-limit-the-scale-value branch December 21, 2020 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Improvement An improvement to a current feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants