Strange line weight on line type

If you are having problems with QCAD, post here. Please report bugs through our Bug Tracker instead.

Always attach your original DXF or DWG file and mentions your QCAD version and the platform you are on.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
garciadelcastillo
Active Member
Posts: 28
Joined: Fri May 10, 2019 6:26 pm

Strange line weight on line type

Post by garciadelcastillo » Tue Jun 11, 2019 7:10 pm

Hi there!

Problem: when I "dwg2bmp" a file with special line types, they render very thick!

Description: running into a strange issue with line weights for non-continuous line types. If I try to rasterize the following file:
01-07a55.dwg
(30.87 KiB) Downloaded 529 times
I get this:
01-07a55.dwg.png
01-07a55.dwg.png (9.94 KiB) Viewed 7925 times
But as far as I can tell inspecting the file with a GUI, neither the lines nor the layers have any line weight associated to it. Furthermore, if I simply resave the same file with a different software and "dwg2bmp" it, I get the right rasterization:
raster.png
raster.png (9.44 KiB) Viewed 7925 times
Which property is making the line render so thick? What am I missing?

Using the following call:

Code: Select all

qrun.bat scripts\Pro\Tools\Dwg2Bmp\Dwg2Bmp.js -background=white -width=1024 -height=1024 -force -antialiasing -monochrome -color-correction -zoom-all -no-weight-margin -outfile="raster.png" .\01-07a55.dwg

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 4935
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: Strange line weight on line type

Post by Husky » Tue Jun 11, 2019 8:15 pm

garciadelcastillo wrote:
Tue Jun 11, 2019 7:10 pm
Which property is making the line render so thick? What am I missing?
That is a Polyline with customized width. That's not the layer line weight.

Husky-2019.06.11-01.png
Husky-2019.06.11-01.png (29.47 KiB) Viewed 7921 times
Work smart, not hard: QCad Pro
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."

garciadelcastillo
Active Member
Posts: 28
Joined: Fri May 10, 2019 6:26 pm

Re: Strange line weight on line type

Post by garciadelcastillo » Tue Jun 11, 2019 9:41 pm

Ooooh, I see, that makes sense. So, how could I change that through ECMAScript? I only see getters for the vertices on the RPolylineEntity class:

https://www.qcad.org/doc/qcad/latest/de ... 473dbad57c
https://www.qcad.org/doc/qcad/latest/de ... be84f33925

Thanks!

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

Re: Strange line weight on line type

Post by andrew » Wed Jun 12, 2019 10:02 am

I can confirm the setter methods are not exposed to the entity class.

You'd have to do this (where e is your RPolylineEntity object):

Code: Select all

e.castToShape().setStartWidthAt(0,7);

garciadelcastillo
Active Member
Posts: 28
Joined: Fri May 10, 2019 6:26 pm

Re: Strange line weight on line type

Post by garciadelcastillo » Fri Jun 14, 2019 8:45 am

Sounds good.

In your code, are 0 the vertex index and 7 the line width in drawing units? Should I then iterate over all vertices in the polyline, setting Start and EndWidth? How about using RPolyline.setWidth(double) to set the width of the whole thing?

Thanks a lot!

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

Re: Strange line weight on line type

Post by andrew » Fri Jun 14, 2019 10:28 pm

garciadelcastillo wrote:
Fri Jun 14, 2019 8:45 am
In your code, are 0 the vertex index and 7 the line width in drawing units?
Yes.
garciadelcastillo wrote:
Fri Jun 14, 2019 8:45 am
How about using RPolyline.setWidth(double) to set the width of the whole thing?
That would be setGlobalWidth(double).

Post Reply

Return to “QCAD Troubleshooting and Problems”