Error: Board has malformed outline (not a closed shape)

I would like to produce a 3D view of a board with a complex outline, but I get multiple errors of the type above. I have moved the end of each line segment to snap to the green node symbol on the end of the adjacent line segment and checked that the coordinates match, but still get the same error.

There are many such errors on the edge cuts shape preventing a 3D image from being produced.

Is there a reliable way of making line segments contiguous?

KiCad’s mechanical drawing capabilities are … a bit lagging behind and not a high priority.

You do have an option to import a .DXF file made with some external program (maybe .SVG import works too).

In FreeCAD, there is also the KiCad Stepup workbench for exchanging data between KiCad and FreeCAD, it is quite powerful, but learning FreeCAD is quite an endeavor on itself.

1 Like

Is there a reliable way of making line segments contiguous?

1 Like

I tried exporting the outline to 2 CAD drawing packages, but just like in KiCad, everything looks hunky dory, but without the DRC to point to where the ‘misalignments’ are.

Even setting line width to hairline and zooming in to the max, there’s no apparent problem.

The board outline is extremely complex, with perhaps 1,000 line segments. Curves are made with line segments, so the grid cannot be too coarse. The outline was contiguous in V4 and V5, but somehow got corrupted in V6.
Nowhere in the outline can a rectangle be used.
I’m using V6.
A handy feature would be a command that closes outlines on the Edge cuts layer, joing line ends that are closer to each other than x mm. Not very useful for rectangular outlines, but invaluable for complex ones.

would you mind to post the pcb (eventually with only the edge) or the dwg source for the outline? i.e. dxf or svg

1 Like

I’ve put the Edge cuts Gerber file and the svg file here KiCad - Google Drive
Snapping one line end to the grid, then the other line end, still gives the ‘malformed’ error for that junction.

your file has a lot of overlapped segments…
the best IMO is to ‘clean’ the drawing with a mechanical software… i.e. FreeCAD

here a possible solution after a fast cleaning
outine-from-gbr.kicad_pcb (196.6 KB)

4 Likes

The SVG contains many segments which are not connected together. So the 3D-viewer and the DRC are right - it’s no continous outline.

Additional there are the 3x fiducials/passer-marks outside from the shape - these also disturb the edge.cuts algorithm.

My workflow would be:

  • import into QCAD (my preferred 2D-CAD-tool)
  • change linewidth for all items to 0.000mm
  • select all
  • draw–>polyline–>draw polyline from selection

This runs a algorithm similar to your request above (“A handy feature would be a command that closes outlines on the Edge cuts layer, joing line ends that are closer to each other than x mm”.) The result is not always 100% right, sometimes manually additional cealing is required. This shows that such an algorithm is not so simple as it looks.

At last exporting as dxf, prefereed in an older dxf-format (to avoid spline/arc problems in kicad import).

edit:

@maui : nice work

7 Likes

Wow, that really did the job a lot faster than I could have done it manually (if at all!).
Thanks for the work you put into that and for the useful advice for the future.

Thank you for your reply and for the alternative technique. This is useful information which will save me a lot of time and frustration.
I’ll have a play with yours and Maui’s methods.

I opened your file, exported the Edge cuts layer as svg, then imported the svg file into the Edge cuts layer of my design, but the result had no straight lines, only closed arc segments corresponding to the arcs in the original. Importing then exporting to my drawing package, CorelDraw, made no difference.

What did work for me was prompted by mf_ibfeew’s suggestion of converting to a polyline, but since CorelDraw’s version of a polyline is made up of Bezier curves, what I did instead was export the shape as an HPGL .plt file, a format which was developed originally for flatbed plotters.

Importing that file worked beautifully.

Thanks to both of you.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.