Giter Club home page Giter Club logo

fcad_pcb's Introduction

FreeCAD scripts for PCB CAD/CAM & FEM

fcad_pcb is yet another way to improve ECAD/MCAD collaboration betweeen FreeCAD and KiCAD.

The original purpose of these tools was to do PCB milling in FreeCAD. It can do much more now. It can generate gcode from kicad_pcb directly without going though gerber stage. It can let your modify the PCB directly inside FC (done already), and potentially export back to kicad_pcb (partially done). And finally it can generate solid tracks, pads and plated drills to enable FEM and thermal analysis on KiCad pcb boards.

Installation

fcad_pcb is written in Python, and requires FreeCAD 0.17 or later to work properly.

Clone this repo into your freecad macro directory. After clone, cd to fcad_pcb, and checkout the submodules

git submodule update --init --recursive

Usage

Start FreeCAD, in the console, the simplest usage:

  • generating copper layers
from fcad_pcb import kicad
pcb = kicad.KicadFcad(<full_path_to_your_kicad_pcb_file>)
pcb.makeCoppers()
  • generating copper layers, pads, drills as a full solid object, ready to be handled in FEM WB
from fcad_pcb import kicad
pcb = kicad.KicadFcad(<full_path_to_your_kicad_pcb_file>)
pcb.make(copper_thickness=0.035, board_thickness=1.53, combo=False, fuseCoppers=True )
  • supply copper thickness per layer, pass a dictionary instead. Use either integer (0~31, 0 being the front and 31 the back), or layer name for key. Key None can be used for default thickness.
pcb.make(copper_thickness={None:0.05, 0:0.04, 'B.Cu':0.09}, board_thickness=1.53, combo=False, fuseCoppers=True)
  • generating single copper layer
pcb.setLayer('F.Cu')
pcb.makeCopper()
pcb.setNetFilter('GND')
pcb.makeCopper()

pcb.setNetFilter('GND','VCC')
pcb.makeCopper()

In case you only want the shape without any intermediate document objects,

from fcad_pcb import kicad
pcb = kicad.KicadFcad(<full_path_to_your_kicad_pcb_file>, add_feature=False)
# Or, you can set the parameter later
pcb.add_feature = False

# All the above makeXXX() calls now returns a shape without creating any features
# For example, if you want the complete fused copper layers. Note 'thickness' can
# be a dictionary for per layer thickness
coppers = pcb.makeCoppers(shape_type='solid',holes=True,fuse=True,thickness=0.05)
Part.show(coppers)

Note that there is a sample board to play with inside the repo: test.kicad_pcb

Screenshots

FEM of tracks and drills: Full Board Loaded in FC for FEM

Full PCB in FreeCAD: Full PCB in FreeCAD

PCB for milling: PCB for milling

FEM of tracks and drills: Full Board Loaded in FC for FEM

Requirements

  • FreeCAD 0.17, FreeCAD 0.18, FreeCAD 0.19

fcad_pcb's People

Contributors

realthunder avatar easyw avatar mitjanemec avatar yrabbit avatar vagnum08 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.