Getting from Inventor to copper is maddening

I’m systematically trying everything I can think of to get my DXF export from Inventor into Kicad (both version 5 and 6) and onto correct layers. NOTHING has worked correctly so far.

Origin: Internal wafer for rotary switch, designed in Inventor, each sketch exported as DXF, which is the only native option. Individual files exported for edge cuts, solder mask, F.cu and user dwg (to assist in lining everything up). I’ve seen some plugins to export to SVG, but haven’t tried those…yet.

These exported sketches need to import into Kicad and be assigned as copper, mask, edge cuts etc. I’ve accomplished the edge cuts. I’ve accomplished the mask. I created a footprint built from imported DXF files. But for the life of me I can not convert the DXF into usable top copper polygons.

I’ve watched tutorials. I read blogs. I followed along step by step with the skull and crossbones video. Great BTW! I’ve tried converting my Inventor DXF export to every format my software will generate. So far:

Inkscape: DXF to SVG, BMP, PNG SVG toShenzhen

Corel: BMP, SVG, PNG filled, not filled, no line weight

Online converters: DXF to SVG, BMP, PNG, DWG

FeeCAD: import DXF. Stepup to Kicad, export CAD file

There seems to be a general incompatibility between 3D CAD software,vector based graphics software and PCB CAD software. I’ve spent hours “cleaning up” DXF files and converting to vector based file types. Corner nodes are ALWAYS just slightly not connected. Most bitmaps translate into pixelated garbage. The online converter does a great job at conversion, but skews the scale to 10:1. UGH!

I’m more than willing to put in the work, but feeling like I’ve hit a brick wall. Am I so daft that I’m missing some obvious step in the workflow?

What I need to accomplish: a custom shaped pcb that replaces a layer on a rotary switch, with custom shaped pads in a 300 degree array (make before break). This requires closely placed pads with clearance overrides.

What tools I have available:

Autodesk Inventor 2016

Autodesk Fusion 360

Kicad 5.1.12

Kicad 6.0

Inkscape with SVGtoShenzeng

FreeCAD with StepUP

Corel 2017

online converters

Thanks for any insight.

1 Like

Could you post a sample of what you are trying to convert ? I know it is not an straightforward process but it should be doable.

EDIT: Some examples of complex shapes imported with StepUp

1 Like

For what it’s worth, I feel your pain.

KiCad has some weak spots and two of them come together in working with imported graphics, and with arcs. (Although this is slowly improving.)
You can import DXF graphics directly onto a copper layer, but then it still is graphics, and KiCad makes an important distinction between copper tracks, and graphics (even when on a copper layer).

On top of that, DXF has always been a quite horrible file format. It’s a very old and simple format, but because of it’s age there are some different dialects. You’re already lucky if your DXF exporter does not convert each arc to a bunch of line segments. I have long suspected creators of “commercial software” to thwart or sabotage interoperability, (or at least, they don’t put effort in interoperability to make it work properly). There is a saying that you should not attribute things to malice which can be explained by incompetence.

Importing lines (and arcs) works in KiCad, but filled area’s are more problematic. The article pointed to by der.ule may help here.

I do not have a clear view of what you have and what you want the end result to be.
If it is a simple rotary switch, then just using the imported .DXF as an example and retracing it in KiCad may be an option. For a complicated switch, such as used in for example a DMM it’s not such a good idea.

Maybe you can do something from within the footprint editor. This would require you to export a DXF file for each contact of the switch. I suggest you test if this works with a simple example. The workflow is like:

  • Open the Footprint editor, create a library, and a footprint in that library (only the first time).
  • Footprint Editor / Place / Add Pad
  • Place the pad somewhere by clicking in the drawing area.
  • [Cancel] to stop adding more pads, you just want one.
  • Right-click on the pad and select: Edit Pad as Graphics Shapes [Ctrl + E] from the popup menu.
  • A yellow info bar appears with: Pad Edit Mode. Press Ctrl+E again to exit.
  • Footprint Editor / File / Import / Graphics
  • Import the graphics for a single pad. You have multiple pads for your footprint and you probably want to import each of them at the same location, so select an absolute location instead of “interactive placement”.
1 Like

In case someone wants to try to help you in some concrete way, it would help tremendously if you would attach the problematic DXF here.

2 Likes

Indeed.

