Skip to content

Incorrect Board Outline Rendering #203

@tgbl-mk

Description

@tgbl-mk

Describe the bug

When rendering board outlines with rounded edges pygerber is sometimes generating an inverted arc.
image

To Reproduce
I have included all the files required to reproduce the error in this zip.
board_outline_error.zip
Including the below python script.

from pathlib import Path

from pygerber.common.rgba import RGBA
from pygerber.gerberx3.api.v2 import ColorScheme, GerberFile, PixelFormatEnum, Project, COLOR_MAP_T, FileTypeEnum

DEFAULT_COLORSCHEME = ColorScheme(
    background_color=RGBA.from_hex("#000000CF"),
    clear_color=RGBA.from_hex("#000000CF"),
    solid_color=RGBA.from_hex("#CFCF00"),
    clear_region_color=RGBA.from_hex("#000000CF"),
    solid_region_color=RGBA.from_hex("#CFCF00"),
)

DEFAULT_COLORMAP: COLOR_MAP_T = {FileTypeEnum.OTHER: DEFAULT_COLORSCHEME}

outline_file = Path("./outline.gbr")
gerber_file = Path("./bottom_mask.gbr")

def _create_gerber_png(board_outline_file: str , file: str, type: str, output_path: Path) -> None:

    gerber_png_path: Path = output_path / Path(f"{type}.png")
    Project(
        [
            GerberFile.from_file(board_outline_file, FileTypeEnum.OTHER),
            GerberFile.from_file(file, FileTypeEnum.OTHER),
        ]
    ).parse().render_raster(
        gerber_png_path,
        color_map=DEFAULT_COLORMAP,
        dpmm=20,
        pixel_format=PixelFormatEnum.RGBA,
    )

_create_gerber_png(outline_file, gerber_file, "test", "./")

Expected behavior

Expect the board outline to show the rounded edges in the correct orientation, as shown below (altium gerber viewer of the attached board outline file)
image

Screenshots

If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: windows 10
  • Python version: 3.11.0
  • PyGerber version: 2.3.1

Additional context

Gerbers generated from Altium 23.5.1. I have other designs which render some corners correctly, so I suspect this has something to do with how the rounded edge is created in altium affecting the gerber output.
image

If you need any additional information please let me know. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions