I have been studying c++ for about 7 years. Before that I cut my teeth on visual basic. I want to help do some of the work. It don't matter what. I'll need a lot of coaching maybe but I'll do what ever I can. I don't have a clue as to how to get started. I would like some one to give me an outline of how the code in it's various source files come together to make the whole app. I am in the process of downloading the source files now and the QT ide. I just need to be pointed in the right direction or something to that nature. I want to learn how C++ is used to create a complete app. I highly doubt I can figure it out on my own.
|
Hi Steve,
You are very welcome. I found it's easiest for me to develop in Linux. For Windows, have a look at our wiki at: Build LibreCAD on Windows Please register your wiki account there, so you can improve the wiki pages. Qt Creator should be very easy to use for C++ code, also make sure you read relevant Qt reference online. To start, I feel you can read our bug tracker at LibreCAD bug tracker, read how the bugs are fixed by the commit numbers. Right now, we would like to start new features in a 2.1 branch. We will see what we can collaborate on very soon. dxli
|
I have browsed the bug tracker and I think I understand how the commits are numbered and how they are associated with a branch. A branch is a milestone identification. I saw where the last opened item gets placed on the top of the list of bugs. The latest bug has not received any responses yet. The next bug in the list has several responses and is fixed. I also understand that any new bug reports will be placed in milestone 2.1 where there are five bugs presently reported. I will now try to get an understanding of the files that are used to build LibreCad in Qt. I know to start with the main function file and go from there. Is there any way to get a short outline of the main function file? I want to see if I can at least find where the code is located that concerns the bug 449 milestone 2.0. I am very good with algorithms and math. I was a draftsman for 20 years. I coded using vba for AutoCad for most of that time as well as autolisp. I still have a lot of reading to do in the wiki but I believe I'll be able to help soon. Thanks, Steve.
|
Hi Steve,
the bug is clearly there. Please apply the attached patch to clearly show the trouble: v.patch ( you may apply the patch in the librecad source folder: patch -p1 < /path/to/v.patch ) After that, you can build and follow steps I added to the bug tracker to reproduce the bug. Debugging information is written to console/terminal. Before file saving, polyline is draw with following info: start 0 1 ( 5 , 5 ) r= 5 2 3 end it says the second entity is an arc centered at (5,5) with radius 5. After saving and reopening, the output changed to: start 0 1 ( 52.5 , 52.5 ) r= 70.799 2 3 end I think the trouble is due to polyline information, polyline has entities connected by startpoing/endpoint. In our example, the arc created by rounding doesn't follow this order. Please have a look at methods: void RS_FilterDXFRW::addPolyline(const DRW_Polyline& data) ; Clearly, we need to investigate how polyline data is saved/read, and used.
|
I Dongxu and Steve,
About polylines and bug #449 see my comment in SF bugs and in these thead: http://forum.librecad.org/manual-first-steps-td5707490.html#a5707520 |
Yes, I see how this bug happens.
However, the inconsistence is a bug to me. We can make the generated polyline valid in the fake "closed" polyline case. rs_modification.cpp, line 2883 bool insertAfter1 = false; if (!isClosedPolyline) { insertAfter1 = (idx1<idx2); } else { insertAfter1 = ((idx1<idx2 && idx1!=0) ||(idx1==0 && idx2==1) || (idx2==0 && idx1==(int)baseContainer->count()-1)); } // insert rounding at the right position: //if ((idx1<idx2 && idx1!=0) || // (idx2==0 && idx1==(int)baseContainer->count()-1)) { //if (idx1<idx2) { if (insertAfter1) { if (trimmed1->getEndpoint().distanceTo(arc->getStartpoint())>1.0e-4) { arc->reverse(); } baseContainer->insertEntity(idx1+1, arc); } else { if (trimmed2->getEndpoint().distanceTo(arc->getStartpoint())>1.0e-4) { arc->reverse(); } baseContainer->insertEntity(idx2+1, arc); }
|
I made a litte test and seem working well changing:
bool insertAfter1 = false; if (!isClosedPolyline) { insertAfter1 = (idx1<idx2); } else { insertAfter1 = ((idx1<idx2 && idx1!=0) ||(idx1==0 && idx2==1) || (idx2==0 && idx1==(int)baseContainer->count()-1)); } By: bool insertAfter1 = ((idx1<idx2 && idx1!=0) ||(idx1==0 && idx2==1) || (idx2==0 && idx1==(int)baseContainer->count()-1)); Modify->bevel can also be bad |
do we have a way to verify the validity of polyline generated?
|
Administrator
|
I use the free Autodesk tool DWG TrueView for Windows to validate DXF files.
Please post the file(s), I can test it. Armin
investing less than half an hour into Search function can save hours or days of waiting for a solution
|
In reply to this post by dxli
I Dongxu,
Sorry for the delay. I use "info->list entities" brief explanation: pol1: 0,0; 100,0; 50,50; close pol2 (fake closed): 0,0; 100,0; 50,50; 0,0 Round first & last segment by radius 5: pol1: Closed: Yes Vertices: in point: X=12.0711 Y=0 in point: X=100 Y=0 in point: X=50 Y=50 in point: X=8.5355 Y=8.5355 curvature: 0.6682 pol2 (bad bug present): Closed: No Vertices: in point: X=12.0711 Y=0 in point: X=100 Y=0 curvature: 0.6682 in point: X=12.0711 Y=0 in point: X=50 Y=50 in point: X=8.5355 Y=8.5355 pol2 (patch aplied & correct pol): Closed: No Vertices: in point: X=12.0711 Y=0 in point: X=100 Y=0 in point: X=50 Y=50 in point: X=8.5355 Y=8.5355 curvature: 0.6682 in point: X=12.0711 Y=0 Or directly read in dxf: 10 => x code 20 => y code 42 => bulge code |
steve,
do you have enough information to play with this bug? review the code identity the bug try to fix the bug for 2.0, if the algorithm can be rewritten, let's do 2.1 fork and add new implementation there. |
I am having problems building LibreCad from Qt.
I have a stand alone version of LibreCad but each time I try to save a file it crashes. Is muParcer and boost required to build LibreCad from Qt? I have the source code downloaded and have the LibreCad.pro file loaded in to Qt. I have unchecked the shadow option for both debug and release versions. I get the following error: :-1: error: Can not find Boost installation in /boost/boost_1_53_0. When I try to build the project. I am currently reviewing the file rs_modification.cpp. I am having to develop a flow chart for myself in order to understand what's going on. If need be I can install Ubuntu along side of Windows if you think Linux might be the best way for a person who is a novice with Qt to start out. I see several areas where I can do a google search and learn fundamental concepts for myself. If you can I need help getting a build of LibreCad to work. Then I will play with the bug and the source code. Thanks |
Steve,
if you are building in Windows, please follow the wiki: http://wiki.librecad.org/index.php/LibreCAD_Installation_from_Source#boost In OS/X or Linux, you just install the boost package.
|
In reply to this post by Steve Griffin
For myself, Linux is much better than Windows here.
In ubuntu, you can follow howto here: http://librecad.org/cms/home/from-source/linux.html First, you need to include deb-src lines in sources.list for Ubuntu, After that, it's basically: $ sudo apt-get build-dep librecad then, in librecad source folder: $ qmake -r $ make -j4 if it's successful, run the binary by: $ unix/librecad
|
Free forum by Nabble | Edit this page |