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

Look at what options there might be to scale the element during the conversion #20

Closed
Vadoola opened this issue Sep 30, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@Vadoola
Copy link
Owner

Vadoola commented Sep 30, 2024

This was brought up by plc-user, the dxf imported quite small, and due to the rounding down to 2 decimal places of precision the circles (made of lines not ellipses) ended up all jagged. If we could scale the element before rounding, this might not be an issue. If we could also detect it as a circle instead of a bunch of polylines that would also solve it.

A cursory investigation shows that newer versions of dxf support embedding units, like inches, and mm, etc. However QET doesn't use any sort of real world units, it's all pixels...so even if I could read in a units from the dxf what would I scale it to?

The default grid and column layout is landscape with 8 rows 80px high with i believe a 60px high title block...not quite the same ratio as an A4 paper...but pretty close....I could assume we default to an A4 sheet of paper, and scale the dimensions to always be based on a 210mm sheet of paper? so if the dxf has a height of 2inches, that converts to 50.8mm, if we assume an A4 paper with 640px rows for the drawing plus 60px for title block, that comes out to 3⅓ px per mm, so I would scale the block to 169⅓ px high (and the width equivalently). No clue if this would work well...can give it a go.

@Vadoola Vadoola self-assigned this Sep 30, 2024
@Vadoola Vadoola added the enhancement New feature or request label Sep 30, 2024
@Vadoola
Copy link
Owner Author

Vadoola commented Dec 12, 2024

This isn't fully tested and might not be complete, but preliminary work for this feature was added in commits 96b74f5 and 886a573

@Vadoola
Copy link
Owner Author

Vadoola commented Jan 9, 2025

The scaling seems to work well, per the discussion at https://qelectrotech.org/forum/viewtopic.php?pid=20685#p20685
the values have been changed to scale as 2px per 1 mm.

This change was made in commit bc38fe5, and works well enough to close this issue.

@Vadoola Vadoola closed this as completed Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant