GithubHelp home page GithubHelp logo

librecad / librecad_3 Goto Github PK

View Code? Open in Web Editor NEW
298.0 38.0 102.0 9.68 MB

LibreCAD 3 is a next generation 2D CAD application written to be modular, with a core independent from GUI toolkits. Scripting is possible with Lua.

Home Page: http://librecad.org

License: Other

Shell 0.19% C++ 85.08% C 0.12% CMake 7.10% Lua 7.12% GLSL 0.39%
cad dxf drawing

librecad_3's Introduction

LibreCAD_3

Build status Coverage Status CodeFactor

Compilation Instructions

See https://github.com/LibreCAD/LibreCAD_3/wiki/Building

Reading materials for feature usage

If we want to support associative drawings, this is a good introduction to get started:

Understanding how dimensions are associated with objects

List of apparently awesome frameworks

If we are short of sample DXF files to test

http://cadkit.blogspot.nl/p/sample-dxf-files.html

librecad_3's People

Contributors

alexander982 avatar bhattigurjot avatar dxli avatar feragon avatar flywire avatar guruprasad-rane avatar jedi18 avatar kedwin avatar lordofbikes avatar luzpaz avatar marco-langer avatar modest25968 avatar parth-p avatar prokoudine avatar rupakbajgain avatar rvt avatar sckorpio avatar unityoffairfax avatar williria avatar xzcvczx avatar yori5070 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

librecad_3's Issues

Trim support

Actually, trim is handled by a Lua script. It's getting bigger for every entity added
A trim method should be added to CADEntity

imperial grid

Currently we have a metric grid, but a imperial would be a nice to have.

Additionally we should automatically be able to load the right grid based from the DXF

Dimension object size values change when opening previously saved file

I opened a previously saved DXF created in LibreCAD (saved and re-opened same day) and found that the sizes of a part of the dimensions objects had changed significantly (see image below). Values for items such as text height, arrow size, extension line offset, etc. had changed. I have a hunch that this may have to do with the fact that I had the General Scale set to 50 in the file when everything still was working ok, but am not sure.

Other info:
Version: 2.1.3
Compiler: GNU GCC 4.9.1
Compiled on: Sep 23 2016
Qt Version: 5.4.1
Boost Version: 1.60.0
System: Windows 7

dimensions blow-up example

Cancelling the ongoing command using ESC key.

It is necessary to be able to cancel the ongoing command using ESC key.

void CliCommand::onKeyPressed(QKeyEvent *event) {
    switch(event->key()) {
        case Qt::Key_Up:

            if(_historyIndex + 1 < _history.size()) {
                _historyIndex++;
                ui->command->setText(_history[_historyIndex]);
            }
            break;

        case Qt::Key_Down:
            if(_historyIndex > 0) {
                _historyIndex--;
                ui->command->setText(_history[_historyIndex]);
            }
            else {
                _historyIndex = -1;
                ui->command->clear();
            }
            break;
        case Qt::Key_Escape:
            /*TODO: Code to terminate ongoing command*/
            break;

        default:
            ui->command->event(event);
            break;
    }
}

Is there any function available to terminate the ongoing command?

Absolute ellipse major point

Ellipse major point is currently relative to center, which makes majorP getter returning a point which is not on ellipse and is confusing when creating an ellipse from user-given points.

Ellipse rendering is now correct so I'll fix this later if nobody do it before.

Things to change:

  • DXF load/save
  • geo::Ellipse methods (angle and majorRadius)
  • Lua creation plugin

Entities operations doesn't always conserve properties

For example here:

CADEntity_CSPtr Line::move(const geo::Coordinate& offset) const {
    auto newLine = std::make_shared<Line>(this->start() + offset, this->end() + offset, layer());
    newLine->setID(this->id());
    return newLine;
}

Start point and end point are modified, and layer/ID are conserved, but not MetaInfo

Solution:

CADEntity_CSPtr Line::move(const geo::Coordinate& offset) const {
    auto newLine = std::make_shared<Line>(this->start() + offset, this->end() + offset, layer(), metaInfo());
    newLine->setID(this->id());
    return newLine;
}

Fixing them is easy but take time (each entity needs to be verified), for the moment I'll fix them when I need. That would be great if someone can help on this :)

'Unify' text rendering within dimensions

Dimensions seem to have a lot of code in common in terms of text rendering.
We could possibly create on single function that can take care of this.

see also: Text rendering of radial that needs to be fixed

DinAngular: Optimise drawing of arrows/Location/Text

DemAngilar needs to be modified so it does smarter text placement- For example when the arrow's are to close we want to move the text automatically outside rather then inside.
Also what we want to do is sometimes draw the angular text on the inside, I am not sure yet what rules there are attached to that.

Passing options to command line.

