GNU LibreDWG. Savannah mirror http://www.gnu.org/software/libredwg/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Reini Urban 4064940276 api: rename VPORT_ENTITY_HEADER => VX_TABLE_RECORD, VPORT_ENTITY_CONTROL 9 hours ago
.github fix FUNDING.yml format for patreon 5 months ago
bindings api: rename VPORT_ENTITY_HEADER => VX_TABLE_RECORD, VPORT_ENTITY_CONTROL 6 hours ago
build-aux appveyor: copy libssp-0.dll to zip 3 months ago
doc api: rename VPORT_ENTITY_HEADER => VX_TABLE_RECORD, VPORT_ENTITY_CONTROL 6 hours ago
examples api: BlockReference renames insertion_pt, data_flags 1 day ago
include api: rename VPORT_ENTITY_HEADER => VX_TABLE_RECORD, VPORT_ENTITY_CONTROL 6 hours ago
jsmn @ 85695f3d59 add in_json with MIT jsmn WIP 5 months ago
m4 enable ax_restrict 6 months ago
programs api: rename VPORT_ENTITY_HEADER => VX_TABLE_RECORD, VPORT_ENTITY_CONTROL 6 hours ago
src api: rename VPORT_ENTITY_HEADER => VX_TABLE_RECORD, VPORT_ENTITY_CONTROL 6 hours ago
test api: rename VPORT_ENTITY_HEADER => VX_TABLE_RECORD, VPORT_ENTITY_CONTROL 6 hours ago
.appveyor.yml Release 0.10.1 5 months ago
.cirrus.yml cirrus: freebsd-12-1-snap fails 4 months ago
.clang-format add .clang-format 1 year ago
.drone.yml remove outdated dejagnu deps 6 months ago
.gitignore api: auto-generate the dwg_setup_NAME functions also 1 week ago
.gitmodules add in_json with MIT jsmn WIP 5 months ago
.lgtm.yml Enable LGTM support (#46) 1 year ago
.travis.yml travis: ASAN switch from clang to gcc (7.4) 4 days ago
AUTHORS typo fix Pruchkovksy -> Pruchkovsky 1 year ago
CONTRIBUTING CONTRIBUTING: add link to (c) assignment form 1 year ago
COPYING initial code based on libdwg (http://libdwg.sourceforge.net/en/index.html) 11 years ago
ChangeLog Release 0.10.1 5 months ago
Dockerfile add Dockerfile to EXTRA_DIST 3 months ago
HACKING Change development version formats for rpm, no - 4 months ago
Makefile.am add cmp-objs.pl: compare binaries via xxd 2 months ago
NEWS api: rename VPORT_ENTITY_HEADER => VX_TABLE_RECORD, VPORT_ENTITY_CONTROL 6 hours ago
README Update README, Fix typo in install instructions 1 day ago
TODO spec: demote DIMASSOC back to DEBUGGING 1 day ago
USING_FOREIGN_CODE USING_FOREIGN_CODE: add incompatible 2 years ago
autogen.sh distcheck: failed to write to info 3 months ago
cmp-objs.pl add cmp-objs.pl: compare binaries via xxd 2 months ago
configure.ac add 2nd geojson-validation linter support 2 weeks ago
dwg.in dwg.in: enable --as=r2004 2 months ago
dxf-allcvt.lsp dxf: rename dxf_example to dxf-allcvt 1 year ago
dxf-allcvt.sh even more shell scripts in top_srcdir 4 months ago
dxf-check indxf: fix first BLOCK_HEADER.entry 1 day ago
dxf-roundtrip.sh dxf: add dxf-check 9 months ago
dxf.in dxf: oops, enforce -y 2 months ago
dynapi_test_all.sh.in dynapi_test_all.sh: fix test-data dir 1 month ago
json-check dxf/json.test: harden the roundtrip checks 3 months ago
json.in dxf.in: enhance to more input formats 2 months ago
libredwg.pc.in add libredwg.pc 2 years ago
libredwg.spec encode: fix bit_write_DD 4 months ago
log.in log: extend to test-old files 1 month ago
logs-all-parallel.sh.in logs-all.sh: add test/test-old files 1 month ago
logs-all-serial.sh.in logs-all.sh: add test/test-old files 1 month ago
rw.in rw: support --as=r2004 2 months ago
svg.in tail -n2 log in helpers 2 months ago
test-dxf.sh test-dxf.sh: adjust for one-level outoftree builddir 2 months ago
unit_testing_all.sh.in unit-testing: silence some warnings 3 months ago
unknown.sh even more shell scripts in top_srcdir 4 months ago
valgrind-darwin.supp darwin fprintf dtoa leak 11 months ago
valgrind-linux.supp add VALGRIND_SUPPRESSIONS, check-valgrind programs 1 year ago

README

LibreDWG - free implementation of the DWG file format

LibreDWG is a free C library to read and write DWG files. This program is
part of the GNU project, released under the aegis of GNU. It is licensed
under the terms of the GNU General Public License version 3 (or at you option
any later version).

DWG is a file format created in the 70's for the emerging CAD applications.
Currently it is the native file format of AutoCAD, a proprietary CAD program
developed by AutoDesk.

LibreDWG is a fork from LibDWG due to its usage of Esperanto, which we
think is not the best strategy for a free software project which aims
to get lots of contributors. LibreDWG is written in English. At the
moment our decoder (i.e. reader) is done, just some very advanced
R2010+ and pre-R13 entities fail to read and are skipped over. The
writer is good enough for R2000. Among the example applications we
wrote using LibreDWG is a reader, a writer, a rewriter (i.e. saveas),
an initial SVG and Postscript conversion, dxf and json converters,
dwggrep to search for text, and dwglayer to print the list of layers.
More are in the pipeline.
Please contact us if you want to help.

The strings API is utf-8 (wtf8 really, Windows UCS-2 has no surrogate
pairs), and encodes to the internal 8-bit or UCS-2 strings, depending
on the DWG version.

Sometimes we hang on our IRC channel which is #libredwg at irc.freenode.net
If you don't find us there, please email the package maintainers:

Reini Urban <rurban AT cpan.org>

The now inactive founders and previous maintainers were:

Felipe Corrêa da Silva Sanches <juca AT members.fsf.org>
Rodrigo Rodrigues da Silva <pitanga AT members.fsf.org>
Hardeep Singh Rai <hardeep.rai AT gmail DOT com>

If you are looking for general information about the project, check our website:
http://www.gnu.org/software/libredwg

== Building and installing the library ==

You need the following dependencies:
- Basic development tools (a C99 compiler like gcc/clang, make, autoconf, automake
and libtool)

Optionally:

- TeXinfo for building the docs
- pslib for dwg2ps: http://pslib.sourceforge.net/doc/pslib.html
- pcre2 with 8bit and 16bit libraries for dwggrep regexp support
- SWIG 1.7+
- Python 2.7 or 3.x development headers (debian: python-dev; yum: python-devel)
and the libxml2 python bindings.
- Perl 5 for the perl bindings
- doxygen to generate the reference manual
- jq to check json validity
- shellcheck to check shell scripts
- rpmlint to check the spec validity
- jinq with some svg11 relaxng to check SVG validity.
LaTeXML used to have a broken svg11-basic.rng. If so
the zip from http://yupotan.sppd.ne.jp/relax-ng/svg11/ is correct.
Needs to be installed into /usr/local/share/relaxng/svg11/
- mapbox/geojsonhint as geojson linter
npm install -g @mapbox/geojsonhint
- geojson-validation as 2nd geojson fallback linter
npm install -g geojson-validation
- valgrind to find leaks and memory bugs
- timeout to help tests with large or hanging DWG's
- GNU parallel to speed up special tests (not the moreutils parallel!)
- picat to find unknown fields, a better prolog. http://picat-lang.org/

See INSTALL for generic instructions. Basically, you do:

$ sh ./autogen.sh (if you checked out the source code from git)
$ ./configure [--enable-trace] [--disable-write] [--disable-shared]
$ make
$ make check
$ sudo make install

This builds and installs various files in the "installation dirs":
$libdir ($exec_prefix/lib) -- library files (libredwg.*)
$includedir ($prefix/include) -- dwg.h dwg_api.h
$libdir/pkgconfig -- libredwg.pc
$infodir ($datarootdir/info) -- LibreDWG.info

Use "./configure --help" to see a full list of options you can use to
customize the installation dirs. Other options recognized by configure are:

--enable-trace

Enable runtime tracing (default: no). When enabled, the environment
variable LIBREDWG_TRACE is consulted on the first decode/encode attempt.
Its value is an integer: 0 (no output) through 9 (full verbosity).
Most tools do support an --verbosity|-v flag instead.

--disable-write

Disable DWG write support (default: no). When enabled, you activate the write
support for the DWG format.
This is an experimental feature. Rewriting most DWG's to the r2000 format
usually works fine, DWG versions since r2004 are not yet supported, and the
API usage is very rough so far.

--disable-bindings

Disable SWIG bindings for python and perl5.

--disable-dxf

Disables all in and out modules: DXF, DXFB, JSON, GeoJSON.

--enable-debug

Activates support for unstable classes. For testing only.

== Windows ==

See the following scripts how we build on Windows:

* build-aux/smoke.sh: cross-compilation recipes
* build-aux/msys2.bat: msys2 deps
* .appveyor.yml: windows smoker

We only support C99 compilers and POSIX environments, i.e. cygwin or msys or cross.
stdint.h and inttypes.h must be available.
Pre-compiled Windows binaries are here: https://github.com/LibreDWG/libredwg/releases

== Example usage of the library ==

The programs and examples directories contains some application code that uses our lib:

* dwgread -- A DWG reader supporting various output formats, such as
JSON, DXF, DXFB, GeoJSON. Later also YAML, XML/OGR, GPX, SVG, PS.

* dwgwrite -- A DWG writer supporting various input formats, such as DXF, DXFB, JSON.
GeoJSON, YAML, XML/OGR, GPX are under construction.

* dwgrewrite -- Reads a DWG, writes it back under a different name and optionally
under a different version (default r2000), and re-reads it back for confirmation.

* dwg2dxf -- Converts a DWG to a DXF (ascii or binary, minimal or full), optionally
under a different version. About 90% coverage.

* dxf2dwg -- Converts a ascii or binary DXF to a DWG (r2000 only so far).
About 80% coverage.

* dwglayers -- Prints the list of layers in a DWG. Optionally with --extnames

* dwggrep -- Searches DWG files for a text string, via regular expressions.

* dwg2ps -- Opens a DWG file and outputs an PostScript file. This code
depends on the PSlib library. On Debian-based systems this is usually
available as a package named pslib-dev. This is very limited so far.

* dwg2SVG -- Opens a DWG file and outputs an SVG (Scalable Vector Graphics)
file. SVG is a W3C standard for 2d vector graphics. You can open these
files on several free software tools. We recommend Inkscape, a free software
vector graphics editor. The dwg2SVG program will not handle 3d content
from DWG since SVG only supports 2-dimensional images. Handles only some
entities.

* dwgbmp -- Extracts the bmp thumbnail of a dwg file when it is available.

* load_dwg -- This is a skeleton code, reading the DWG and adding an entity.
Look there if you want to have a quickly glance on how to use the library.

* dwg2svg2 -- Another example how to use the DWG API, bypassing direct access to
the DWG struct.

* xmlsuite -- an extensive example library to use XML to compare against prepared
features is in the test/xmlsuite directory. It also features code to output entities
in XML, but does not use the python bindings.

Copyright (C) 2009, 2010, 2015, 2018-2020 Free Software Foundation, Inc.

This library is free software, licensed under the terms of the GNU
General Public License as published by the Free Software Foundation,
either version 3 of the License, or (at your option) any later version.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.