Der.ule also already mentioned this.
If you post those files, then I may try to see if I can devise a workflow that works with them.

2 Likes

Thanks all, very much.

It’s tricky to post files, I design under contract for other companies. Or, in this case as partner on the project. Always with NDA’s in place. Regardless, I think I can post simple geometry as see where it goes.

Example: 30 trapezoid shapes pads, in circular array, spanning 300 degrees. I can’t upload because I’m too new here. So, here’s a dropbox link:

https://www.dropbox.com/s/0xqzq03dc0m1mjn/30%20pads%20300%20arc.zip?dl=1

Several file types. I did exclude BMP because the smallest one was over 2M. The largest is 12M.

Each pad needs to merge with an SMD pad. Because the switch is make before break the pads have to be close enough together for the wiper to be in contact with two adjacent pads. This will surely cause DRC errors. I’m hoping I can work with the fab shop to override these.

In the SVG and BMP files I created from the DXF, each trapezoid was combined and reduced to 4 nodes. As simple as it can be graphically. Upon import in Kicad, each trap had many nodes. Typically around 20.

One workaround I have been trying today is editing the SMD pad shape in PCBnew. I can tweak it into a trapezoid and adjust rotation until each one matches the array. It’s less precise, but may be the best option at this time.

I’m experimenting a bit, and write along with notes as I go…

I started with some ground work:

  • Create a new KiCad project.
  • Copy your files into it.
  • Create a footprint library.
  • Create a footprint in that library.

Then I imported your graphics.
The DXF imports just fine.
Imported graphics are a “block”, and you have to enter the block to be able to edit their elements. When I do so, I see that each area is made of two lines and two arcs, so that looks great.

Save, will be continued…

1 Like

There are a few ways to do it…

Given we nothing beyond what you’ve posted, I will assume you:
• Want to use Inventor for CAD work related to this and simply want a Graphic or Footprint of your shape
• If that is the case, you can Save your Pad shape (from Inventor) as an image (PNG) and load it into Kicad’s BMP Tool. Some practice is required to get final geometry/scaling correct.
Screenshot example below.

However, if wanting a simpler solution, Draw the Shape in Footprint Editor (draw one Pad) then, set the layer to desired copper layer then, use the ‘Make Array’ tool.

• You can draw Guide lines on any layer then, use the Poly Graphic tool by tracing the shape. Do that before making the Array. You can stop Snapping the drawn lines using a Key on your machine (on mine, it’s Shift-Alt)
Screenshot below
• For additional Design Geometry and features (if wanting to use Inventor) you can Import the desired DXF’s into the Footprint Editor…

I did NOT strive for your dimensions/etc, this is simply an example of the steps… DXF’s are fine but, sometimes a simple solutions works well…

Using the BMP Tool

Drawing it in Footprint Editor…

1 Like

Could you send us the DXF file you have problems with through PM (or create a confidential issue on gitlab)? Would you be also able to list and prioritize the particular issues (i.e. where there are discontinuities, what to expect from the pad polygons, etc.). We are planning to add some improvements to the DXF (or generally, graphics) import in the V7 and your feedback (or a ‘guinea pig’ design) would be much appreciated.

Tom

1 Like

After some more experimentation, I came up with a method that seems to work quite nicely, and is very similar to what BlackCoffee did.

  1. Footprint editor, with new library / footprint / etc.
  2. Footprint Editor / File / Import / Graphics / File: 30_PADS_thing
    • Placement at (0, 0)
    • Graphic Layer: User.Drawings.
    • Do not group items.
    • Default Line Width 0 (draws them as single pixel)
  3. Place a pad in one of your imported pads:
    image
  4. Select the pad to highlight it, then press [Ctrl + E] to enter “pad edit mode”.
  5. In the “pad edit mode” of that pad, switch to the User.Drawings layer. This is needed to be able to use your imported graphics as magnetic snap points.
  6. Footprint Editor, Place / Draw Graphic Polygon, and trace a polygon around your pad. Note that if the magnetic snap points are recognized, a little circle is drawn around the cursor / snap point.
    image
  7. Abort the polygon function, then select the polygon you just drew and adjust it’s properties. Set it to F.Cu layer, maybe adjust line widht (half of which is added to the polygon, but also creates nice round corners).
    image
  8. [Ctrl + E] to exit the “Pad Edit Mode”.
  9. Select the pad, Right click and select Special Tools / Create Array from the popup menu.
    10 Create a circular array with 10 degrees between each pad, and a count of 30. Centerpoint of rotation is (0, 0) because that is where the imported graphics are.

