Git Product home page Git Product logo

adg's Introduction

General information

Pipeline Status Coverage Status

Automatic Drawing Generation is GObject-based library that provides a non-interactive cairo canvas specifically designed for generating technical drawings. It can be viewed as a 2D CAD without user interface.

If you want to develop an application that needs to show and print drawings where some data change but the overall design is similar, the ADG library can be quite useful. In manufacturing industries this is often the case and an ADG-based application could help to greatly improve the productivity of technical offices.

You could reach similar targets using parametric CADs but a custom application provides the following benefits:

  • more customizable;
  • quicker and not so bloated as a parametric CAD;
  • can be easily connected to a database;
  • an ADG based filter can generate drawing on-fly: this feature could be used in web-based applications.

Visit the ADG web site for further details.

Design overview

The project is based on the GObject library: the ADG canvas is developed in plain C using an object-oriented approach. Applications based on ADG are not expected to be developed in C, though: the basic idea is to have a set of bindings for higher level languages (the garbage-collected ones, above all). An application can then be developed using any specific language available, much in the same way as GNOME applications are conceived.

Lua bindings based on LGI are already availables and effectively used upstream to test the APIs. The adg-lua project provides code examples on how to use them. A modern web approach is shown by the adg-openresty project, where the Lua bindings are directly used inside an NGINX webserver.

The mathematical and geometrical algorithms, together with a bunch of other useful functions for manipulating cairo paths, are kept in a separated library called CPML (Cairo Path Manipulation Library). Although actually embedded into the ADG project, this library can be easily splitted on its own, if needed.

The rendering leverages cairo, so the ADG canvas fully shares strong and weak points of that library. Most notably, the availables export formats include PostScript, SVG, PDF, PNG but no CAD specific ones (such as DXF).

External dependencies

The ADG library has the following dependencies:

  • cairo 1.7.4 or later, required by both CPML and ADG;
  • GLib 2.38.0 or later, required by ADG;
  • GTK 3.0.0 or later (or GTK 2.18.0 or later for GTK2 support) to optionally include GTK support and build the adg-demo program;
  • pango 1.10.0 or later (optional) to support a serious engine for rendering text instead of using the cairo "toy" APIs (only the pango-cairo module will be used);
  • gtk-doc 1.12 or later (optional), used to regenerate the API documentation;
  • GObject introspection 1.0.0 or later (optional) to dinamically generate bindings metadata.

The required packages must be installed prior the ADG building: they should be availables on nearly every decent unix-like system.

The ADG is mainly developed on GNU/Linux but its dependecies are known to be cross platform so a porting should be quite easy, if not automatic.

Installation

The ADG build system is based on meson but a legacy autotools based system is still supported.

The following instructions are included only for reference: you are expected to customize and install the ADG in the way you prefer. Just remember (if you are copying and pasting) to put the proper package version instead of 0.9.4 and to select the appropriate commands for meson or autotools based builds.

  1. Unpack the ADG tarball somewhere in your file system: your home folder is a good candidate. You can get the latest tarball from GitHub.
    # For meson-based builds
    wget https://github.com/ntd/adg/releases/download/0.9.4/adg-0.9.4.tar.xz
    tar xf adg-0.9.4.tar.xz
    cd adg-0.9.4
    # For autotools-based builds
    wget https://github.com/ntd/adg/releases/download/0.9.4/adg-0.9.4.tar.bz2
    tar xf adg-0.9.4.tar.bz2
    cd adg-0.9.4
    
  2. Configure and run the build using meson or autotools (the former only available on adg >= 0.9.4). The autotools build system will be dropped somewhere in the future.
    # Using meson
    meson build
    cd build
    ninja
    # Using autotools (VPATH build)
    mkdir build && cd build
    ../configure
    make
    
  3. Once the building has finished, you are able to run the demo program without installing anything. Just try it out by launching the uninstalled executable:
    demo/adg-demo
    
  4. Permanently install the ADG. You must usually have root privileges if you intend to install it in your system folders.
    # Using meson
    ninja intall
    # Using autotools
    make install
    

adg's People

Contributors

ntd avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

adg's Issues

building demo fails on FC13

Hi,

I get the following when trying to build on my FC13 (updated):

... ## adg-1 0.8.0 will be built with the following options:
            CPML library to use: internal (cpml-0.8.0)
     Build pango based entities: yes (pangocairo-1.28.0)
                   GTK+ support: gtk2 (gtk+-2.20.1)
         Install glade catalogs: no
            Build API reference: no
         GObject instrospection: no
            Test coverage build: no
         Test framework support: yes (glib-2.24.1)

