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

Include OF (offset) command #208

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

NemoAndrea
Copy link

Add basic way to have the OF (offset) command work in a way that is consistent with the official gerber viewer at https://gerber-viewer.ucamco.com/

%OF[A<±offset value>][B±offset value>]

It is listed a deprecated command, but I think it would be still be good to support it for older files, but I suppose that is for the project manager to decide

In the newer spec it states that the command it to be used only once per file, but in older versions (Rev D, 2001) it merely states that a single use is recommended. A machine I use that takes gerber files has no issues with multiple %OF%* commands in the same file

You can see the difference in the output of the following example file

%FSLAX25Y25*%
%MOMM*%

%ADD13R,0.4X1*%
G04 flash aperture 3 times, using the offset command*

D13*
X0Y0D03*

%OFA5B5*%
X0Y0D03*

%OFA-3B1*%
X0Y0D03*

M02*

The output SVG file (using GerberCairoContext) looks like the preview of the gerber file that the official viewer would give.

ucamco_basic_offset

inkscape_basic_offset

Without these changes the three flashes are all drawn at the same location (where each identical X0Y0D03 statement specifies)

p.s. I am not familiar with pull requests, so if I am breaking some kind of unwritten rules or if I should format things differently, do not hesitate to let me know.

Add basic way to have the OF (offset) command work in a way that is consistent with the official gerber viewer at https://gerber-viewer.ucamco.com/
@rusefillc
Copy link

@curtacircuitos poke?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants