воскресенье, 22 мая 2016 г.

Current state of libopencad

Hello.

Recently I've added SOLID geometry support, solved problem with deleted entities, and a lot of refactoring were done too. Updated tests.

Up on the list now:
1. Add reading of blocks (now only layers are supported).
2. Add reading of attributes/line types for geometries.

понедельник, 16 мая 2016 г.

ODA LWPolyline huge mistype

ODA LWPolyline geometry structure should be as follows (corrections made are bold).

Common Entity Data
       Flag
if (flag & 4) {
constwidth
}
if (flag & 8) {
elevation
}
if (flag & 2) {
thickness
}
if (flag & 1) {
}
BS 70 BD 43
BD 38
BD 39
normal
numpoints BL 90
3BD 210


if (flag & 16) {
numbulges BL
}
R2010+:
If (flag & 1024) {
vertexIdCount BL
}

R2000 | R2010+:
if (flag & 32) { // This flag presents in R2000, possible earlier and after.
numwidths BL
}
R13-R14 Only:
repeat numpoints times
pt0 2RD end repeat
R2000+:
pt0 2RD repeat numpoints-1 times
xDD
yDD end repeat
Common:
repeat numbulges times
bulge BD end repeat
repeat vertexIdCount times vertex id BL
end repeat
repeat numwidths times // So, Widths can also be presented there.
widths 2BD 
end repeat
Common Entity Handle Data

пятница, 13 мая 2016 г.

Added 3D Polyline reading support.

Greetings devs,

I have successfully implemented reading of 3D Polyline, it was not that easy because it's a 'complex' CAD object (its presented in file not like a single structure, like Circle or LWPolyline), but now it works properly (including vertexes order).

Some optimizations were done, the main unsolved problem is connected with 'deleted' entities, but I am working on it.

Best regards,
sandyre

суббота, 7 мая 2016 г.

Current state of libopencad

Hello devs,

I just have started writing handling functions for all the CAD objects, just like "Layer control" object, and others. It will help to implement writing function to the library, and to understand DWG internal structure way better.

Now, library can work with a big files (tested on 13600 geometries), but it has a few limitations - not all the returned geometries are actually drawn , because DWG stores some info about deleted objects. The only way to handle it - is to compare each object connection to one of the layers, which will be added soon.

Now supported geometries without problems:
- Line, Point, LWPolyline, Circle, Ellipse, Arc (LWPolyline with 'arced' lines also works), Text.

Best regards,
Alexandr.

суббота, 30 апреля 2016 г.

Libopencad

I have started writing a library for reading (and in far future - writing) CAD format files. The current state of the project is:
-Uniform CADGeometry type implementation, which is shared between all variety of DWG/DXF versions.

Implemented IO functions to work with DWG file data streams (such as ReadBITSHORT(), etc). Almost all data types are covered.
Successful reading of file header, object map, AcDb:Classes section, AcDb:Header section.

Current problems are: cannot calculate CRC to compare it with file stored CRC's, some problems connected with check if Object belongs to the drawing (DWG stores some info about DELETED geometries, looks like object map also stores it, so some links can be invalid, currently have no implementation of this check).

Now, library can successfully read this type of geometries: lwpolyline, point, circle, ellipse, arc, line, text.

Libopencad can be built to static library, or implemented directly via code include.
Also, there are some components which use C++11 features, so it should be compiled with -std=c++11 option.

Libopencad github: https://github.com/sandyre/libopencad

вторник, 5 апреля 2016 г.

ODA 'L' undefined data type

ODA made another mistype in their DWG specification

p.154 in data structure there is a field called Numreactors, which type is 'L', but 'L' is not defined in their data table (at the specification start).
This mistype also tooks place in other data structures below.

So, is it BL, or RL? Who knows.