PCB design using code instead of clicking a mouse?Modular PCB DesignWhat are the important design considerations when laying out a PCB?Software to design a 2-sided PCB with discrete componentsSoftware to translate code description to PCB design?PCB in circuit tester designDesign a PCB using Kapton filmSchematic and PCB Design From ScratchWhat's the proper track to learning PCB Design?PCB Design VerificationWorthwhile to create some 'building block' PCB instead of handsoldering?
On what tickets or flights are Flying Blue XP earned?
What is a good example for artistic ND filter applications?
How can Paypal know my card is being used in another account?
What are the closest international airports in different countries?
What clothes would flying-people wear?
Rampant sharing of authorship among colleagues in the name of "collaboration". Is not taking part in it a death knell for a future in academia?
Complaints from (junior) developers against solution architects: how can we show the benefits of our work and improve relationships?
Embedded C - Most elegant way to insert a delay
Little Lost Robot
How to prevent a single-element caster from being useless against immune foes?
Why would anyone ever invest in a cash-only etf?
Can you continue the movement of a Bonus Action Dash granted by Expeditious Retreat if your Concentration is broken mid-move?
Are all French verb conjugation tenses and moods practical and efficient?
Find all the numbers in one file that are not in another file in python
Is there a word to describe someone who is, or the state of being, content with hanging around others without interacting with them?
"DDoouubbllee ssppeeaakk!!"
How can flights operated by the same company have such different prices when marketed by another?
My employer is refusing to give me the pay that was advertised after an internal job move
Why did I lose on time with 3 pawns vs Knight. Shouldn't it be a draw?
Can a US President, after impeachment and removal, be re-elected or re-appointed?
Why is this photograph shot with Delta 400 and developed with D76 1+1 so grainy
What were the first chips with hardware support for SPI?
Is it possible for a particle to decay via gravity?
Why put copper in between battery contacts and clamps?
PCB design using code instead of clicking a mouse?
Modular PCB DesignWhat are the important design considerations when laying out a PCB?Software to design a 2-sided PCB with discrete componentsSoftware to translate code description to PCB design?PCB in circuit tester designDesign a PCB using Kapton filmSchematic and PCB Design From ScratchWhat's the proper track to learning PCB Design?PCB Design VerificationWorthwhile to create some 'building block' PCB instead of handsoldering?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
$begingroup$
I'm just getting into PCB design and I generally have trouble learning how to use GUIs with menus and mouse clicking. Do some engineers use something more like code to generate PCBs?
pcb eda
$endgroup$
|
show 1 more comment
$begingroup$
I'm just getting into PCB design and I generally have trouble learning how to use GUIs with menus and mouse clicking. Do some engineers use something more like code to generate PCBs?
pcb eda
$endgroup$
2
$begingroup$
I wouldn't recommend writing plain gerber files...
$endgroup$
– Huisman
8 hours ago
11
$begingroup$
PCB layout is mostly a visual task - moving and rotating stuff to make it fit. Doing it by code sounds painful.
$endgroup$
– JRE
8 hours ago
1
$begingroup$
There are usually hot keys for most (if not all) menu items; most tools allow text input for location and orientation (but it is a lot more painful to do that than just move things with a mouse). I use the text tools to get precise placement of things like vias and differential pairs.
$endgroup$
– Peter Smith
8 hours ago
1
$begingroup$
Some CAD packages are more clicky than others. In my experience, Orcad Allegro is the worst for making you go through a lot of pointless GUI actions to get the simplest things done. Diptrace is pretty much the easiest and most fluid user experience. PADS is a very nice toolchain with an intuitive UI and a lot of high-end features. PADS is for engineers who like to get things done, Orcad is for masochists. :D
$endgroup$
– Wossname
8 hours ago
1
$begingroup$
There are keyboard shortcuts and unique cases where programmatic generation of patterns make sense, but PCB layout is mostly an interactive graphical task. In contrast situations where the logic dominates over the physical embodiment like FPGA and (many parts of) ASIC design typically are driven by hardware description languages feeding logic compilers feeding automated place & route tools. If we were still building mainframe processors from big boards full of TTL there might be a comparable design flow for HDL to PCB... but fortunately we aren't.
$endgroup$
– Chris Stratton
7 hours ago
|
show 1 more comment
$begingroup$
I'm just getting into PCB design and I generally have trouble learning how to use GUIs with menus and mouse clicking. Do some engineers use something more like code to generate PCBs?
pcb eda
$endgroup$
I'm just getting into PCB design and I generally have trouble learning how to use GUIs with menus and mouse clicking. Do some engineers use something more like code to generate PCBs?
pcb eda
pcb eda
asked 8 hours ago
guidoismguidoism
1274 bronze badges
1274 bronze badges
2
$begingroup$
I wouldn't recommend writing plain gerber files...
$endgroup$
– Huisman
8 hours ago
11
$begingroup$
PCB layout is mostly a visual task - moving and rotating stuff to make it fit. Doing it by code sounds painful.
$endgroup$
– JRE
8 hours ago
1
$begingroup$
There are usually hot keys for most (if not all) menu items; most tools allow text input for location and orientation (but it is a lot more painful to do that than just move things with a mouse). I use the text tools to get precise placement of things like vias and differential pairs.
$endgroup$
– Peter Smith
8 hours ago
1
$begingroup$
Some CAD packages are more clicky than others. In my experience, Orcad Allegro is the worst for making you go through a lot of pointless GUI actions to get the simplest things done. Diptrace is pretty much the easiest and most fluid user experience. PADS is a very nice toolchain with an intuitive UI and a lot of high-end features. PADS is for engineers who like to get things done, Orcad is for masochists. :D
$endgroup$
– Wossname
8 hours ago
1
$begingroup$
There are keyboard shortcuts and unique cases where programmatic generation of patterns make sense, but PCB layout is mostly an interactive graphical task. In contrast situations where the logic dominates over the physical embodiment like FPGA and (many parts of) ASIC design typically are driven by hardware description languages feeding logic compilers feeding automated place & route tools. If we were still building mainframe processors from big boards full of TTL there might be a comparable design flow for HDL to PCB... but fortunately we aren't.
$endgroup$
– Chris Stratton
7 hours ago
|
show 1 more comment
2
$begingroup$
I wouldn't recommend writing plain gerber files...
$endgroup$
– Huisman
8 hours ago
11
$begingroup$
PCB layout is mostly a visual task - moving and rotating stuff to make it fit. Doing it by code sounds painful.
$endgroup$
– JRE
8 hours ago
1
$begingroup$
There are usually hot keys for most (if not all) menu items; most tools allow text input for location and orientation (but it is a lot more painful to do that than just move things with a mouse). I use the text tools to get precise placement of things like vias and differential pairs.
$endgroup$
– Peter Smith
8 hours ago
1
$begingroup$
Some CAD packages are more clicky than others. In my experience, Orcad Allegro is the worst for making you go through a lot of pointless GUI actions to get the simplest things done. Diptrace is pretty much the easiest and most fluid user experience. PADS is a very nice toolchain with an intuitive UI and a lot of high-end features. PADS is for engineers who like to get things done, Orcad is for masochists. :D
$endgroup$
– Wossname
8 hours ago
1
$begingroup$
There are keyboard shortcuts and unique cases where programmatic generation of patterns make sense, but PCB layout is mostly an interactive graphical task. In contrast situations where the logic dominates over the physical embodiment like FPGA and (many parts of) ASIC design typically are driven by hardware description languages feeding logic compilers feeding automated place & route tools. If we were still building mainframe processors from big boards full of TTL there might be a comparable design flow for HDL to PCB... but fortunately we aren't.
$endgroup$
– Chris Stratton
7 hours ago
2
2
$begingroup$
I wouldn't recommend writing plain gerber files...
$endgroup$
– Huisman
8 hours ago
$begingroup$
I wouldn't recommend writing plain gerber files...
$endgroup$
– Huisman
8 hours ago
11
11
$begingroup$
PCB layout is mostly a visual task - moving and rotating stuff to make it fit. Doing it by code sounds painful.
$endgroup$
– JRE
8 hours ago
$begingroup$
PCB layout is mostly a visual task - moving and rotating stuff to make it fit. Doing it by code sounds painful.
$endgroup$
– JRE
8 hours ago
1
1
$begingroup$
There are usually hot keys for most (if not all) menu items; most tools allow text input for location and orientation (but it is a lot more painful to do that than just move things with a mouse). I use the text tools to get precise placement of things like vias and differential pairs.
$endgroup$
– Peter Smith
8 hours ago
$begingroup$
There are usually hot keys for most (if not all) menu items; most tools allow text input for location and orientation (but it is a lot more painful to do that than just move things with a mouse). I use the text tools to get precise placement of things like vias and differential pairs.
$endgroup$
– Peter Smith
8 hours ago
1
1
$begingroup$
Some CAD packages are more clicky than others. In my experience, Orcad Allegro is the worst for making you go through a lot of pointless GUI actions to get the simplest things done. Diptrace is pretty much the easiest and most fluid user experience. PADS is a very nice toolchain with an intuitive UI and a lot of high-end features. PADS is for engineers who like to get things done, Orcad is for masochists. :D
$endgroup$
– Wossname
8 hours ago
$begingroup$
Some CAD packages are more clicky than others. In my experience, Orcad Allegro is the worst for making you go through a lot of pointless GUI actions to get the simplest things done. Diptrace is pretty much the easiest and most fluid user experience. PADS is a very nice toolchain with an intuitive UI and a lot of high-end features. PADS is for engineers who like to get things done, Orcad is for masochists. :D
$endgroup$
– Wossname
8 hours ago
1
1
$begingroup$
There are keyboard shortcuts and unique cases where programmatic generation of patterns make sense, but PCB layout is mostly an interactive graphical task. In contrast situations where the logic dominates over the physical embodiment like FPGA and (many parts of) ASIC design typically are driven by hardware description languages feeding logic compilers feeding automated place & route tools. If we were still building mainframe processors from big boards full of TTL there might be a comparable design flow for HDL to PCB... but fortunately we aren't.
$endgroup$
– Chris Stratton
7 hours ago
$begingroup$
There are keyboard shortcuts and unique cases where programmatic generation of patterns make sense, but PCB layout is mostly an interactive graphical task. In contrast situations where the logic dominates over the physical embodiment like FPGA and (many parts of) ASIC design typically are driven by hardware description languages feeding logic compilers feeding automated place & route tools. If we were still building mainframe processors from big boards full of TTL there might be a comparable design flow for HDL to PCB... but fortunately we aren't.
$endgroup$
– Chris Stratton
7 hours ago
|
show 1 more comment
4 Answers
4
active
oldest
votes
$begingroup$
Altium has a scripting language, several different languages, in fact. In some cases it may make sense to use algorithms, for example to create repetitive layouts or parts placed precisely in certain positions.
For example, I've seen it used to place parts (LEDs) in a circular pattern, though with their introduction of polar coordinate snap grids that's much less likely to be worth the hassles.
We've used algorithms to create shapes (think antennas and that kind of thing) directly in .dxf format which can then be imported into a copper layer.
In general, code is poorly suited for PCB layout purposes, particularly so for the routing task.
$endgroup$
add a comment |
$begingroup$
In EAGLE CAD, everything you can do with a mouse you can do from the command line. It also has a user language that you can essentially program in.
$endgroup$
$begingroup$
Very useful when doing patterns, etc. Even if you do 99% of the layout manually you can still arrange parts/features with code.
$endgroup$
– Wesley Lee
6 hours ago
$begingroup$
Often, I code in Matlab or a text processor to output scripting language.
$endgroup$
– Scott Seidman
6 hours ago
1
$begingroup$
Yes! I used to do it in Python :)
$endgroup$
– Wesley Lee
5 hours ago
add a comment |
$begingroup$
I wouldn't recommend it, but if you really desire you can write PCB artwork yourself, without any PCB program. The code looks like this:
G90*
1 G70*
2 G54D10*
3 G01X0Y0D02*
4 X450Y330D01*
5 X455Y300D03*
6 G54D11*
7 Y250D03*
8 Y200D03*
9 Y150D03*
10 X0Y0D02*
11 M02*
12
The line numbers at far right are not part of the file. Examining this
file without any prior knowledge of Gerber one would correctly deduce
that each line represents a particular machine command and that the
asterisk (*) is the end of command character. There seems to be
different kinds of commands: instructions beginning with G, D, M and
x,y coordinate data.
Source: https://www.artwork.com/gerber/appl2.htm
Here is a spec that shows the different commands
$endgroup$
1
$begingroup$
Gerber (RS-274X) is related to the G-code (RS-274) files used in CNC programming. I do sometimes write G-code directly with a text editor for simple 2.5D tasks.
$endgroup$
– Spehro Pefhany
6 hours ago
$begingroup$
Just an observation: if you are direct coding gerbers, then there is no design rule check taking place other than you visualizing in your head. I can't imagine typing out a text gerber file, sending it to fab house without ever opening the file in a GUI tool at just looking at it, unless you are a next level savant of some sort.
$endgroup$
– mkeith
6 hours ago
$begingroup$
I wasn't sure if Gerber was related to G-code, but I had a suspicion. If one needed to write a simple top layer for an antenna or filter it might not be too bad to code something up yourself. I've only edited G-code, but never tried to write it.
$endgroup$
– Voltage Spike
6 hours ago
$begingroup$
@mkeith some people are visual, some people learn otherwise. I can't imagine not checking with a gerber layer tool or something like that, but for some people it might be easier to look at the code.
$endgroup$
– Voltage Spike
6 hours ago
4
$begingroup$
Anyone who can work better with G-code than a visual tool of some sort for a complex board would definitely be an exceptional person. Anyone who can work directly in G-code and be productive would have to be considered a savant, I think.
$endgroup$
– mkeith
6 hours ago
|
show 1 more comment
$begingroup$
I use code to generate the netlist for my PCBs. (It's far, far quicker to write a for-loop to build an N-bit multiplexer than to laboriously draw all that stuff in a schematic.) Fortunately, KiCAD netlist files are just text, in a format that's undocumented but reasonably easy to reverse-engineer.
I wrote a small C# library that lets me type in what I want connected to what (in terms of reusable parametric blocks of circuitry), and it automatically spits out a netlist. Now I can just import that straight into KiCAD and start building the PCB, without having to waste an hour or so uselessly drawing a schematic for it. (The library even does some very basic checks to ensure my instructions aren't completely bogus, although I suspect KiCAD itself would do that job better.)
KiCAD PCB files, on the other hand, are also text, but appear to be far too complex to generate programmatically. Which is a shame, because KiCAD defaults to dumping all the components directly on top of each other, requiring me to spend 20+ minutes tediously separating them out again so I can see what the hell I'm doing. (KiCAD has a nasty habit of trying to move the text rather than the component it's attached to, presumably just to make PCBs harder to design?)
Perhaps some day I'll manage to also automate the initial component layout; I suspect, as others have said, that the actual "PCB design" bit will always involve the GUI though.
$endgroup$
$begingroup$
It would be nice to hook one of graphviz's layout engines up to KiCAD for the initial placement. I've used graphviz to make LTspice files for very simple layouts and it worked reasonably well.
$endgroup$
– pipe
5 hours ago
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
return StackExchange.using("schematics", function ()
StackExchange.schematics.init();
);
, "cicuitlab");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "135"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2felectronics.stackexchange.com%2fquestions%2f451003%2fpcb-design-using-code-instead-of-clicking-a-mouse%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
Altium has a scripting language, several different languages, in fact. In some cases it may make sense to use algorithms, for example to create repetitive layouts or parts placed precisely in certain positions.
For example, I've seen it used to place parts (LEDs) in a circular pattern, though with their introduction of polar coordinate snap grids that's much less likely to be worth the hassles.
We've used algorithms to create shapes (think antennas and that kind of thing) directly in .dxf format which can then be imported into a copper layer.
In general, code is poorly suited for PCB layout purposes, particularly so for the routing task.
$endgroup$
add a comment |
$begingroup$
Altium has a scripting language, several different languages, in fact. In some cases it may make sense to use algorithms, for example to create repetitive layouts or parts placed precisely in certain positions.
For example, I've seen it used to place parts (LEDs) in a circular pattern, though with their introduction of polar coordinate snap grids that's much less likely to be worth the hassles.
We've used algorithms to create shapes (think antennas and that kind of thing) directly in .dxf format which can then be imported into a copper layer.
In general, code is poorly suited for PCB layout purposes, particularly so for the routing task.
$endgroup$
add a comment |
$begingroup$
Altium has a scripting language, several different languages, in fact. In some cases it may make sense to use algorithms, for example to create repetitive layouts or parts placed precisely in certain positions.
For example, I've seen it used to place parts (LEDs) in a circular pattern, though with their introduction of polar coordinate snap grids that's much less likely to be worth the hassles.
We've used algorithms to create shapes (think antennas and that kind of thing) directly in .dxf format which can then be imported into a copper layer.
In general, code is poorly suited for PCB layout purposes, particularly so for the routing task.
$endgroup$
Altium has a scripting language, several different languages, in fact. In some cases it may make sense to use algorithms, for example to create repetitive layouts or parts placed precisely in certain positions.
For example, I've seen it used to place parts (LEDs) in a circular pattern, though with their introduction of polar coordinate snap grids that's much less likely to be worth the hassles.
We've used algorithms to create shapes (think antennas and that kind of thing) directly in .dxf format which can then be imported into a copper layer.
In general, code is poorly suited for PCB layout purposes, particularly so for the routing task.
edited 7 hours ago
answered 8 hours ago
Spehro PefhanySpehro Pefhany
220k5 gold badges175 silver badges455 bronze badges
220k5 gold badges175 silver badges455 bronze badges
add a comment |
add a comment |
$begingroup$
In EAGLE CAD, everything you can do with a mouse you can do from the command line. It also has a user language that you can essentially program in.
$endgroup$
$begingroup$
Very useful when doing patterns, etc. Even if you do 99% of the layout manually you can still arrange parts/features with code.
$endgroup$
– Wesley Lee
6 hours ago
$begingroup$
Often, I code in Matlab or a text processor to output scripting language.
$endgroup$
– Scott Seidman
6 hours ago
1
$begingroup$
Yes! I used to do it in Python :)
$endgroup$
– Wesley Lee
5 hours ago
add a comment |
$begingroup$
In EAGLE CAD, everything you can do with a mouse you can do from the command line. It also has a user language that you can essentially program in.
$endgroup$
$begingroup$
Very useful when doing patterns, etc. Even if you do 99% of the layout manually you can still arrange parts/features with code.
$endgroup$
– Wesley Lee
6 hours ago
$begingroup$
Often, I code in Matlab or a text processor to output scripting language.
$endgroup$
– Scott Seidman
6 hours ago
1
$begingroup$
Yes! I used to do it in Python :)
$endgroup$
– Wesley Lee
5 hours ago
add a comment |
$begingroup$
In EAGLE CAD, everything you can do with a mouse you can do from the command line. It also has a user language that you can essentially program in.
$endgroup$
In EAGLE CAD, everything you can do with a mouse you can do from the command line. It also has a user language that you can essentially program in.
answered 8 hours ago
Scott SeidmanScott Seidman
23.7k4 gold badges32 silver badges92 bronze badges
23.7k4 gold badges32 silver badges92 bronze badges
$begingroup$
Very useful when doing patterns, etc. Even if you do 99% of the layout manually you can still arrange parts/features with code.
$endgroup$
– Wesley Lee
6 hours ago
$begingroup$
Often, I code in Matlab or a text processor to output scripting language.
$endgroup$
– Scott Seidman
6 hours ago
1
$begingroup$
Yes! I used to do it in Python :)
$endgroup$
– Wesley Lee
5 hours ago
add a comment |
$begingroup$
Very useful when doing patterns, etc. Even if you do 99% of the layout manually you can still arrange parts/features with code.
$endgroup$
– Wesley Lee
6 hours ago
$begingroup$
Often, I code in Matlab or a text processor to output scripting language.
$endgroup$
– Scott Seidman
6 hours ago
1
$begingroup$
Yes! I used to do it in Python :)
$endgroup$
– Wesley Lee
5 hours ago
$begingroup$
Very useful when doing patterns, etc. Even if you do 99% of the layout manually you can still arrange parts/features with code.
$endgroup$
– Wesley Lee
6 hours ago
$begingroup$
Very useful when doing patterns, etc. Even if you do 99% of the layout manually you can still arrange parts/features with code.
$endgroup$
– Wesley Lee
6 hours ago
$begingroup$
Often, I code in Matlab or a text processor to output scripting language.
$endgroup$
– Scott Seidman
6 hours ago
$begingroup$
Often, I code in Matlab or a text processor to output scripting language.
$endgroup$
– Scott Seidman
6 hours ago
1
1
$begingroup$
Yes! I used to do it in Python :)
$endgroup$
– Wesley Lee
5 hours ago
$begingroup$
Yes! I used to do it in Python :)
$endgroup$
– Wesley Lee
5 hours ago
add a comment |
$begingroup$
I wouldn't recommend it, but if you really desire you can write PCB artwork yourself, without any PCB program. The code looks like this:
G90*
1 G70*
2 G54D10*
3 G01X0Y0D02*
4 X450Y330D01*
5 X455Y300D03*
6 G54D11*
7 Y250D03*
8 Y200D03*
9 Y150D03*
10 X0Y0D02*
11 M02*
12
The line numbers at far right are not part of the file. Examining this
file without any prior knowledge of Gerber one would correctly deduce
that each line represents a particular machine command and that the
asterisk (*) is the end of command character. There seems to be
different kinds of commands: instructions beginning with G, D, M and
x,y coordinate data.
Source: https://www.artwork.com/gerber/appl2.htm
Here is a spec that shows the different commands
$endgroup$
1
$begingroup$
Gerber (RS-274X) is related to the G-code (RS-274) files used in CNC programming. I do sometimes write G-code directly with a text editor for simple 2.5D tasks.
$endgroup$
– Spehro Pefhany
6 hours ago
$begingroup$
Just an observation: if you are direct coding gerbers, then there is no design rule check taking place other than you visualizing in your head. I can't imagine typing out a text gerber file, sending it to fab house without ever opening the file in a GUI tool at just looking at it, unless you are a next level savant of some sort.
$endgroup$
– mkeith
6 hours ago
$begingroup$
I wasn't sure if Gerber was related to G-code, but I had a suspicion. If one needed to write a simple top layer for an antenna or filter it might not be too bad to code something up yourself. I've only edited G-code, but never tried to write it.
$endgroup$
– Voltage Spike
6 hours ago
$begingroup$
@mkeith some people are visual, some people learn otherwise. I can't imagine not checking with a gerber layer tool or something like that, but for some people it might be easier to look at the code.
$endgroup$
– Voltage Spike
6 hours ago
4
$begingroup$
Anyone who can work better with G-code than a visual tool of some sort for a complex board would definitely be an exceptional person. Anyone who can work directly in G-code and be productive would have to be considered a savant, I think.
$endgroup$
– mkeith
6 hours ago
|
show 1 more comment
$begingroup$
I wouldn't recommend it, but if you really desire you can write PCB artwork yourself, without any PCB program. The code looks like this:
G90*
1 G70*
2 G54D10*
3 G01X0Y0D02*
4 X450Y330D01*
5 X455Y300D03*
6 G54D11*
7 Y250D03*
8 Y200D03*
9 Y150D03*
10 X0Y0D02*
11 M02*
12
The line numbers at far right are not part of the file. Examining this
file without any prior knowledge of Gerber one would correctly deduce
that each line represents a particular machine command and that the
asterisk (*) is the end of command character. There seems to be
different kinds of commands: instructions beginning with G, D, M and
x,y coordinate data.
Source: https://www.artwork.com/gerber/appl2.htm
Here is a spec that shows the different commands
$endgroup$
1
$begingroup$
Gerber (RS-274X) is related to the G-code (RS-274) files used in CNC programming. I do sometimes write G-code directly with a text editor for simple 2.5D tasks.
$endgroup$
– Spehro Pefhany
6 hours ago
$begingroup$
Just an observation: if you are direct coding gerbers, then there is no design rule check taking place other than you visualizing in your head. I can't imagine typing out a text gerber file, sending it to fab house without ever opening the file in a GUI tool at just looking at it, unless you are a next level savant of some sort.
$endgroup$
– mkeith
6 hours ago
$begingroup$
I wasn't sure if Gerber was related to G-code, but I had a suspicion. If one needed to write a simple top layer for an antenna or filter it might not be too bad to code something up yourself. I've only edited G-code, but never tried to write it.
$endgroup$
– Voltage Spike
6 hours ago
$begingroup$
@mkeith some people are visual, some people learn otherwise. I can't imagine not checking with a gerber layer tool or something like that, but for some people it might be easier to look at the code.
$endgroup$
– Voltage Spike
6 hours ago
4
$begingroup$
Anyone who can work better with G-code than a visual tool of some sort for a complex board would definitely be an exceptional person. Anyone who can work directly in G-code and be productive would have to be considered a savant, I think.
$endgroup$
– mkeith
6 hours ago
|
show 1 more comment
$begingroup$
I wouldn't recommend it, but if you really desire you can write PCB artwork yourself, without any PCB program. The code looks like this:
G90*
1 G70*
2 G54D10*
3 G01X0Y0D02*
4 X450Y330D01*
5 X455Y300D03*
6 G54D11*
7 Y250D03*
8 Y200D03*
9 Y150D03*
10 X0Y0D02*
11 M02*
12
The line numbers at far right are not part of the file. Examining this
file without any prior knowledge of Gerber one would correctly deduce
that each line represents a particular machine command and that the
asterisk (*) is the end of command character. There seems to be
different kinds of commands: instructions beginning with G, D, M and
x,y coordinate data.
Source: https://www.artwork.com/gerber/appl2.htm
Here is a spec that shows the different commands
$endgroup$
I wouldn't recommend it, but if you really desire you can write PCB artwork yourself, without any PCB program. The code looks like this:
G90*
1 G70*
2 G54D10*
3 G01X0Y0D02*
4 X450Y330D01*
5 X455Y300D03*
6 G54D11*
7 Y250D03*
8 Y200D03*
9 Y150D03*
10 X0Y0D02*
11 M02*
12
The line numbers at far right are not part of the file. Examining this
file without any prior knowledge of Gerber one would correctly deduce
that each line represents a particular machine command and that the
asterisk (*) is the end of command character. There seems to be
different kinds of commands: instructions beginning with G, D, M and
x,y coordinate data.
Source: https://www.artwork.com/gerber/appl2.htm
Here is a spec that shows the different commands
answered 6 hours ago
Voltage SpikeVoltage Spike
35.6k12 gold badges41 silver badges103 bronze badges
35.6k12 gold badges41 silver badges103 bronze badges
1
$begingroup$
Gerber (RS-274X) is related to the G-code (RS-274) files used in CNC programming. I do sometimes write G-code directly with a text editor for simple 2.5D tasks.
$endgroup$
– Spehro Pefhany
6 hours ago
$begingroup$
Just an observation: if you are direct coding gerbers, then there is no design rule check taking place other than you visualizing in your head. I can't imagine typing out a text gerber file, sending it to fab house without ever opening the file in a GUI tool at just looking at it, unless you are a next level savant of some sort.
$endgroup$
– mkeith
6 hours ago
$begingroup$
I wasn't sure if Gerber was related to G-code, but I had a suspicion. If one needed to write a simple top layer for an antenna or filter it might not be too bad to code something up yourself. I've only edited G-code, but never tried to write it.
$endgroup$
– Voltage Spike
6 hours ago
$begingroup$
@mkeith some people are visual, some people learn otherwise. I can't imagine not checking with a gerber layer tool or something like that, but for some people it might be easier to look at the code.
$endgroup$
– Voltage Spike
6 hours ago
4
$begingroup$
Anyone who can work better with G-code than a visual tool of some sort for a complex board would definitely be an exceptional person. Anyone who can work directly in G-code and be productive would have to be considered a savant, I think.
$endgroup$
– mkeith
6 hours ago
|
show 1 more comment
1
$begingroup$
Gerber (RS-274X) is related to the G-code (RS-274) files used in CNC programming. I do sometimes write G-code directly with a text editor for simple 2.5D tasks.
$endgroup$
– Spehro Pefhany
6 hours ago
$begingroup$
Just an observation: if you are direct coding gerbers, then there is no design rule check taking place other than you visualizing in your head. I can't imagine typing out a text gerber file, sending it to fab house without ever opening the file in a GUI tool at just looking at it, unless you are a next level savant of some sort.
$endgroup$
– mkeith
6 hours ago
$begingroup$
I wasn't sure if Gerber was related to G-code, but I had a suspicion. If one needed to write a simple top layer for an antenna or filter it might not be too bad to code something up yourself. I've only edited G-code, but never tried to write it.
$endgroup$
– Voltage Spike
6 hours ago
$begingroup$
@mkeith some people are visual, some people learn otherwise. I can't imagine not checking with a gerber layer tool or something like that, but for some people it might be easier to look at the code.
$endgroup$
– Voltage Spike
6 hours ago
4
$begingroup$
Anyone who can work better with G-code than a visual tool of some sort for a complex board would definitely be an exceptional person. Anyone who can work directly in G-code and be productive would have to be considered a savant, I think.
$endgroup$
– mkeith
6 hours ago
1
1
$begingroup$
Gerber (RS-274X) is related to the G-code (RS-274) files used in CNC programming. I do sometimes write G-code directly with a text editor for simple 2.5D tasks.
$endgroup$
– Spehro Pefhany
6 hours ago
$begingroup$
Gerber (RS-274X) is related to the G-code (RS-274) files used in CNC programming. I do sometimes write G-code directly with a text editor for simple 2.5D tasks.
$endgroup$
– Spehro Pefhany
6 hours ago
$begingroup$
Just an observation: if you are direct coding gerbers, then there is no design rule check taking place other than you visualizing in your head. I can't imagine typing out a text gerber file, sending it to fab house without ever opening the file in a GUI tool at just looking at it, unless you are a next level savant of some sort.
$endgroup$
– mkeith
6 hours ago
$begingroup$
Just an observation: if you are direct coding gerbers, then there is no design rule check taking place other than you visualizing in your head. I can't imagine typing out a text gerber file, sending it to fab house without ever opening the file in a GUI tool at just looking at it, unless you are a next level savant of some sort.
$endgroup$
– mkeith
6 hours ago
$begingroup$
I wasn't sure if Gerber was related to G-code, but I had a suspicion. If one needed to write a simple top layer for an antenna or filter it might not be too bad to code something up yourself. I've only edited G-code, but never tried to write it.
$endgroup$
– Voltage Spike
6 hours ago
$begingroup$
I wasn't sure if Gerber was related to G-code, but I had a suspicion. If one needed to write a simple top layer for an antenna or filter it might not be too bad to code something up yourself. I've only edited G-code, but never tried to write it.
$endgroup$
– Voltage Spike
6 hours ago
$begingroup$
@mkeith some people are visual, some people learn otherwise. I can't imagine not checking with a gerber layer tool or something like that, but for some people it might be easier to look at the code.
$endgroup$
– Voltage Spike
6 hours ago
$begingroup$
@mkeith some people are visual, some people learn otherwise. I can't imagine not checking with a gerber layer tool or something like that, but for some people it might be easier to look at the code.
$endgroup$
– Voltage Spike
6 hours ago
4
4
$begingroup$
Anyone who can work better with G-code than a visual tool of some sort for a complex board would definitely be an exceptional person. Anyone who can work directly in G-code and be productive would have to be considered a savant, I think.
$endgroup$
– mkeith
6 hours ago
$begingroup$
Anyone who can work better with G-code than a visual tool of some sort for a complex board would definitely be an exceptional person. Anyone who can work directly in G-code and be productive would have to be considered a savant, I think.
$endgroup$
– mkeith
6 hours ago
|
show 1 more comment
$begingroup$
I use code to generate the netlist for my PCBs. (It's far, far quicker to write a for-loop to build an N-bit multiplexer than to laboriously draw all that stuff in a schematic.) Fortunately, KiCAD netlist files are just text, in a format that's undocumented but reasonably easy to reverse-engineer.
I wrote a small C# library that lets me type in what I want connected to what (in terms of reusable parametric blocks of circuitry), and it automatically spits out a netlist. Now I can just import that straight into KiCAD and start building the PCB, without having to waste an hour or so uselessly drawing a schematic for it. (The library even does some very basic checks to ensure my instructions aren't completely bogus, although I suspect KiCAD itself would do that job better.)
KiCAD PCB files, on the other hand, are also text, but appear to be far too complex to generate programmatically. Which is a shame, because KiCAD defaults to dumping all the components directly on top of each other, requiring me to spend 20+ minutes tediously separating them out again so I can see what the hell I'm doing. (KiCAD has a nasty habit of trying to move the text rather than the component it's attached to, presumably just to make PCBs harder to design?)
Perhaps some day I'll manage to also automate the initial component layout; I suspect, as others have said, that the actual "PCB design" bit will always involve the GUI though.
$endgroup$
$begingroup$
It would be nice to hook one of graphviz's layout engines up to KiCAD for the initial placement. I've used graphviz to make LTspice files for very simple layouts and it worked reasonably well.
$endgroup$
– pipe
5 hours ago
add a comment |
$begingroup$
I use code to generate the netlist for my PCBs. (It's far, far quicker to write a for-loop to build an N-bit multiplexer than to laboriously draw all that stuff in a schematic.) Fortunately, KiCAD netlist files are just text, in a format that's undocumented but reasonably easy to reverse-engineer.
I wrote a small C# library that lets me type in what I want connected to what (in terms of reusable parametric blocks of circuitry), and it automatically spits out a netlist. Now I can just import that straight into KiCAD and start building the PCB, without having to waste an hour or so uselessly drawing a schematic for it. (The library even does some very basic checks to ensure my instructions aren't completely bogus, although I suspect KiCAD itself would do that job better.)
KiCAD PCB files, on the other hand, are also text, but appear to be far too complex to generate programmatically. Which is a shame, because KiCAD defaults to dumping all the components directly on top of each other, requiring me to spend 20+ minutes tediously separating them out again so I can see what the hell I'm doing. (KiCAD has a nasty habit of trying to move the text rather than the component it's attached to, presumably just to make PCBs harder to design?)
Perhaps some day I'll manage to also automate the initial component layout; I suspect, as others have said, that the actual "PCB design" bit will always involve the GUI though.
$endgroup$
$begingroup$
It would be nice to hook one of graphviz's layout engines up to KiCAD for the initial placement. I've used graphviz to make LTspice files for very simple layouts and it worked reasonably well.
$endgroup$
– pipe
5 hours ago
add a comment |
$begingroup$
I use code to generate the netlist for my PCBs. (It's far, far quicker to write a for-loop to build an N-bit multiplexer than to laboriously draw all that stuff in a schematic.) Fortunately, KiCAD netlist files are just text, in a format that's undocumented but reasonably easy to reverse-engineer.
I wrote a small C# library that lets me type in what I want connected to what (in terms of reusable parametric blocks of circuitry), and it automatically spits out a netlist. Now I can just import that straight into KiCAD and start building the PCB, without having to waste an hour or so uselessly drawing a schematic for it. (The library even does some very basic checks to ensure my instructions aren't completely bogus, although I suspect KiCAD itself would do that job better.)
KiCAD PCB files, on the other hand, are also text, but appear to be far too complex to generate programmatically. Which is a shame, because KiCAD defaults to dumping all the components directly on top of each other, requiring me to spend 20+ minutes tediously separating them out again so I can see what the hell I'm doing. (KiCAD has a nasty habit of trying to move the text rather than the component it's attached to, presumably just to make PCBs harder to design?)
Perhaps some day I'll manage to also automate the initial component layout; I suspect, as others have said, that the actual "PCB design" bit will always involve the GUI though.
$endgroup$
I use code to generate the netlist for my PCBs. (It's far, far quicker to write a for-loop to build an N-bit multiplexer than to laboriously draw all that stuff in a schematic.) Fortunately, KiCAD netlist files are just text, in a format that's undocumented but reasonably easy to reverse-engineer.
I wrote a small C# library that lets me type in what I want connected to what (in terms of reusable parametric blocks of circuitry), and it automatically spits out a netlist. Now I can just import that straight into KiCAD and start building the PCB, without having to waste an hour or so uselessly drawing a schematic for it. (The library even does some very basic checks to ensure my instructions aren't completely bogus, although I suspect KiCAD itself would do that job better.)
KiCAD PCB files, on the other hand, are also text, but appear to be far too complex to generate programmatically. Which is a shame, because KiCAD defaults to dumping all the components directly on top of each other, requiring me to spend 20+ minutes tediously separating them out again so I can see what the hell I'm doing. (KiCAD has a nasty habit of trying to move the text rather than the component it's attached to, presumably just to make PCBs harder to design?)
Perhaps some day I'll manage to also automate the initial component layout; I suspect, as others have said, that the actual "PCB design" bit will always involve the GUI though.
answered 6 hours ago
MathematicalOrchidMathematicalOrchid
8221 gold badge10 silver badges15 bronze badges
8221 gold badge10 silver badges15 bronze badges
$begingroup$
It would be nice to hook one of graphviz's layout engines up to KiCAD for the initial placement. I've used graphviz to make LTspice files for very simple layouts and it worked reasonably well.
$endgroup$
– pipe
5 hours ago
add a comment |
$begingroup$
It would be nice to hook one of graphviz's layout engines up to KiCAD for the initial placement. I've used graphviz to make LTspice files for very simple layouts and it worked reasonably well.
$endgroup$
– pipe
5 hours ago
$begingroup$
It would be nice to hook one of graphviz's layout engines up to KiCAD for the initial placement. I've used graphviz to make LTspice files for very simple layouts and it worked reasonably well.
$endgroup$
– pipe
5 hours ago
$begingroup$
It would be nice to hook one of graphviz's layout engines up to KiCAD for the initial placement. I've used graphviz to make LTspice files for very simple layouts and it worked reasonably well.
$endgroup$
– pipe
5 hours ago
add a comment |
Thanks for contributing an answer to Electrical Engineering Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2felectronics.stackexchange.com%2fquestions%2f451003%2fpcb-design-using-code-instead-of-clicking-a-mouse%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
$begingroup$
I wouldn't recommend writing plain gerber files...
$endgroup$
– Huisman
8 hours ago
11
$begingroup$
PCB layout is mostly a visual task - moving and rotating stuff to make it fit. Doing it by code sounds painful.
$endgroup$
– JRE
8 hours ago
1
$begingroup$
There are usually hot keys for most (if not all) menu items; most tools allow text input for location and orientation (but it is a lot more painful to do that than just move things with a mouse). I use the text tools to get precise placement of things like vias and differential pairs.
$endgroup$
– Peter Smith
8 hours ago
1
$begingroup$
Some CAD packages are more clicky than others. In my experience, Orcad Allegro is the worst for making you go through a lot of pointless GUI actions to get the simplest things done. Diptrace is pretty much the easiest and most fluid user experience. PADS is a very nice toolchain with an intuitive UI and a lot of high-end features. PADS is for engineers who like to get things done, Orcad is for masochists. :D
$endgroup$
– Wossname
8 hours ago
1
$begingroup$
There are keyboard shortcuts and unique cases where programmatic generation of patterns make sense, but PCB layout is mostly an interactive graphical task. In contrast situations where the logic dominates over the physical embodiment like FPGA and (many parts of) ASIC design typically are driven by hardware description languages feeding logic compilers feeding automated place & route tools. If we were still building mainframe processors from big boards full of TTL there might be a comparable design flow for HDL to PCB... but fortunately we aren't.
$endgroup$
– Chris Stratton
7 hours ago