[bert@vortex adg]$ make
GEN README
GEN NEWS
GEN TODO
GEN CONTRIBUTING
GEN HACKING
make all-recursive
make[1]: Entering directory /home/bert/workspace/git/adg' Making all in src make[2]: Entering directory/home/bert/workspace/git/adg/src'
make all-recursive
make[3]: Entering directory /home/bert/workspace/git/adg/src' Making all in tests make[4]: Entering directory/home/bert/workspace/git/adg/src/tests'
make[4]: Nothing to be done for all'. make[4]: Leaving directory/home/bert/workspace/git/adg/src/tests'
Making all in cpml
make[4]: Entering directory /home/bert/workspace/git/adg/src/cpml' make all-recursive make[5]: Entering directory/home/bert/workspace/git/adg/src/cpml'
Making all in tests
make[6]: Entering directory /home/bert/workspace/git/adg/src/cpml/tests' make[6]: Nothing to be done forall'.
make[6]: Leaving directory /home/bert/workspace/git/adg/src/cpml/tests' make[6]: Entering directory/home/bert/workspace/git/adg/src/cpml'
CC cpml-arc.lo
CC cpml-curve.lo
CC cpml-extents.lo
CC cpml-line.lo
CC cpml-pair.lo
CC cpml-primitive.lo
CC cpml-segment.lo
CC cpml-utils.lo
CC cpml-gobject.lo
CCLD libcpml-1.la
make[6]: Leaving directory /home/bert/workspace/git/adg/src/cpml' make[5]: Leaving directory/home/bert/workspace/git/adg/src/cpml'
make[4]: Leaving directory /home/bert/workspace/git/adg/src/cpml' Making all in adg make[4]: Entering directory/home/bert/workspace/git/adg/src/adg'
GEN adg-type-builtins.h
GEN adg-marshal.h
make all-recursive
make[5]: Entering directory /home/bert/workspace/git/adg/src/adg' Making all in tests make[6]: Entering directory/home/bert/workspace/git/adg/src/adg/tests'
make[6]: Nothing to be done for all'. make[6]: Leaving directory/home/bert/workspace/git/adg/src/adg/tests'
make[6]: Entering directory /home/bert/workspace/git/adg/src/adg' CC adg-adim.lo CC adg-alignment.lo CC adg-arrow.lo CC adg-cairo-fallback.lo CC adg-canvas.lo CC adg-color-style.lo CC adg-container.lo CC adg-dash.lo CC adg-dim.lo CC adg-dim-style.lo CC adg-dress.lo CC adg-edges.lo CC adg-entity.lo CC adg-enums.lo CC adg-fill-style.lo CC adg-font-style.lo CC adg-hatch.lo CC adg-ldim.lo CC adg-line-style.lo CC adg-logo.lo CC adg-marker.lo CC adg-matrix.lo CC adg-model.lo CC adg-param-dress.lo CC adg-path.lo CC adg-point.lo CC adg-projection.lo CC adg-rdim.lo CC adg-ruled-fill.lo CC adg-stroke.lo CC adg-style.lo CC adg-table.lo CC adg-table-cell.lo CC adg-table-row.lo CC adg-table-style.lo CC adg-textual.lo CC adg-title-block.lo CC adg-trail.lo CC adg-toy-text.lo CC adg-utils.lo CC adg-gtk-area.lo CC adg-gtk-layout.lo CC adg-gtk-utils.lo CC adg-pango-style.lo CC adg-text.lo GEN adg-type-builtins.c CC adg-type-builtins.lo GEN adg-marshal.c CC adg-marshal.lo CCLD libadg-1.la make[6]: Leaving directory/home/bert/workspace/git/adg/src/adg'
make[5]: Leaving directory /home/bert/workspace/git/adg/src/adg' make[4]: Leaving directory/home/bert/workspace/git/adg/src/adg'
make[4]: Entering directory /home/bert/workspace/git/adg/src' make[4]: Leaving directory/home/bert/workspace/git/adg/src'
make[3]: Leaving directory /home/bert/workspace/git/adg/src' make[2]: Leaving directory/home/bert/workspace/git/adg/src'
Making all in demo
make[2]: Entering directory /home/bert/workspace/git/adg/demo' CC adg_demo_uninstalled-adg-demo.o In file included from adg-demo.c:21: ../src/adg.h:24:27: error: cairo-gobject.h: No such file or directory make[2]: *** [adg_demo_uninstalled-adg-demo.o] Error 1 make[2]: Leaving directory/home/bert/workspace/git/adg/demo'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/bert/workspace/git/adg'
make: *** [all] Error 2
[bert@vortex adg]$
...

Kind regards,
Bert Timmerman.

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.