Skip to content

wideopensource/picad

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PiCad

Installation

pip install picad

Usage

This example finds small breaks in the board outline and joins them at their midpoint.

from picad import Layout

def fix_edge_cuts(layout:Layout, max_distance:float=1.0):
    points = sum([x.end_points for x in board_layout.get_all_lines(layer_name="Edge.Cuts")], ())

    for p in points:
        closest_p = min([x for x in points if 0 != p.distance_from(x)], key=lambda a: p.distance_from(a))
        
        if closest_p.distance_from(p) < max_distance:
            p.lerp(closest_p, 0.5)
            closest_p.move_to(p)

About

Python package for reading and writing KiCad 6+ S-expression files, no dependency on KiCad. pip install picad.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages