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

Release 2.1.0 #59

Merged
merged 74 commits into from
Nov 1, 2023
Merged

Release 2.1.0 #59

merged 74 commits into from
Nov 1, 2023

Conversation

Argmaster
Copy link
Owner

@Argmaster Argmaster commented Sep 11, 2023

Release 2.1.0

## Command line usage

After installing `pygerber`, depending on your environment, it should
become available
in your command line:

```bash
pygerber --version
```

Output should be similar to one below **⇩**, where `x.y.z` should match
version of
PyGerber installed.

```
$ pygerber --version
pygerber, version x.y.z
```

Use `--help` to display help messages with lists of subcommands and
subcommand options:

```
pygerber raster-2d --help
```

To render 2D PNG image of some gerber file you can simply use:

```
pygerber raster-2d gerber-source.grb
```

Image will be saved to `output.png` in current working directory.


![example_pcb_image](https://github.com/Argmaster/pygerber/assets/56170852/9bca28bf-8aa6-4215-aac1-62c386490485)
This pull request attempts to fix some of the rendering differences between KiCAD and PyGerber. Currently following changes have been made:
- Added `draw_region_outlines` option (disabled by default) which controls whether lines which make up a region boundary should be drawn after region is filled. KiCAD seem to assume that those boundaries are not drawn and region outline is 1px instead of thickness of aperture.
- Increased expected Decimal precision to 60 decimal places.
- Changed precision of `INCH_TO_MM_MULTIPLIER` (now its `25.4`) and `MM_TO_INCH_MULTIPLIER` (dynamically calculated with `Decimal`).

![image](https://github.com/Argmaster/pygerber/assets/56170852/9b587ab5-704d-4868-a60d-5ea5e6e12594)
@Argmaster Argmaster added the enhancement New feature or request label Sep 11, 2023
@Argmaster Argmaster added this to the Release 2.1.0 milestone Sep 11, 2023
@Argmaster Argmaster self-assigned this Sep 11, 2023
@codecov
Copy link

codecov bot commented Sep 11, 2023

Codecov Report

Merging #59 (c9e2cdf) into main (2c1fe02) will decrease coverage by 5.64%.
The diff coverage is 80.80%.

❗ Current head c9e2cdf differs from pull request most recent head e5e2a7b. Consider uploading reports for the commit e5e2a7b to get more accurate results

@@            Coverage Diff             @@
##             main      #59      +/-   ##
==========================================
- Coverage   91.31%   85.68%   -5.64%     
==========================================
  Files          93      124      +31     
  Lines        2810     3605     +795     
==========================================
+ Hits         2566     3089     +523     
- Misses        244      516     +272     
Flag Coverage Δ
unittests 85.68% <80.80%> (-5.64%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
src/pygerber/__init__.py 100.00% <100.00%> (ø)
src/pygerber/backend/abstract/aperture_handle.py 98.41% <100.00%> (-0.03%) ⬇️
...ygerber/backend/abstract/draw_commands/draw_arc.py 98.50% <100.00%> (+0.72%) ⬆️
...ber/backend/abstract/draw_commands/draw_polygon.py 100.00% <100.00%> (ø)
...r/backend/abstract/draw_commands/draw_rectangle.py 100.00% <100.00%> (ø)
...backend/abstract/draw_commands/draw_vector_line.py 100.00% <100.00%> (ø)
src/pygerber/backend/abstract/drawing_target.py 100.00% <100.00%> (ø)
src/pygerber/backend/rasterized_2d/backend_cls.py 97.75% <100.00%> (ø)
...er/backend/rasterized_2d/draw_commands/draw_arc.py 88.88% <100.00%> (-3.12%) ⬇️
src/pygerber/gerberx3/api/_layers.py 85.92% <100.00%> (ø)
... and 82 more

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Argmaster and others added 10 commits September 11, 2023 23:29
Inspired by @jekoie issue
[#222](curtacircuitos/pcb-tools#222) from
[pcb-tools](https://github.com/curtacircuitos/pcb-tools) repository

> Below gerber file, why pcb-tools draw it in a wrong way?
> 
> ```
> G04 This file illustrates how to use levels to create holes*
> %FSLAX25Y25*%
> %MOMM*%
> G01*
> G04 First level: big square - dark polarity*
> %LPD*%
> G36*
> X250000Y250000D02*
> X1750000D01*
> Y1750000D01*
> X250000D01*
> Y250000D01*
> G37*
> G04 Second level: big circle - clear polarity*
> %LPC*%
> G36*
> G75*
> X500000Y1000000D02*
> G03*
> X500000Y1000000I500000J0D01*
> G37*
> G04 Third level: small square - dark polarity*
> %LPD*%
> G36*
> X750000Y750000D02*
> X1250000D01*
> Y1250000D01*
> X750000D01*
> Y750000D01*
> G37*
> G04 Fourth level: small circle - clear polarity*
> %LPC*%
> G36*
> G75*
> X1150000Y1000000D02*
> G03*
> X1150000Y1000000I250000J0D01*
> G37*
> M02*
> ```
> 
> It should be this: 
>
![image](https://user-images.githubusercontent.com/6836400/172787712-5ddd91e5-4682-44b9-943a-ffee0fd6e45c.png)
> 
> pcb-tools draw this: 
>
![image](https://user-images.githubusercontent.com/6836400/172787860-53f069e2-cfad-451a-b649-dacf4ab74673.png)

Above code mostly works, but required additional `G01` in before
rectangle region creation:

```
G04 Third level: small square - dark polarity*
G01*
```

Additionally, during development of this feature I might have revealed
hidden issue with centering images with debug features enabled, further
investigation is needed.
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.0.278 to 0.0.289.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/BREAKING_CHANGES.md)
- [Commits](astral-sh/ruff@v0.0.278...v0.0.289)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
- better specification references in token docstrings.
- better specification references in warnings.
dependabot bot and others added 9 commits October 18, 2023 01:02
Bumps [pydantic](https://github.com/pydantic/pydantic) from 2.3.0 to 2.4.2.
- [Release notes](https://github.com/pydantic/pydantic/releases)
- [Changelog](https://github.com/pydantic/pydantic/blob/main/HISTORY.md)
- [Commits](pydantic/pydantic@v2.3.0...v2.4.2)

---
updated-dependencies:
- dependency-name: pydantic
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [pyparsing](https://github.com/pyparsing/pyparsing) from 3.1.0 to 3.1.1.
- [Release notes](https://github.com/pyparsing/pyparsing/releases)
- [Changelog](https://github.com/pyparsing/pyparsing/blob/master/CHANGES)
- [Commits](pyparsing/pyparsing@3.1.0...3.1.1)

---
updated-dependencies:
- dependency-name: pyparsing
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.0.289 to 0.1.2.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](astral-sh/ruff@v0.0.289...v0.1.2)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 3.4.0 to 3.5.0.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md)
- [Commits](pre-commit/pre-commit@v3.4.0...v3.5.0)

---
updated-dependencies:
- dependency-name: pre-commit
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [lsprotocol](https://github.com/microsoft/lsprotocol) from 2023.0.0a3 to 2023.0.0b1.
- [Release notes](https://github.com/microsoft/lsprotocol/releases)
- [Commits](microsoft/lsprotocol@2023.0.0a3...2023.0.0b1)

---
updated-dependencies:
- dependency-name: lsprotocol
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [mkdocs](https://github.com/mkdocs/mkdocs) from 1.5.2 to 1.5.3.
- [Release notes](https://github.com/mkdocs/mkdocs/releases)
- [Commits](mkdocs/mkdocs@1.5.2...1.5.3)

---
updated-dependencies:
- dependency-name: mkdocs
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [mkdocs-literate-nav](https://github.com/oprypin/mkdocs-literate-nav) from 0.6.0 to 0.6.1.
- [Release notes](https://github.com/oprypin/mkdocs-literate-nav/releases)
- [Commits](oprypin/mkdocs-literate-nav@v0.6.0...v0.6.1)

---
updated-dependencies:
- dependency-name: mkdocs-literate-nav
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.1.21 to 9.4.7.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](squidfunk/mkdocs-material@9.1.21...9.4.7)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@Argmaster Argmaster merged commit c102351 into main Nov 1, 2023
@Argmaster Argmaster deleted the dev branch November 1, 2023 16:51
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
Status: Done
1 participant