LibreCAD | platform 2D CAD program written in C++14 using the Qt | Development Tools library
kandi X-RAY | LibreCAD Summary
kandi X-RAY | LibreCAD Summary
LibreCAD is a 2D CAD drawing tool based on the community edition of QCAD. LibreCAD uses the cross-platform framework Qt, which means it works with most operating systems. The user interface is translated in over 30 languages. LibreCAD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 (GPLv2) as published by the Free Software Foundation. Please read the LICENSE file for additional information. The master branch represents the latest pre-release code, and now requires Qt 5.2.1 or newer. The 2.1 branch will be the last to support Qt4. The 2.0 branch will be the last to support the QCAD toolbar. libdxfrw is an associated project that allows LibreCAD to read DWG files. More information: Build from source. There is a resources repository for people that want to indirectly contribute to the project by supplying icons, stylesheets, documentation, templates...
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of LibreCAD
LibreCAD Key Features
LibreCAD Examples and Code Snippets
Community Discussions
Trending Discussions on LibreCAD
QUESTION
Trying to open a dxf file format (actual project in C++), I could understand the basic structure of the file, but I can't manage to find how a cube is actually represented.
For a cube in CAD, I expect at least 9 values:
- X Y Z position
- A B C rotation
- W H D size of the cube
I expect X, Y, Z, A, B and C to be in the ENTITY section,
But Looking at example files, I see many settings, the preview image (taking a significant space in the file), layouts, etc.. But nothing that I can match to how the cube is actually build.
Question:How to represent/read a cube in a dxf file?
More infoHere is the documentation about the file format:
http://help.autodesk.com/view/OARX/2018/ENU/?guid=GUID-235B22E0-A567-4CF6-92D3-38A2306D73F3
Here is an example of file with a cube (created with BricsCAD). Unfortunately, I can't embed the file, as it is too big. The "cube" is of 20mm x 25mm x 30mm.
https://download.escain.org/example_cube_20_25_30_mm.dxf
I checked LibreCAD source-code, but it does not manage 3D models. Also, libdxfrw library is too generic (it just call the interface callback with the full Entity data).
https://github.com/LibreCAD/LibreCAD_3
https://github.com/LibreCAD/libdxfrw
ANSWER
Answered 2021-Jul-06 at 12:59This cube is embedded binary ACIS data (3DSOLID) and can not be interpreted without the libraries from Spatial Inc. For more information see my answer to another question: How I can parse nurbs surface from dxf file? Or do you know library(for js, if exists or any other language) for parsing it?
EDIT: Find binary data of ACIS entities
Starting with R2013/AC1027 Modeler Geometry of ACIS data is stored in the section ACDSDATA
in a ACDSRECORD
these records have no handle, instead they have an ID. The record of your 3DSOLID starts at line 22393 and has the ID 10:
QUESTION
I am developing a program, and one of the requirements is to take DXF as input. The input is limited to 2D case only. The program itself is in C++/Qt, but to test it I need some sample DXF input. The spline import is already implemented, the next step is polyline with spline fit points or control points added. I decided to use Python/ezdxf to generate such polyline, as I don't have Autocad.
My first approach was to create a spline from fit points utilizing add_spline_control_frame
, then convert it to polyline. The problem is there turned out to be no conversion from spline to polyline (although I think I saw it in the docs, but cannot find it anymore).
The current approach is to make polyline by add_polyline2d(points)
, making each point to be with DXF flag field equal 8
(spline vertex created by spline-fitting). The problem is points need to be of type DXFVertex
(docs state Vertex
, but it is absent), and that type is private for ezdxf.
Please share your approaches either to the problems I've faced with ezdxf, or to the initial problem.
P.S. I tried to use LibreCAD to generate such a polyline, but it's hardly possible to make a closed polyline from spline fit points there.
...ANSWER
Answered 2020-Sep-01 at 14:54The ability to create B-splines by the POLYLINE entity was used by AutoCAD before in DXF R2000 the SPLINE entity was added. The usage of this feature is not documented by Autodesk and also not promoted by ezdxf in any way.
Use the SPLINE entity if you can, but if you have to use DXF R12 - there is a helper class in ezdxf to create such splines ezdxf.render.R12Spline
and an usage example here.
But you will be disappointed BricsCAD and AutoCAD show a very visible polygon structure:
Because not only the control points, but also the approximated curve points have to be stored as polyline points, to get a smoother curve you have to use many approximation points, but then you can also use a regular POLYLINE as approximation. I assume the control points were only stored to keep the spline editable.
All I know about this topic is documented in the r12spline.py file. If you find a better way to create smooth B-splines for DXF R12 with fewer approximation points, please let me know.
Example to approximate a SPLINE entity spline
as points, which can be used by the POLYLINE entity:
QUESTION
Librecad uses a widget which can be infinitely resized, you can zoom in and out as much as you can. Which widget does it uses?
When I paint into a common widget, the painting is done at certain coordinates of the widget. However, I would like to draw at floating coordinates of the widget and use a line width which is fixed to certain pixels of the viewport.
Before resizing:
After resizing:
Which widget provides this functionality?
...ANSWER
Answered 2020-Jan-18 at 22:31You have to use QGraphicsView and QGraphicsScene(see Graphics View Framework):
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install LibreCAD
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page