Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

pcb-tools draw a wrong way? #222

Open
jekoie opened this issue Jun 9, 2022 · 3 comments
Open

pcb-tools draw a wrong way? #222

jekoie opened this issue Jun 9, 2022 · 3 comments

Comments

@jekoie
Copy link

jekoie commented Jun 9, 2022

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

pcb-tools draw this:
image

@Argmaster
Copy link

Hi, code you have provided doesn't create apertures nor select apertures which is a bit unexpected. However, this file is a valid Gerber file and should create what you have shown as expected.

@Argmaster
Copy link

Is it possible that you are missing G01 code somewhere around G04 Third level: small square - dark polarity*? As you are not setting line drawing mode before attempting to draw that square.

@jekoie
Copy link
Author

jekoie commented Sep 12, 2023

I don't know G01, the code I provided is from some where from internet.

Argmaster added a commit to Argmaster/pygerber that referenced this issue Sep 12, 2023
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.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants