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

fix: Correct SVG transformations in GCode Preview #816

Merged
merged 1 commit into from
Aug 8, 2022

Conversation

rianadon
Copy link
Contributor

@rianadon rianadon commented Aug 6, 2022

If a printer is not configured to have a (0,0) (xmin, ymin) coordinate, the GCode preview currently does not show up like in the picture below. For example, my printer's x goes from -113 to +113 and y from -74 to +74.

image

I fixed two issues with the SVG generation:

  • The final 2 parameters of viewBox are the width & height of the image, not the +x and +y values.
  • When flipping the image, the min & max coordinates should be added instead of subtracted. Imagine the print bed has minimum x 100 and maximum x 200. When flipped across the origin, it's going to end up far away and need to be translated 300px back.

Now, the preview shows up:
image

Signed-off-by: Ryan Adolf [email protected]

@pedrolamas
Copy link
Member

Thanks for this @rianadon.

Am I correct in saying that this will fix #363 ?

@pedrolamas pedrolamas added this to the 1.20 milestone Aug 6, 2022
@rianadon
Copy link
Contributor Author

rianadon commented Aug 7, 2022

I didn't see that issue! But yes, it will fix #363.

I had the same issues with a nonzero position_min and the flip image settings, but those went away after the changes.

@pedrolamas pedrolamas linked an issue Aug 7, 2022 that may be closed by this pull request
Copy link
Member

@matmen matmen left a comment

Choose a reason for hiding this comment

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

LGTM

@matmen matmen requested a review from pedrolamas August 7, 2022 20:15
@pedrolamas
Copy link
Member

@rianadon Please add a footer to the main PR comment with a "Signed-off-by" line, following the CONTRIBUTING guidelines.

Thank you!

@pedrolamas pedrolamas added GH - Bug Something isn't working GH - Waiting for Feedback Waiting for the issuer to reply labels Aug 8, 2022
@rianadon
Copy link
Contributor Author

rianadon commented Aug 8, 2022

Sorry my bad! I've updated the description.

@pedrolamas pedrolamas merged commit ed5e5d1 into fluidd-core:develop Aug 8, 2022
@pedrolamas pedrolamas removed the GH - Waiting for Feedback Waiting for the issuer to reply label Aug 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GH - Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gcode preview (beta) not showing whole printing area
3 participants