Is there any way command line differentiate between text option and command?
For example.
If CIRCLE command is working, it asks for radius. But to change from default Radius to Diameter if we type D or Diameter, command line says "Command diameter not found".

I think modifying CliCommand::onReturnPressed() can solve this provided it knows that some command is already running or not.
@feragon Do we have anything to know whether any command is already running?

Split EntityVisitor

Currently we have one large EntityVisitor and this makes the whole thing a bit bulky. see https://github.com/LibreCAD/LibreCAD_3/blob/master/lckernel/cad/interface/entityvisitor.h

One idea might be to split the EntityVisitor into a GeoVisitor for pure geometric visits and a subclass EntityVisitor for the rest /primitive) visitors.
This split might make it better to handle.

A other possible solution s discussed with kerkes is to make a map that can call function's. This has the advantage that this might be extendible even from outside the kernel.

Any ideas?

Switch to LibreDWG

New version of LibreDWG library was released approximately month ago with a few good features
https://github.com/LibreDWG/libredwg/releases/tag/0.7

Your own library didn't update for years, feature difference is huge: https://github.com/LibreCAD/LibreCAD/tree/master/libraries/libdxfrw/src
It would be very beneficial to switch to this library finally.

new API:

  • add dwg_get_OBJECT(dwg) API for all objects in a DWG.
    analog to dwg_get_ENTITY, but including all objects, tables,
    block headers, even if unowned.
    Note that the dwg_api will be revamped from static to dynamic before 1.0.
    field accessors will be by name argument and ... (va_args)
    See the work/dynapi branch #59 (in progress).
    dwg_get_OBJECT(dwg) will be renamed to dwg_getall_OBJECT(dwg),
    dwg_get_ENTITY(blkhdr) to dwg_getall_ENTITY(blkhdr).

