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

Investigate issue with text coordinate & Line weights #7

Open
Vadoola opened this issue Aug 29, 2024 · 2 comments
Open

Investigate issue with text coordinate & Line weights #7

Vadoola opened this issue Aug 29, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@Vadoola
Copy link
Owner

Vadoola commented Aug 29, 2024

Issue described by xenotek in QElectrotech forums.

I have been trying out the dxf2elmt plugin. I am using QCad that creates R15 version dxf file.

When I import the converted elmt, the lines are thin and with no text. I started to play around with with different things.

About Text
Using QCad, the text has to be simple type, then the converter imports the text. Only problem is that the all text is placed on the element hot spot. The dxf file contains the text coordinates, so the converter may be missing it. The text x and y attribute values are set to 0

About Lines
The imported lines are thin. I see in the importer source code that it looks for line weight > 0.5 to create the line-weight:normal attribute in the elmt file. My line thickness is set to 0.53mm, QCad saves this 0.53 value as 53 (0.53 x 100), so the importer misses it.

DXF sample

LINE
5
62
100
AcDbEntity
8
0
62
256
370
53 line weight
48
1.0
6
ByLayer
100
AcDbLine

Are these dxf version related issues?
Are there workarounds?

Attached the dxf for reference,

Thanks
no.zip

@Vadoola Vadoola self-assigned this Sep 5, 2024
@Vadoola Vadoola added the bug Something isn't working label Sep 5, 2024
@Vadoola
Copy link
Owner Author

Vadoola commented Oct 6, 2024

In regards to the text coordinates, the x and y values were just being set using the location, but per a DXF spec reference I was looking at if the Horizontal and/or Vertical Alignment are set to something other than default (top left) you need to use the second alignment points, and calculate the location based on the dimensions of the text, and font used etc. It looks like in the sample no.dxf since the alignment values were not default, it just set the x and y coordinates for the location to 0, since they would be ignored per the spec anyway.

@Vadoola
Copy link
Owner Author

Vadoola commented Oct 8, 2024

I did a bit of looking into the line thickness as well. It looks like the Line thickness is coming through as 0, which is why they are getting converted into Thin lines. I wonder if this is a dxf-rs issue. I'll need to dig a bit deeper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant