All Projects → sandyre → Libopencad

sandyre / Libopencad

Licence: mit
OpenSource library under X/MIT license to work with CAD files (DWG/DXF). Please use repository linked below, this one is abandoned.

Projects that are alternatives of or similar to Libopencad

Freecad
This is the official source code of FreeCAD, a free and opensource multiplatform 3D parametric modeler. Issues are managed on our own bug tracker at https://www.freecadweb.org/tracker
Stars: ✭ 10,366 (+6951.7%)
Mutual labels:  cad
Slidehub
SlideHub is an Open Source Slide Sharing Application for Azure / AWS
Stars: ✭ 120 (-18.37%)
Mutual labels:  mit-license
Hfsm2
High-Performance Hierarchical Finite State Machine Framework
Stars: ✭ 134 (-8.84%)
Mutual labels:  mit-license
Psrealvehicle
Plugin for Unreal Engine 4 with simple force-driven vehicle simulation
Stars: ✭ 92 (-37.41%)
Mutual labels:  mit-license
Leocad
A CAD application for creating virtual LEGO models
Stars: ✭ 1,782 (+1112.24%)
Mutual labels:  cad
Tsugite
This is the repository of a Tsugite. It is a research prototype of an interactive software that supports the design and fabrication of wood joints.
Stars: ✭ 134 (-8.84%)
Mutual labels:  cad
Pyocct
Python bindings for OpenCASCADE via pybind11.
Stars: ✭ 87 (-40.82%)
Mutual labels:  cad
La Capitaine Icon Theme
La Capitaine is an icon pack designed to integrate with most desktop environments. The set of icons takes inspiration from the latest iterations of macOS and Google's Material Design.
Stars: ✭ 1,858 (+1163.95%)
Mutual labels:  mit-license
Indicators
Activity Indicators for Modern C++
Stars: ✭ 1,838 (+1150.34%)
Mutual labels:  mit-license
Cavaliercontours
2D polyline library for offsetting, combining, etc.
Stars: ✭ 135 (-8.16%)
Mutual labels:  cad
Measureit arch
An expansion of Antonio Vazquez's MeasureIt addon to add features to create Architectural Drawings in Blender 2.8
Stars: ✭ 93 (-36.73%)
Mutual labels:  cad
Tlaplus
TLC is an explicit state model checker for specifications written in TLA+. The TLA+Toolbox is an IDE for TLA+.
Stars: ✭ 1,618 (+1000.68%)
Mutual labels:  mit-license
Whatsapp Bulk Sender
Send bulk messages right from your WhatsApp Android Client or WhatsApp Web
Stars: ✭ 135 (-8.16%)
Mutual labels:  mit-license
Zcad
Simple CAD program
Stars: ✭ 91 (-38.1%)
Mutual labels:  cad
Ore Infinium
Ore Infinium, Open Source multiplayer Terraria-inspired Sci-fi game, focused on technology, devices and researching. Written in Kotlin (JVM), LibGDX. Cross platform
Stars: ✭ 139 (-5.44%)
Mutual labels:  mit-license
Libcrtc
WebRTC C++ library built on top of chromium webrtc.
Stars: ✭ 89 (-39.46%)
Mutual labels:  mit-license
Jcsg
Java implementation of BSP based CSG (Constructive Solid Geometry)
Stars: ✭ 121 (-17.69%)
Mutual labels:  cad
Jquery jeditable
jQuery edit in place plugin. Extendable via plugin architecture. Plugins for plugin. Really.
Stars: ✭ 1,756 (+1094.56%)
Mutual labels:  mit-license
Vaadin On Kotlin
Writing full-stack statically-typed web apps on JVM at its simplest
Stars: ✭ 141 (-4.08%)
Mutual labels:  mit-license
Solvespace
Parametric 2d/3d CAD
Stars: ✭ 1,948 (+1225.17%)
Mutual labels:  cad

libopencad

Ubuntu 14.04 (gcc 4.8 + clang): Build Status

OpenSource library under X11/MIT license for everyday use. Under development, but some of basic functionality is already available. This project is being developed by Alexandr Borzykh (sandyre) under mentorship of Dmitry Baryshnikov (NextGIS).

Current project state:

DWG Read Write Features Missing
R13-14 - - - -
R15 + - Reading of layers.Basic geometry reading. Exporting header variables and classes. Linetypes, CRC calculation, by-block reading.
R17 - - - -

Getting started

First you need to download repository

git clone https://github.com/sandyre/libopencad

Static library way

Then, run cmake

cmake CMakeLists.txt

Build the project

make -j4

At this point, you will have a static library at lib/libopencadstatic.(your OS static library extension) All you have to do now - is to link library with your project, and include associated header files - opencad_api.h, cadgeometries.h and others.

Dynamic library way

Then, run cmake

cmake -DBUILD_SHARED_LIBS=ON CMakeLists.txt

Build the project

make -j4

At this point, you will have a dynamic library at lib/libopencad{library version}.(your OS dynamic library extension) All you have to do now - is to link library with your project, and include associated header files - opencad_api.h, cadgeometries.h and others.

Library sources inclusion way

All you have to do is to link the lib/ directory to your project file tree, that's actually it.

Usage example

As an example of library usage, there is a built-in app called cadinfo (builds by default with library, available in apps/ directory).

#include <iostream>
# include "lib/opencad_api.h"

// returns nullptr on fail. GetLastErrorCode() returns an error code.
CADFile *pCADFile = OpenCADFile( pszCADFilePath,
                                      CADFile::OpenOptions::READ_ALL );

const CADHeader& header = pCADFile->getHeader ();
header.print (); // prints CAD Header variables.
cout << endl;

const CADClasses& classes = pCADFile->getClasses ();
classes.print (); // prints custom CAD classes
cout << endl;

for ( size_t i = 0; i < pCADFile->getLayersCount (); ++i )
{
    CADLayer &layer = pCADFile->getLayer (i);
    cout << "Layer #" << i << " contains "
         << layer.getGeometryCount () << " geometries" << endl;

    for ( size_t j = 0; j < layer.getGeometryCount (); ++j )
    {
        unique_ptr<CADGeometry> geom(layer.getGeometry (j));

        if ( geom == nullptr )
            continue;

        switch ( geom->getType() ) // returns GeometryType enum.
        {
            case CADGeometry::CIRCLE:
                CADCircle * poCADCircle = ( CADCircle* ) geom.get();
                std::cout << poCADCircle->getPosition().getX() << std::endl;
                std::cout << poCADCircle->getPosition().getY() << std::endl;
                std::cout << poCADCircle->getPosition().getZ() << std::endl;
                break;
            // any other geometry type you need.
        }
    }
}

Contribution

Feel free to submit an issue, or make a pull request. To begin with, it's better to fix some FIXME/TODO's, to get more familiar with code base.

Library documentation

Documentation is generated by Doxygen, available at this link

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].