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

[FEATURE] When mirroring a layer with text, allow the text to be mirrored 'back' #561

Closed
oliv3r opened this issue Jan 16, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@oliv3r
Copy link

oliv3r commented Jan 16, 2024

When adding dimensions via the 'User.Drawings' layer (kicad default), we can put dimensions in documents. This looks great, until wil print a layer stack (pdf) mirrored.

          layers:
          - layer: 'B.Cu'
          - layer: 'B.Mask'
            color: '#14332440'
          - layer: 'B.SilkS'
            color: '#f2eda1ff'
          - layer: 'User.Comments'
          mirror: true

However while its understandable that silk-screen gets mirrored (though in this case it gets unmirrored due to it being the back silkscreen), the dimensions now get mirrored numbers.

image

So what works great for the layers needed for fab, doesn't work for User.Comments/dimensions. What we should do however (with a layer property) re-mirror just the gr_text in the Cmts.User layer. Though we could do a mirror_text flag on any layer to be fair, safest would be to limit it to user layers however imo.

    (gr_text "48,3 mm" (at 109.22 50.920001) (layer "Cmts.User") (tstamp c4fd811c-612b-4b7c-9986-befbd6bb585d)
      (effects (font (size 1 1) (thickness 0.15)) (justify mirror))
    )

Obviously we should also honor the restore_project flag, to ensure the repository is left as we found it.

It seems, that if no property is set, justify is intended, which is a bit weird, so may need a double check.

@oliv3r oliv3r added the enhancement New feature or request label Jan 16, 2024
set-soft added a commit that referenced this issue Jan 18, 2024
In the user layers when creating a mirrored page

Closes #561
@set-soft
Copy link
Member

Ok, this is a little bit tricky, but I think the above patch does the work.

@oliv3r
Copy link
Author

oliv3r commented Jan 19, 2024

@set-soft amazing, I didn't even know you fixed this, and was surprised that my dimensions all of a sudden where correct :)

I'm not sure I understand the options correctly, for me it was 'just working' with mirror: true. The PCB text is indeed mirrored, Regardless, the default work :D

@set-soft
Copy link
Member

@set-soft amazing, I didn't even know you fixed this, and was surprised that my dimensions all of a sudden where correct :)

I´m scanning all the PCB elements and also all the elements inside footprints. The algorithm just looks for objects that inherits from the basic text class and implements GetShownText, I tried with all stuff that came to my mind and worked, but I can't be sure all objects are covered.

I'm not sure I understand the options correctly, for me it was 'just working' with mirror: true. The PCB text is indeed mirrored, Regardless, the default work :D

The idea is that it should work out-of-the-box. As KiCad doesn't mirror text in the user layers when you explicitly ask for mirrored output the default is to just mirror the text. But you can disable it (in case you manually mirrored the text!). One option controls the text objects that are in the board and the other the objects inside footprints.

The code also adjusts the alignment (justification) of the text, so right justified text becomes left justified when mirrored.

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

2 participants