Open nzain opened 5 years ago
Basic color support is implemented in eeed69faee59c7eb3aab1734fd8dab227d5d52a0.
I have no idea how to convert DxfLineWeight
(just a short
) to a meaningful PDF unit. Any idea?
Some more interesting entities (DxfCircle
, DxfArc
, DxfLwPolyline
including bulge) are now supported with cfcaff676dcebc5b9c27ab0ec1aa06dca974b207.
I realized that line endings (LineCap) are always squared and some polylines look quite ugly: The green one is just multiple straight segments, the red one contains arc segments.
The LineWeightEnum
is the only thing you can specify for a layer, which is what we/our customers usually do. You're right, all geometric entities seem to have a Thickness
, but as far as my QCad tests go, this value is always zero. Setting a line's width to explicit 1mm, the short value becomes 100, but Thickness remains zero.
I've added initial text support as well, but it doesn't look very similar to the original DXF. Now font dictionaries, font size, vertical and horizontal alignment come into play. Not to mention encoding, which is really too far away right now. You won't find any unit tests, since I don't know what to expect... my PDF application is my terrible test.
I've been looking through the DXF spec and may have an answer about DxfLineWeight
. While the line weight value listed for LAYER
doesn't give any details, there is more information in the header that may be relevant. Check here under the variables $DIMLWD
and $DIMLWE
. According to that a non-zero number represents 1/100th of a mm which explains your case of 100
=> 1mm.
Edit: added a doc comment in ixmilia/dxf here.
This issue shall kick off discussions & brainstorming about potential features and hopefully allows to create an intuitive and consistent API from the very start. This may include crazy-complex features that will never make it into this project, but its healthy for the API to think about them, at least.
Lets start with low hanging fruits (or maybe not) for the first version v0.1 (?) :
Future
Looking forward to hear your thoughts!