Iâm not sure if I provided a link to the simple code I wrote to place the modules around a circleâŚ
I have not re-visited the code since the last time I used it - you know how it goes, out of sight, out of mind but it works pretty well at the moment and is an upgrade from the previous version which used a hard-coded array list in which I set the positions and orientation from an Excel spreadsheet.
An SMD pad is the only thing that would give you a circular copper fill. The reason KiCad doesnât do a circular fill is that the fill regions are defined by a polygon. I would prefer to use a âclosed loopâ to describe the region and that loop can be any number of shaped segments joined end-to-end; a circle would be a case of a single segment defining a closed loop. The next best thing it to at least model the region like DXFâs âPolyLineâ which is essentially a loop consisting of arcs and line segments; in that case a circle can be modeled with two arcs. Unfortunately itâs a pretty big task to make those modifications and to ensure that the Gerbers come out right.
On that subject⌠I donât know if it would solve anything - approximation by straight segments is pretty good - but I would propose an adaptive method.
One can define number of segments per 360deg at the moment⌠choices are 16 and 32.
For small radii this is sufficient, but for large radii the segments become visible and in the case of large circular outlines the difference between the arcs for the outline and the finite segments for the zone edge becomes pretty obvious.
Is there a cheap and fast way to define a max length for segments and the algorithm then just adds more to a large radius approximation while it is creating the zone outline? So instead of the one-and-all solution 16/32 that is used everywhere it would increase the segment count for larger radii when segment lengths go over a certain threshold (until they are under the threshold again)?
I can help myself by creating me a zone outline via script that uses a higher number of segments for the loop, so I can deal with it, no problem - just thought I share the idea in case itâs a low hanging fruit: No arcs etc. needed, no risk for gerber creation, âjustâ modify the segment creation algorithm to adjust the 16/32 setting on the fly to whatever is needed to stay with the segment length under a (user settable?) threshold.
In part the problem is due to various poor assumptions and dubious sharing of code. No one would ever want more than 32 segments to describe a circle, would they? A better test in most cases is to impose a maximum deviation from the arc/circle, and there are a few calculations like that in various places in the code. The actual requirements for different uses of similar code can vary quite a bit. For example, modeling a 5cm diameter circular board using 32 straight segments is definitely not acceptable; however for 3D visual modeling itâs probably fine in many situations unless you have features near the board edge.
Iâm sure we can fix a lot of these issues by changing the various bits of code which do these calculations so that itâs all done consistently and in such a way that some code such as the 3D visualization which can quite happily trade off precision can easily override parameters. Unfortunately there are quite a few places in code which would require some change, but if anyone has the time it can certainly be done without too great a hassle.
Iâm trying to have circular boards+mouse bites+internal cuts without having the 3D viewer complaining about non-contiguous polygons. Has anyone succeeded on placing the mouse bites (i.e https://github.com/madworm/Panelization.pretty) while having Edge.Cuts not being perfectly aligned for each segment?
Iâve tried drawing a circle in the middle and adding the mousebites later, but then the middle board is gone and Iâm left with castellated mouse bites.
Then I tried drawing partial arcs in the center, interspersed with mouse bites every few degrees, but then the 3D viewer complains
Any good hints? Thanks for this interesting thread!
For complicated pcb outlines you need a CAD tool that can export DXF that is understood by KiCAD.
I wouldnât try to do any panels/sub-boards other than rectangular ones with KiCAD really.
The offending spot is around this area, right near the mousebites lower hole, but I suspect that this is a more general issue since I cannot see any obvious mistake here:
When I dealt with this type of error in the past with simpler boards it was always a case of Edge.Cuts lines not closing/overlapping properly⌠since this is a continuous generated .dxf file, that doesnât seem to be the case since it should be closed already (not manually drawn).
Iâm having a look now at KiCadâs 3DViewer function to see what it actually does before erroring out and how I could potentially write a test for this:
I guess if I am not doing the posting I shouldnât care, but people seem to be happy to spend a lot of time trying to compare and I get confused trying to follow it, so I wonder how newbies manage.
The nightly builds are getting on for 2 years worth more advanced than the stable release, that is a lot of changes. In particular, the 3D stuff has seen a lot of improvements.
So yeah, there are several bugs in stable that are fixed in nightly buildsâŚ
No worries @bobc, I just gave it a shot to nightly for OSX from June the 12th (UI looks great, btw!) and hereâs the result (same error yet cleaner, less verbose):
So the problem is somewhere else, not in the DXFâs themselves, strange ⌠Iâll play a bit now with the copper layer and footprint placement but Iâm a bit out of ideas on what might be the issue here.
Donât worry @bobc, the dxf comes from inventor and worked in stables before.
I just mentioned the version as @brainstorm is on a mac, which might have been a contributing factor.
Interesting. Maybe a forgotten, nearly zero length outlineâŚ
Anyhow, youâll nail the bugger Good luck.
Ok, cool⌠never mind me⌠too much/too little coffee this morning
FWIW, I tried an Openscad DXF like @brainstorm and @Joan_Sparkyâs brainstorm.dxf, and they both load and view OK in 4.0.6. I might look into what is going on with the mouse bites. I would like to add mousebites to gerbmerge, ultimately it would be good to get these sort of panelisation scripts working in pcbnew.
BTW, very cool idea using OpenScad to generate DXF files, I always associate OpenSCAD with 3d stuff!
I tried to do something similar with the mousebites from madworm and a DXF generated by OpenSCAD, I didnât run into any issues. Came out quite nice. It was a very simple example though, perhaps the issue lies elsewhere.
Ok, would have helped if weâd known that earlierâŚAs I expected, those mousebites contain lines on Edge.Cuts, where madwormâs do not. Lines on Edge.Cuts in a module must join exactly with lines drawn on the PCB, otherwise you get the errors.