The Result:

1 Like

So just for fun I added a schematic and a PCB with the created footprint.
Note that the imported graphics are still on User.Drawings, but that could have been edited in any way you like.

I also did not do anything with the solder mask and paste layers, so by default all your SMT pads will be covered by solder paste, but the good thing is all those layers are created automatically just from the pad outline.

Here is my result back, including all of the original files you made public on dropbox:
2022-01-17_asdf_rotary_switch_footprint.zip (420.1 KB)

1 Like

OK, it looks like we have two annoying issues here:

  • Arcs in the example provided by @Velvetgeorge are poorly approximated in the DXF import plugin. This looks like a bug.
  • It would be useful to have a tool to convert free polygons/other shapes into custom-shaped pads. We’ll discuss it with the dev team.

T.

2 Likes

In the test I did, arcs imported from the .DXF files remain (editable) arcs in the Footprint Editor.

I do think (not sure) that arcs in polygons are not supported at all, and polygons are just that, a shape made out of straight line segments.

KiCad can do a conversion from arcs to (a lot of) line segments, if you select some graphics, and then select from the popup menu: Create from Selection / Create Polygon from Selection. (Same if you select Create Zone from Selection)

1 Like

It depends on the type of the DXF primitive used. Individual arcs should be treated as arcs, I’m not sure if the ones contained in complex DXF outlines are.

2 Likes

I took a slightly different approach using FreeCAD and the KiCad StepUp Workbench (KSU).

  1. Import DXF (30 PADS 300 DEGREE ARC.dxf) file into FreeCAD

  2. Open the KSU workbench and transform each of the pad shapes to an sketch, using the button “2D Object (or DXF) to Sketch”

  3. Each sketch will need a small circle in the middle to be recognized as the anchor point of the pad (this of course can be part of the DXF from the beginning)

  4. Rename each sketch to “Pads_Poly_Arc_pad#” (where # is the pad number)

  5. If you would like fancy art on the silkscreen, then create another sketch (or import it) and rename it to “F_Silks_0.16” (where 0.16 is the line width, in this case 0.16mm)

  6. Include your reference (“REF**”) and value labels (“Value”), embarrasingly I do not know how to do this, so I just simple copied those elements from one of the KSU examples :no_mouth: :no_mouth::flushed: :flushed: :flushed: )

  7. When you are ready with all your elements, just select them all and use the button “Footprint editor and exporter” and choose a destination for your footprint

  8. Open your new footprint with the footprint editor and change the pad numbering (Right click → Renumber pads … ), this step may be a bug with the current version of KSU but it takes just a couple of seconds to do it, so, no biggie.


    image

I hope this helps, the advantage for me with this approach is how quickly is to modify the footprint once everything is set up!

EDIT: It appears that at some point the syntaxis for the pad enumeration changed, so in step #4 instead of “Pads_Poly_Arc_pad#” the correct syntaxis would be “Pads_Poly_Arc_padNum=#”

1 Like

Incredible! I never expected this level of helpful replies. Thank you!

Seeing several ways to accomplish this makes me slightly embarrassed I couldn’t figure it out. But, I’ve learned a lot from each of your approaches.
One aspect common to each solution is the intermediate step. The DXF file does not import and transformer into copper directly. It must be converted, traced etc. Or, alternatively, the graphic can be created directly in Kicad footprint editor. Or even Inkscape, for that matter. I’m resetting my mindset on this. I’m so CAD-centric for creating anything with finite measurements that my instinct is to start there.

Another detail to note: the use of line weights on import. I didn’t know it could be set to 0.000

I clearly need to spend some time using FreeCAD and StepUp. I’ve only used it to align 3D stuff so far.
Creating my typical way and allowing SU to translate that into KiCAD should be best for my CAD brain.

Question: once pads are created, I assume they are assigned to F.cu and F.mask? In this application, I need a front mask that is an arc exposing the entire array of pads. So the wiper contact doesn’t drag across the mask. I have this geometry created and imported already. I guess I will just un-assign the pads from F.mask

