vygr / c-pcb Goto Github PK
View Code? Open in Web Editor NEWC++14 PCB autorouter
License: GNU General Public License v2.0
C++14 PCB autorouter
License: GNU General Public License v2.0
net
holds a pointer to pcb
In c_pcb.cpp best_pcb
is copy-constructed from current_pcb
. Should current_pcb
go out of scope, best_pcb
would become compromised and result in segfaults when calling methods which would require the net
-s it contains to refer to the pcb
pointers inside them, as the pcb
pointers are always pointing to current_pcb
. While this works the way it is used, this architecture is brittle and unintuitive. I would suggest implementing a copy-constructor for pcb
which would correctly update nets
to contain pointers to the new instance. Hope this is intelligible.
I spent half a day trying to compile to exe for Windows, but no luck.
Anyone can help to compile it?
C-PCB-master % ./c_pcb_dsn tchycoscope.dsn | ./c_pcb --v 2 --z 1 --q 4 --r 1 | ./c_pcb_view --s 12
zsh: segmentation fault ./c_pcb_dsn tchycoscope.dsn |
zsh: exit 1 ./c_pcb --v 2 --z 1 --q 4 --r 1 | ./c_pcb_view --s 12
hi vygr, does router Algorithm has reference paper?
Thank you for C-PCB. As a user of pcb-rnd I am thrilled with nacent C-PCB integration. C-PCB is blazing fast and does a great autorouting job.
Video link:
https://imgur.com/gallery/drpXGM0
Env:
Ubuntu18.04, vmware
OpenGL version string: 3.3 (Compatibility Profile) Mesa 20.0.8
Error:
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x0000000000000000 in ?? ()
solve:
start GLEW extension handler after glfwMakeContextCurrent(window) called;
such as:
auto window = glfwCreateWindow(width, height, "PCB Viewer", NULL, NULL);
if (!window)
{
glfwTerminate();
exit(EXIT_FAILURE);
}
glfwMakeContextCurrent(window);
// start GLEW extension handler huangli add successful
√ glewExperimental = GL_TRUE;
√ glewInit();
glfwSetKeyCallback(window, key_callback);
```
On Ubuntu 16.04 I need to add a a link to libglew.
clang++ -O2 --std=c++14 pkg-config --cflags glfw3
view.cpp mymath.cpp -oview pkg-config --static --libs glfw3 glew
Hello, I am doing research on PCB wiring recently, can you share your algorithm or ideas on how to determine the location of vias on a multi-layer PCB? Thank you
-----.dsn------------------------------------------------------------------------------
(string_quote ")
(space_in_quoted_tokens on)
(host_cad "KiCad's Pcbnew")
---result below ------------------------------------------------------------------------
pcb
D:\pdavies\Documents\KiCad\wetroom-shield\wetroom-shield.dsn
parser
string_quote
)
(space_in_quoted_tokens on)
(host_cad
KiCad's
Pcbnew"
host_version
(2013-07-07 BZR 4022)-stable
--- fixed ----------------------------------------------------------------------
pcb
D:\pdavies\Documents\KiCad\wetroom-shield\wetroom-shield.dsn
parser
string_quote
"
space_in_quoted_tokens
on
host_cad
KiCad's Pcbnew
host_version
(2013-07-07 BZR 4022)-stable
----solution-------------------------------------------------------------------
It is better to treat the value of string_quote as a string identifier. Of course, we can also use a temporary solution to check whether the current node is a string_quote when encountering ("), and not treat it as a string.
-- code ----------------------------------------------------------------------
c_pcb_dsn.cpp:read_tree
if (b == '"')
{
if(nodeName != "string_quote")
{
in.get(c);
t.m_branches.push_back(read_quoted_string(in));
in.get(c);
continue;
}
else
{
in.get(c);
std::string str;
str.push_back(b);
t.m_branches.push_back(tree{str, {}});
continue;
}
}
Compiles without error BUT view gives a SIGSEGV Segmentation fault. The "PCB Viewer" window opens (blank) and then there is the SIGSEGV.
Below is a gdb backtrace of the problem. Any ideas?
ecomer@asrock C-PCB]$ cat /proc/version
Linux version 4.14.34-1-MANJARO (builduser@development) (gcc version 7.3.1 20180312 (GCC)) #1 SMP PREEMPT Thu Apr 12 17:26:43 UTC 2018
[ecomer@asrock C-PCB]$ ./dsn2pcb test1.dsn | ./pcb --v 1 --z 8 --q 10 --r 2 >x
Number of terminals: 204
Number of Nets: 55
Number of Vias: 51
Number of terminals: 204
Number of Nets: 55
Number of Vias: 51
[ecomer@asrock C-PCB]$ gdb ./view
GNU gdb (GDB) 8.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./view...done.
(gdb) r x
Starting program: /home/ecomer/src/C-PCB/view x
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7fffea1c9700 (LWP 910)]
[New Thread 0x7fffe918a700 (LWP 911)]
[New Thread 0x7fffe8989700 (LWP 912)]
[New Thread 0x7fffdbfff700 (LWP 913)]
[New Thread 0x7fffdb7fe700 (LWP 914)]
Thread 1 "view" received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt
#0 0x0000000000000000 in ?? ()
#1 0x000055555555755d in main (argc=2, argv=0x7fffffffdff8) at view.cpp:452
(gdb)
hi, vygr!
I encountered some problems when running the c++ program, I don't know how to solve it, I would like to ask you。
c_pcb.cpp and c_pcb_dsn.cpp could be compiled and got c_pcb.exe and c_pcb_dsn, but c_pcb_view.cpp had some error.
Since I don't know how to add the glfw library to the Makefile, I use the cmakelists file to perform cmake first, then make.
the errors are the compiler cannot resolve the related functions in mymath.cpp.
The file content of cmakefilelists is:
I'm not very good at c++, hope you can help me take a look, thanks!
errors about:
Hi
this project is a very nice project, it help a lot with autorouter for PCB, but many users doesn't use it directly because it only works at command line mode, and it isn't a installation package application.
if anyone can help to integration as QautoRouter plugin to run, I think this project will be more public and helpful, it maybe will more active and popular than Freerouting
https://github.com/udif/qautorouter-svn
https://sourceforge.net/projects/qautorouter/
but sadly, the Qautorouter doesn't maintain anymore, it is a bad news.
thank you for sharing, it is a nice work. :)
Hi! This looks really great, do you think you can clarify the file types for input and output? Are the .dsn
Specctra Netlists? What about the .pcb
formats? Proteus?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.