Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Roadmap v0.1 #1

Open
2 of 3 tasks
nzain opened this issue Oct 21, 2019 · 3 comments
Open
2 of 3 tasks

Roadmap v0.1 #1

nzain opened this issue Oct 21, 2019 · 3 comments

Comments

@nzain
Copy link
Collaborator

nzain commented Oct 21, 2019

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 (?) :

  • Convert all line drawings from DXF object to a PDF object.
  • Convert arcs and polylines.
  • Convert style properties (color, thickness, what else?). Color mapping might not be a simple as it sounds, since the DXF colormap depends on the viewer, if I rember correctly.

Future

  • Support more DXF objects. Some objects might be terribly complex if PDF doesn't support them directly (splines?).
  • Source area selection: package consumers might know / select a region of interest that should be converted. Use case from my side: Din A4 DXF template is filled with customer data and should be printable 1:1, i.e. converted to a DinA4 PDF page.
  • Target area selection: The output size could be automatic, letter, DinA4, whatever.
  • Embedd DXF (or even partial) into existing PDF object? Think of MS Word and image insertion.
  • Clipping of source objects
  • Unicode support on PDF side Unicode Support pdf#1
  • API sugar: convert filen to file.

Looking forward to hear your thoughts!

@nzain
Copy link
Collaborator Author

nzain commented Nov 18, 2019

Basic color support is implemented in eeed69f.

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 cfcaff6.

I realized that line endings (LineCap) are always squared and some polylines look quite ugly:
image
The green one is just multiple straight segments, the red one contains arc segments.

@nzain
Copy link
Collaborator Author

nzain commented Nov 19, 2019

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.

@brettfo
Copy link
Member

brettfo commented Nov 23, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants