I want to place equally-spaced vias in kicad at the edge of the board. The edge of the board is a sketch exported from FreeCAD as a dxf file.
Given a closed sketch, how do I 2-d offset this curve, and from this offset curve equally sample x points and export them to csv/[any text] (to be read by KiCAD scripting)
To illustrate the problem in the trivial case for a line joining [-5,0] and [5,0], I would export this array:
Code: Select all
numberofvias=10
np.linspace(-5,5,num=numberofvias)
Code: Select all
OS: Ubuntu 20.04.4 LTS (XFCE/xubuntu)
Word size of FreeCAD: 64-bit
Version: 0.20.
Build type: Release
Branch: unknown
Python 3.8.10, Qt 5.12.8, Coin 4.0.0, Vtk 7.1.1, OCC 7.5.2
Locale: English/United States (en_US)
Installed mods:
* Assembly4 0.12.0
* fasteners 0.3.44
* sheetmetal 0.2.49
* Defeaturing
* Lithophane
* Curves 0.4.4
* Behave-Dark-Colors 0.0.1
* Assembly3 0.11.3
* kicadStepUpMod 10.13.0
* PieMenu
* ProDarkThemePreferencePack 1.0.0
Code: Select all
doc = App.getDocument("samplesketch")
orignalsketch=doc.getObjectsByLabel("Outline")
doc.addObject("Part::Offset2D","Offset2D")
doc.Offset2D.Source = orignalsketch[0]
doc.Offset2D.Value = -1
doc.recompute()
noofvias=100
doc.OfsetCurve.shape.discretize(Number=noofvias) # Throws an error here
References:
[1]: https://forum.freecadweb.org/viewtopic. ... ch#p234937
[2]: https://forum.freecadweb.org/viewtopic.php?t=7316