API breaking changes:

  • Changed BITCODE_RC from signed to unsigned char (#44)
  • LEADER changes: rename hooklineonxdir to hookline_dir,
    rename unknown_bit_4 to hookline_on,
    endptproj only until r2007. (but still not 100% correct)
  • MULTILEADER changes: rename num_vertex to numpts (analog to LEADER),
    change vertex to points[] (PR #49 Denis Pryt)
  • Fixed dwg_get_ENTITY(hdr): NULL-terminate the result (#60)

Important bugfixes:

  • Fixed all memory leaks and double-free's (#43, #42, PR #58 Denis Pryt)
  • Fixed EED sizes (PR #48, Denis Pryt)
  • Fixed BLOCK_HEADER.num_inserts, esp. with xref's (#44).
    For decode and encode.
  • Fixed LTYPE.dash (#44)
  • Fixup LEADER DXF values and path_type with annot_type mixup.
  • Fixed TABLE.value.data_type with flags kGeneral (#54 Denis Pryt)
  • Fixes VECTOR_CHKCOUNT segfault on unassigned obj->dxfname's
    (esp. for <=R12), and fix overflows (#56)
  • dwglayers: fix for DICTIONARY breaking the list output (#51)
  • dxf: fix dxf_blocks_write for empty paper_space (#52)
  • Fixed example/load_dwg.py allowing non-critical error codes

Other newsworthy changes:

  • Check for RUNNING_ON_VALGRIND and call dwg_free then, even
    if previously skipped.
  • Renamed all remaining API "null malloc" error messages to
    "Out of memory"
  • Harmonized in_dxfb with in_dxf, but still WIP

Location of files

Over time I have been adding files to location what seemed to be 'best fit' but we need to verify and see if it's all still in logical order.

Copy between documents

This allows someone to copy and paste between different LibreCAD windows,and if possible different processes
Copy from LibreCAD v2 should be possible too

Compilation Instructions

on Lubuntu 14.10 64bit, following Instructions I get, after the command cmake ../LibreCAD_3/, an error

CMake Error at luacmdinterface/CMakeLists.txt:19 (find_package):
By not providing "FindCurl.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Curl", but
CMake did not find one.
Could not find a package configuration file provided by "Curl" with any of the following names:
CurlConfig.cmake
curl-config.cmake
Add the installation prefix of "Curl" to CMAKE_PREFIX_PATH or set "Curl_DIR" to a directory containing one of the above files. If "Curl" provides a separate development package or SDK, be sure it has been installed.
-- Configuring incomplete, errors occurred!
See also "/home/alessandro/build/CMakeFiles/CMakeOutput.log".

curl is installed. Any help?

Intersect method definition

As pointed out by @rupakbajgain, Circle/Circle intersection is marked as undefined because it's defined as bool operator()(const lc::geo::Circle& c1, const lc::geo::Circle& c2);, and a CADEntity is sent so the compiler calls this function : template<typename S> bool operator()(const S& s1, const S& s2);

  1. Every intersection function should use geo classes.
  2. A template method should reverse the arguments if needed

Fails to build on Debian Unstable

-- Build info: branch master - commit 8f246bb
Scanning dependencies of target lckernel
[ 1%] Generating always_rebuild

[ 1%] Generating ../../lckernel/version.cpp
-- Build date: 2017-09-28 04:28:12
-- Build info: branch master - commit 8f246bb
[ 2%] Building CXX object lckernel/CMakeFiles/lckernel.dir/version.cpp.o
[ 3%] Building CXX object lckernel/CMakeFiles/lckernel.dir/cad/dochelpers/documentimpl.cpp.o
In file included from /home/user/soft/cad/librecad/LibreCAD_3/lckernel/cad/dochelpers/documentimpl.h:7:0,
from /home/user/soft/cad/librecad/LibreCAD_3/lckernel/cad/dochelpers/documentimpl.cpp:5:
/home/user/soft/cad/librecad/LibreCAD_3/lckernel/cad/document/document.h:9:10: fatal error: nano-signal-slot/nano_signal_slot.hpp: No such file or directory
#include <nano-signal-slot/nano_signal_slot.hpp>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
lckernel/CMakeFiles/lckernel.dir/build.make:166: recipe for target 'lckernel/CMakeFiles/lckernel.dir/cad/dochelpers/documentimpl.cpp.o' failed
make[2]: *** [lckernel/CMakeFiles/lckernel.dir/cad/dochelpers/documentimpl.cpp.o] Error 1
CMakeFiles/Makefile2:87: recipe for target 'lckernel/CMakeFiles/lckernel.dir/all' failed
make[1]: *** [lckernel/CMakeFiles/lckernel.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

The file is right there though:

$ locate nano_signal_slot.hpp
/home/user/soft/cad/librecad/LibreCAD_3/nano-signal-slot/nano_signal_slot.hpp

DXF color saving

LibreCAD uses 24 bits color in UI, but DXF only support 256 indexed colors
When saving, we should use the closest color, and warn the user.

Xref support

I originally raised this in the other repository here and I think its really important feature, I would love to roll this out as but our workflow is xref centric, will it land in version 3 ? Libredwg currently has an open issue to extract xref paths from dwg files (I am trying to implement the tool but im not sure I have the required skill set).

I assume xrefs aren't part of the dxf standard so im aware that this probably causes some compatability issues

Drawing: DimRadial

Test for correct drawing of DimDiametric and DimRadial

This can be done creating a DXF in a other CAD application and compare that how LibreCAD 3 draw's it to compare the drawing's and see if we render the same Dim functions

Check code style

I've added make stylecheck using clang-tidy, but before I can add this check on Travis CI, all the code needs to be checked and fixed.

Git master fails to build

Ubuntu 18.10, Git master of LibreCAD_3:

Running 'cmake ..' outputs:

CMake Error at persistence/CMakeLists.txt:63 (add_subdirectory):
  The source directory

    /home/alex/soft/cad/LibreCAD_3/persistence/libopencad

  does not contain a CMakeLists.txt file.

Is this expected? Should I be able to fix it on my end?

GSoC'2018 wiki page has links to unavaliable content

I just read wiki page ...

... and found that it include reference link to webpage that not exist anymore

Is it issue of @gaganjyot website or is it incorrect link? Where this page live now?

P.S.: Is it same content on Medium?

Drawing: DimDiametric

TODO: Test for correct drawing of DimDiametric

This can be done creating a DXF in a other CAD application and compare that how LibreCAD 3 draw's it

Image fole formats support

Due to Cairo we currently can only load the PNG file format.
We need to have support in lcviewernoqt to load other image formats.

At this point I don't want to bluntly import Qt in this lib due to it's enormous dependencies and I rather would like to find a 'smaller' library. We don't need transformations (I think) only beable to show a image format in a Cairo surface,

Lua version

Hello,

I just found that Lua >= 5.3.4 is required due to LUA_UTF8LIBNAME macro. It is being used on LibreCAD_3/lcadluascript/lclua.cpp

DocumentCanvas

Document Canvas should ask the callee for a painter instead of keeping it's own vector of painter.

This will avoid a hashmap of painter in the DocumentCanvas and additionally the callee can decide where the paint what.

This will make it easier to use the DocumentCanvas in situations where you need to write to PDF or SVG.

Inefficient retrival of elements within an area

From what I understand,

Lets say there is an area { 5000, 5000 } , { -5000, -5000 } area1 ( area of quadtree )

If I want to retrieve elements in area { 100, 100 }, { 200, 200 } called area2

it checks if the area2 is in the area1 and returns all the elemets so present in the area1

I don't have a *nix platform to unittest and make sure about it. but if the understanding is correct it will be retrieving lots of entities that are not even the area. Not sure if painter will paint all the entities or only a few

void _retrieve(std::vector<E>& list, const geo::Area& area, const short maxLevel) const {

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.