Regarding DXF handling and possible future features: as mentioned earlier in this thread, it really seems like a moving target with the file type. Just in Inventor I have 2 pages with of options upon export. Including compatibility with versions of AutoCAD. If they can’t standardize the file for their own software, it seems haphazard at best.
I thought for sure I had it sorted when I edited each trapezoid into an object with just 4 nodes. But, exporting that as a BMP created a huge file, still with awful resolution. Exporting to SVG didn’t solve anything that I can recall.

As for features: I’m probably an outlier in the way I use KiCAD. I use very few stock footprints. All of my designs get beefed up pads, spacing for high voltage/current etc. My work is as much mechanical design as electrical and those disciplines have to coexist. Especially so when I have to provide fab sheets, wiring diagrams, prints for service manuals and so on.
One thing I hope to achieve skills-wise, is to take an old pc board from something I’m restoring, scan it, trace the traces and pads, improve design flaws and recreate it as a replacement board. Surely this would be simple for you guys. I’ve almost honed my Corel skills enough to trace something and edit the nodes into the right shape. I’ll keep working at it…

If I can submit files and/or contribute in any way, by all means sign me up! When I created the topic, I wasn’t implying KiCAD has an issue. Rather that I didn’t know the correct workflow to accomplish what I needed.

Thanks sincerely again. I’ll be back to discuss how to override the clearance errors on those trapezoid pads.

VG

2 Likes

FYI, your forum trust level has been raised to 2, you can try attaching a file or image directly here.

3 Likes

You can leave the pads as it is and just create a filled zone in the F.Mask (or B.Mask as desired) with the desired shape, take a look at the demo file “footprint-RF-antenna-w-solder-Mask” from the KSU workbench (ksu Tools → Demo)

1 Like

In KiCad, a “pad” has everything that defines a connection between a copper track and an IC pin.
A pad can have parts on all layers (for example a THT pad that has a hole and also connects to all inner layers on a multi layer PCB). Each pad can also have items on the solder mask, solder paste and other technical layers.

Here is a screenshot of the Pad Properties, as shown in the Pcb Editor:

KiCad does have a limitation at the moment that the pad has the same shape on all technical layers (if enabled). There are some extra’s. the pad on internal copper layers can be turned off, andif you go to the tab page with Clearance Overrides and Settings, you can modify some of the clearances. You can for example make the cutout in the solder mask a bit bigger, and if your pads are close enough together, then there will be no solder mask between your pads at all.

If you do want to make the solder mask as a separate item. Importing as graphics on the solder mask layer probably works (Generate the Gerber files and check those, because that is what will be sent to be manufactured). Another way to do it is to define an “aperture pad”. These are pads that do not have any copper (so all copper layers are turned off, and these also do not have a pin number (because they can not be connected to a pin).

1 Like

Thanks all for the instruction. I’m working through it. I managed to trace the pads and create an array as in paulvdh’s example. Changing line thickness has taken some trial and error. Too thick and the clearance between pads is too small.

I’m also trying to get going in FreeCAD as per der.ule’s example. It’s slow going because I’m learning my around FreeCAD and learning what the icons represent.

A few questions on that approach:

Did you “combine” each group of geometry to a “shape”? Seems like you would have to before they could be renamed to “Pads_Poly_Arc_pad#”.

when you create the small circles inside each trapezoid, which constraints did you use to center the circle. I had mixed results. Or, did you not constrain the circle to the center of the trap?

Lastly, your result appears to be rotated about 10 degrees clockwise. About one pad size offset.

Once the pads are realized and imported into Footprint editor, I am able to assign to F.CU, add a small SMD pad, edit to include the polygone shape and so on. Progress!

Now I have a footprint with the array of pads. I have another footprint with the edge cuts, mask and other F.cu elements. Can these footprints be merged? I didn’t find a solution for this here or on youtube. Can I copy elements from one footprint and paste into another? I’ll try this next.

Finally, my pcb requires an 8mm hole. I added a NPTH pad at the correct location, set the pad size and hole size to 8mm and unchecked all non-copper layers. The result in 3D viewer is a hole. But, a green layer remains across the hole. Not on top or bottom.

I’ll try to identify which geometry on which layer is causing this. Sorry I can’t show the entire board, this is private project.

I still think clearance is going to be a deal-breaker on those pads. But it’s nice to see progress on this.