LibreCAD 3 GUI Revamp – GSoC 2020 Final Report

This is my final report for GSoC 2020. I’ve finished all my tasks laid out in my proposal and also managed to get a few more tasks done. I’d like to thank my mentors Florian and Armin for their tremendous help and swift reply to my doubts. I’d also like to thank members of the community like Rupak Bajgain, Guruprasad Rane and flywire for their help and advice.

Major PRs :-

Other PRs :-

Important Links :-


Brief description of work done

GUI shift from Lua to C++

  • The GUI has been entirely shifted from lua to C++.
  • Created MainWindow class, updated layer,toolbar,clicommand classes.
  • All qt related code removed from qtbridge, now renamed to lua bridge.
  • All lua ui files removed.

Lua GUI API

  • Added Lua GUI API to allow lua plugin scripts to interact with the gui elements like the mainwindow, toolbar buttons, menu buttons, layer, clicommand etc.
  • Added many dialog widget GUI classes, which allow the user to form his own gui widget for the user using a plugin.
  • Lua GUI API Documentation added to the wiki.

Unit Tests

  • Updated unit tests for the widgets like layers, clicommand, toolbar and mainwindow unit tests.
  • Added Lua GUI API unit tests

Operation Loading

Loading of operation and generation and connection of the correct buttons, menu items, cli commands, context operations etc happen automatically by using the properties specified in the beginning of each lua operation file, making it easier to add new lua files without needing to change code elsewhere

Customize Toolbar Widget

  • Ability to customize and order the toolbar buttons in the user’s desired order
  • Order can be saved and loaded by the user (saved in json format)
  • Added ui settings json file which stores ui settings and is validated by a schema on loading.

Property Editor

  • Property editor added which allows the user to change the properties of the created entities, the change in properties updates the entity with new properties instantaneously.
  • Uses the input gui widgets developed earlier in the lua gui api.
  • Also contains meta info and layer properties.

Context Menu

  • Context menu can be opened by right clicking, it has three states, active,inactive and selected.
  • Can easily access create and modify tools using the context menu
  • Contains undo, last command, copy, paste etc.
  • Allows transition between different methods while creating an entity.

Other

  • Copying and pasting of entities among different librecadv3 windows.
  • Few missing arc operations implemented.
  • Added text operations lua file and a text dialog which allows adding more customized text with different style and font.

What I’ve learned

GSoC at librecad has been a great learning experience for me and I had a lot of fun working on the project. Some of the things I’ve learned

  • Gained confidence in writing C++ object oriented code, as well learned the importance of writing comments and readable code.
  • Learnt lua while preparing and working on my gsoc project.
  • Learnt how to work with tools like CMake, which I was initially intimidated by but am now fairly comfortable with.
  • Learnt the importance of approaching problems properly, like how florian pointed out that using the visitor design pattern in a certain problem was better than the approach I was going for.
  • Gained confidence in using git and github, learning how to work with branches, squash commits, merge etc.
  • Learnt how to use the Qt framework and about qt’s signal and slots system, model/view programming etc.
  • Importance of discussing the task and problem, instead of diving head first into implementing it, and to also take into account the user’s perspective.
  • Learned how to properly debug and track down problems.

I was lucky to have great mentors to help guide me through the summer, Florian has been extremely helpful and responsive from the very start when I started contributing at the end of December. Armin too has been very helpful and made the setting up of the required accounts for wiki and the blog a breeze.

Thanks for taking the time to read my final report, I’d again like to thank everyone involved for their help and advice. GSoC was a great experience and has helped me gain confidence to continue contributing to LibreCAD and other open source organizations in the future.

Akhil Nair

5 thoughts on “LibreCAD 3 GUI Revamp – GSoC 2020 Final Report

  1. Good morning to all:

    May I make a suggestion. I have worked very little with your program because sometimes I get lost and I do not know how to give, for example, a distance to a line that I am drawing, or how to make offset in a certain distance so that I do not have to draw again the figures already drawn, as if I were making a wall, or better yet, how to block the line so that it is only straight, either horizontally or vertically. That would help a lot when drawing a plane or any other drawing.

    Drawing is not only the problem of rotating at a fixed size or rotating without using the line lock is something that can be done while working.

    However, the smart distance is missing. What I mean. It turns out that drawing with the help of the mouse or digitizing tablet does not always keep the line or figure at the value you need. If there is an intelligent distance, I can point the two points to measure and then put the measure I want, and the system cuts and adjusts the line or figure to that value, the same would apply for the offset being everything adjusted precisely. Your competitor does not have that kind of system and you can attract a lot of attention that way.

    Now, to make something 3D, you can extrude it in the direction you need and in the distance you need, when you are working on things like mechanics or similar. In architecture or civil engineering is useful the intelligent extrusion where it takes into account doors, windows and other elements that cut the space, it is only to indicate the height of that area and finish off the rest. Now, in architecture and civil engineering sometimes new things are created. If you create it as a piece in Libre CAD and then give it the desired characteristics of the object created, so that if it is a window, you can do in the plan the hole of that window, the same if it is a door, with some differences, or a staircase and cut the next floor intelligently leaving the stairwell. those things do not have AutoCAD and you can attack by those points that you do not have and make it your strength. Ideas around this there are many.

    Your tool can be a very powerful one, if we combine things like that, with the aim and purpose that, they see within Free Software not as an alternative but as a way of working. Now if you can export to DWG and DXG which are AutoCAD files it would be very eye catching. And creating a universal technical drawing file would also be ideal. Because others could work on it in the cloud, if it existed in a company.

    That’s what we need to have tools to compete even those of us who work under GNU/Linux and want to use something more professional. Even if you were to take GNU/Linux and create a single base where the use of these and other CAD/CAM/CAE design tools are the norm in speed, performance and ease of use, you and others working on something similar to what you do find the perfect means to exploit the full capabilities of the programs, including yours, and put them to work across the board. join together and put out a GNU/Linux (in addition to these separate programs) that is completely dedicated to these programs and the machines that are there for CAM/CAE.

Leave a Reply to Rafael Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.