Plastic case .DWG .IGS .STP files to KiCad board Edge.Cuts

Plastic casing has 2D/3D files in .DWG, IGS, .STP and .x_t

How to convert to Edge.Cuts for making PCB fitting inside the plastic case?

Many thanks

I think you will find some help using this plugin GitHub - easyw/kicadStepUpMod: kicadStepUp: ECAD to MCAD FreeCAD WorkBench

1 Like

Basically I need to make 2D board outline from the factory file into KiCad.
It is a simple rectangle box with cut out for mounting screw column/holes.
No strong need for automatic component height check. They are simple to do manually. A simple tools is enough for task on hand.
Many thanks

You have to extract the 2D board outline (for example in a dxf format) from your 3D box model. In this case you can use Freecad for this purpose and ask their forum if needed.

Then with Kicad you can import the extracted dxf and generate the Edge.Cuts layer (the PCB board outline)

Just to be clear (gschelotto already wrote this). KiCad itself does not understand those file formats. (Except for step, but that is only for viewing purposes). You need another program to import your files, and modify them into a 2D graphics (either .SVG or .DXF) that KiCad can understand. FreeCAD is indeed an option here. I have seen demo’s (and done it myself) to:

  1. Open a 3D step file in FreeCAD.
  2. Select a “circumference” of some edges of the step model, turn that into a single plane sketch.
  3. Add an offset to create a clearance.
  4. Use KiCadStepUp to transfer the data to the Edge.Cuts layer in KiCad.

Many thanks. Tried several options. The best are as below.

Stiil have 7 errors (seem sub-mm overlapping points) on the board outline (Edge.Cuts).

Will the PCB manufacturer’s software handle and ignore those 7 errors and produce the PCB ok?

  1. Download latest 0.21.2 Wondows FreeCAD.
  2. Open .stp file
  3. There is an independent object PCB (apart from the top, bottom, screw, etc.)
  4. Export as DXF

========

  1. On KiCad, create new project
  2. On PCB editor, import. Looking good on screen
  3. Run DRC, 199+ error
  4. Use KiCad Clean up function
  5. Down to 7 errors on corner, etc.
  6. With warning of DRC error, genertaed gerber file
  7. Use KiCad to view the generated gerber. Look ok on screen. Will these 7 errors be accepted by the PCB manufacturer software?




clean


I think you should be able to fix that in KiCad easily . … select the 2 segments that are intersecting, right click Shape Modification>Heal Shapes

Then . . .

image

For me the easiest option is to draw such PCB outline in KiCad.

Fixed one error on full circle mounting hole.
Did not work on the others (quarter circle meeting straight line)

do you have the original enclosure file or a link to download it to make a test?

Perhaps the below image will Help (note the Kicad DXF Export Setting.

Exported both settings and you see the difference and results…

Yellow and Purple on left are Imported back into Kicad…

For Importing into FreeCAD (and avoiding mannnny lines/dot/arc-segments… last screenshot shows my settings…

The source .stp file was read by FreeCAD.
FreeCAD export to .svg and .dxf
KiCad import the .svg and .dxf files

This is the pcb file in FreeCAD format.
I am trying to export from FreeCAD into a format that KiCad can import (and without DRC error for malformed Edge.Cuts)

pcb.FCStd (9.6 KB)

I used kicadStepUp for the conversion… no issues here
pcb-1551NFL.kicad_pcb (4.7 KB)
pcb-sketch.FCStd (14.7 KB)

Wonderful and thanks.

How was your steps in moving the original file through FreeCAD, KiCadStepUp and finally in into KiCad Edge.Cuts layer?

Hi,
in FreeCAD w/ StepUp you can generate a Sketch from the pcb shape with the following:


and then you can push it to a new kicad_pcb file:

It is just 2 clicks from the 3D model of the box.

1 Like