[solved] Can you point me to the file where lineweights are defined?

Use this forum for all posts and questions about the free QCAD Community Edition version 3

Moderator: andrew

Post Reply
simplify
Newbie Member
Posts: 4
Joined: Thu Sep 27, 2018 12:08 am

[solved] Can you point me to the file where lineweights are defined?

Post by simplify » Thu Sep 27, 2018 12:24 am

My university recently bought an Universal Laser Systems (ULS) ILS12.150D which supports PDF File Format Direct File Import. (This is a laser cutter.)

In QCAD v3.21.2.9-27-g27ada28e1 on Linux, I'm converting my DXF (created in OpenSCAD) to a PDF by using "File > PDF Export". QCAD performs the "final touches" on my 2D parts.

I encounter a snag: The ULS control software requires lines in the PDF to be 0.025 mm lineweight to produce vector output. The thinnest lineweight provided in my version of QCAD is .05 mm. I verified that the lineweight QCAD produced is .05 mm by measuring the line's width in Inkscape.

I would like to add another lineweight to QCAD and rebuild the source, but I can not find the file where the lineweights are defined. Can you point me to this file?

simplify
Newbie Member
Posts: 4
Joined: Thu Sep 27, 2018 12:08 am

Re: Can you point me to the file where lineweights are defined?

Post by simplify » Thu Sep 27, 2018 2:15 am

I found the changes I needed to make, and I made them, but the new lineweight is being interpreted as ~.21 mm when I viewed it in Inkscape. I don't know how to make the code know "2" is in the hundred's place and the "5" is in the thousant's place.

Code: Select all

    Add lineweight ULS control program requires for producing vector output

diff --git a/src/core/RLineweight.cpp b/src/core/RLineweight.cpp
index a9092e767..21270d5b1 100644
--- a/src/core/RLineweight.cpp
+++ b/src/core/RLineweight.cpp
@@ -36,6 +36,7 @@ void RLineweight::init() {
         init(tr("By Block"), RLineweight::WeightByBlock);
         init(tr("Default"), RLineweight::WeightByLwDefault);
         init(tr("0.00mm"), RLineweight::Weight000);
+        init(tr("0.025mm"), RLineweight::Weight0025);
         init(tr("0.05mm"), RLineweight::Weight005);
         init(tr("0.09mm"), RLineweight::Weight009);
         init(tr("0.13mm (ISO)"), RLineweight::Weight013);
diff --git a/src/core/RLineweight.h b/src/core/RLineweight.h
index 77cb284e2..4eaaceaeb 100644
--- a/src/core/RLineweight.h
+++ b/src/core/RLineweight.h
@@ -45,6 +45,7 @@ class QCADCORE_EXPORT RLineweight {
 public:
     enum Lineweight {
         Weight000 = 0,
+        Weight0025 = 025,
         Weight005 = 5,
         Weight009 = 9,
         Weight013 = 13,

User avatar
andrew
Site Admin
Posts: 9037
Joined: Fri Mar 30, 2007 6:07 am

Re: Can you point me to the file where lineweights are defined?

Post by andrew » Thu Sep 27, 2018 8:48 am

Try:

Code: Select all

Weight0025 = 25
025 in C++ would be the octagonal number 25 which is 21, i.e. 0.21mm.

simplify
Newbie Member
Posts: 4
Joined: Thu Sep 27, 2018 12:08 am

Re: Can you point me to the file where lineweights are defined?

Post by simplify » Thu Sep 27, 2018 10:03 pm

Trying this code
andrew wrote:
Thu Sep 27, 2018 8:48 am
Try:

Code: Select all

Weight0025 = 25
025 in C++ would be the octagonal number 25 which is 21, i.e. 0.21mm.
results in 0.25 mm, but I need my number to be one magnitude smaller, i.e. 0.025 mm.

User avatar
andrew
Site Admin
Posts: 9037
Joined: Fri Mar 30, 2007 6:07 am

Re: Can you point me to the file where lineweights are defined?

Post by andrew » Thu Sep 27, 2018 10:31 pm

Ah, yes, my bad. You're out of luck. Your value would have to be 2.5 (i.e. 2.5 hundredths) which won't work for the C++ enum.
In any case, even if you could do it, you wouldn't be able to write that back into a (valid) DXF file.

The only way I can think of (without adjusting lots of code and in the process breaking the DXF standard) is to use custom widths for polylines. However, this is only implemented in QCAD Professional:
viewtopic.php?f=47&t=4534&p=16517#p16517

You might want to try this with the free trial version:
https://qcad.org/en/download

simplify
Newbie Member
Posts: 4
Joined: Thu Sep 27, 2018 12:08 am

Re: Can you point me to the file where lineweights are defined?

Post by simplify » Fri Sep 28, 2018 12:25 am

Thank you for the explanation!

Today I learned the ULS control software is interpreting 0.01 and 0.02 mm lines as "vector data". And, I found this in Chapter 04 of the ULS manual: "In order to print vector elements, the software you are printing from must support creation of lines with a thickness of .001”(.0254 mm) or less."

My issue is solved.

Post Reply

Return to “QCAD Community Edition”