Selecting Hatch Causes Lag

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
John Hyslop
Premier Member
Posts: 474
Joined: Mon Sep 30, 2019 6:21 am
Location: Melbourne - Australia

Selecting Hatch Causes Lag

Post by John Hyslop » Thu Oct 06, 2022 4:59 am

Hi Andrew

I have a problem with this release.
Version: 3.27.7.0 (3.27.7)
Build Date: Sep 30 2022
Revision: 62d387f
Qt Version: 5.14.2
Architecture: x86_64
Compiler: gcc 5.4.0

Extreme Lag When Selecting Solid or Pattern Hatch

Version: 3.27.6.0 (3.27.6)
Build Date: May 17 2022
Revision: 39d0e9f
Qt Version: 5.14.2
Architecture: x86_64
Compiler: gcc 5.4.0

No Lag On Previous Version

QCAD.BIN file grew to 4.4Gig Yesterday e_surprised

I have PC with below specs..
.
PC-Specs.png
PC-Specs.png (32.73 KiB) Viewed 5761 times
Sample ScreenShot.png
Sample ScreenShot.png (149.18 KiB) Viewed 5761 times
.
.
Sample DXF File Attached..

Sample-File.dxf
(229.06 KiB) Downloaded 274 times
.
.
.
Cheers
John
IF IT IS TO BE IT IS UP TO ME [ Ten most powerful 2 letter words ]

CVH
Premier Member
Posts: 3470
Joined: Wed Sep 27, 2017 4:17 pm

Re: Selecting Hatch Causes Lag

Post by CVH » Thu Oct 06, 2022 5:33 am

John,
Gonna stick to 3.27.6.0 for the moment ...
Can you tell me if the hatch area is an Info Tool or a Property.
For the latter, does it help to turn off showing all properties?

BTW, the exact surface of your example hatch is 156200.88815692252mm² in full floating point notation.
The new area calculation chops your 480 arcs in 158 line segments each.
Including the straight lines, the boundaries are then defined by 76324 segments.

Regards,
CVH

John Hyslop
Premier Member
Posts: 474
Joined: Mon Sep 30, 2019 6:21 am
Location: Melbourne - Australia

Re: Selecting Hatch Causes Lag

Post by John Hyslop » Thu Oct 06, 2022 5:53 am

CVH wrote:
Thu Oct 06, 2022 5:33 am

BTW, the exact surface of your example hatch is 156200.88815692252mm² in full floating point notation.
The new area calculation chops your 480 arcs in 158 line segments each.
Including the straight lines, the boundaries are then defined by 76324 segments.
LOL I have no idea what the above means? All I simply did was left click to select the hatch and it lagged for a bit
I also tried it in the "Layer List > Select Layer Entities" but that did the same..
FYI I Made a Grid of Rectangles "which had no lag when filled" Then I used your Round Polyline Tool to radius all the corners
to see the difference... e_surprised :D

Cheers
John
PS Not blaming the Tool.. it was just a quick way for me to test with radii.. :D
IF IT IS TO BE IT IS UP TO ME [ Ten most powerful 2 letter words ]

CVH
Premier Member
Posts: 3470
Joined: Wed Sep 27, 2017 4:17 pm

Re: Selecting Hatch Causes Lag

Post by CVH » Thu Oct 06, 2022 6:11 am

The question remains.
Can you tell me if the hatch area is an Info Tool or a Property.

Regards,
CVH

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

Re: Selecting Hatch Causes Lag

Post by Husky » Thu Oct 06, 2022 6:27 am

@ CVH
CVH wrote:
Thu Oct 06, 2022 6:11 am
The question remains.
Can you tell me if the hatch area is an Info Tool or a Property.
Answering that question will not change the fact that his "what ever he did" works fine in 3.27.6 but not in 3.27.7



@John
John Hyslop wrote:
Thu Oct 06, 2022 4:59 am
Extreme Lag When Selecting Solid or Pattern Hatch
John Hyslop wrote:
Thu Oct 06, 2022 4:59 am
No Lag On Previous Version
Yep, confirmed. :( :( :( Do you still remember the drill? :lol: :lol: :lol:
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..."

John Hyslop
Premier Member
Posts: 474
Joined: Mon Sep 30, 2019 6:21 am
Location: Melbourne - Australia

Re: Selecting Hatch Causes Lag

Post by John Hyslop » Thu Oct 06, 2022 6:39 am

IF IT IS TO BE IT IS UP TO ME [ Ten most powerful 2 letter words ]

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

Re: Selecting Hatch Causes Lag

Post by Husky » Thu Oct 06, 2022 6:40 am

Thank you! :wink:
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..."

John Hyslop
Premier Member
Posts: 474
Joined: Mon Sep 30, 2019 6:21 am
Location: Melbourne - Australia

Re: Selecting Hatch Causes Lag

Post by John Hyslop » Thu Oct 06, 2022 7:02 am

CVH wrote:
Thu Oct 06, 2022 6:11 am
The question remains.
Can you tell me if the hatch area is an Info Tool or a Property.

Regards,
CVH
It's irrelevant... left click select starts the lag before any tool selection is made ,did you try yourself? :?

Cheers
John
IF IT IS TO BE IT IS UP TO ME [ Ten most powerful 2 letter words ]

CVH
Premier Member
Posts: 3470
Joined: Wed Sep 27, 2017 4:17 pm

Re: Selecting Hatch Causes Lag

Post by CVH » Thu Oct 06, 2022 7:28 am

John Hyslop wrote:
Thu Oct 06, 2022 7:02 am
did you try yourself?
No, Gonna stick to 3.27.6.0 for the moment ... But I will turn to PM.

For me it seems obvious.
Selecting a hatch displays properties of that hatch.
Since .7 a new area property may be included.

But it seems that my knowledge is not welcome.

Cheers to John,
CVH

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

Re: Selecting Hatch Causes Lag

Post by andrew » Thu Oct 06, 2022 9:09 am

Computing the area property for this hatch is slow. I will change this to a property on request for the next release.

CVH
Premier Member
Posts: 3470
Joined: Wed Sep 27, 2017 4:17 pm

Re: Selecting Hatch Causes Lag

Post by CVH » Thu Oct 06, 2022 7:46 pm

Thanks Andrew, and to confirm that it is indeed implemented as a Property.
Kinda expected this since Jun 29. (https://github.com/qcad/qcad/commit/99a ... 4fae3dbe8d)

I have 'Always show all properties' active.
Is the advice then to disable this before installing 3.27.8?

Question: How much faster/slower is InfoAreaCentroid.prototype.getHatchedArea()?
This doesn't interpolate arc segments, the centroids and their areas methods can handle polylines with bulges.

There will be a minute difference in value and somewhat more pronounced with small radii.
It doesn't cut the corners off ... :lol:
On top, it has a corrected running sum method.

I remarked that calculating the Centroid for John's example was almost instantaneously.
That does two major things: A) Calculating the hatched area and B) Calculating the centroid position.
Both are pretty demanding with many points, See: https://qcad.org/rsforum/viewtopic.php? ... 084#p35080
The main reason why I created it as a Info Tool and never dared to propose it as Properties.

Regards,
CVH

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

Re: Selecting Hatch Causes Lag

Post by andrew » Thu Oct 06, 2022 8:04 pm

CVH wrote:
Thu Oct 06, 2022 7:46 pm
I have 'Always show all properties' active.
Is the advice then to disable this before installing 3.27.8?
Depends. Many people pretty much only look at the area of hatches that are more or less rectangles (property management) which was the main reason for this area feature.
CVH wrote:
Thu Oct 06, 2022 7:46 pm
Question: How much faster/slower is InfoAreaCentroid.prototype.getHatchedArea()?
This doesn't interpolate arc segments, the centroids and their areas methods can handle polylines with bulges.
Yes, this might be the proper way of doing it. Unfortunately, that code lives in JavaScript, i.e. would need to be ported to C++ for an entity property. It also looks rather involved (i.e. went right over my head). I might dive into it when time allows (it doesn't).

CVH
Premier Member
Posts: 3470
Joined: Wed Sep 27, 2017 4:17 pm

Re: Selecting Hatch Causes Lag

Post by CVH » Thu Oct 06, 2022 8:54 pm

andrew wrote:
Thu Oct 06, 2022 8:04 pm
Yes, this might be the proper way of doing it.
It's almost a copy of yours ... basically.
But it does much more to be honest.

- All area methods and centroid methods for any shape are included.
- For Hatches it orders boundaries CW/CWW to get the sign right (hatched area or hole).
- Checks for self-intersections.
The tolerances used with/without bulges is based on practical tests with no to none false positives.
- Projects boundaries shapes to enclose the origin so that arcs shapes from bulges are as correct as possible.
- Calculating based on polygons and adds/subtracts arc segments representing the local bulge.
- Uses a 'generalized Kahan–Babuška-Summation-Algorithm' proposed by Klein for the shoelace algorithm and other running sums.

The final ways that worked out perfectly for areas are further adapted to code centroids.

In many occasions the area results are corresponding up to a certain number of digits.
That may depend on position in the plane.
And in my case a circle R0.2 is not interpolated as a hexagon. :wink:
The surface of an arc segment is rather straightforward, even with tiny radii.

Regards,
CVH

CVH
Premier Member
Posts: 3470
Joined: Wed Sep 27, 2017 4:17 pm

Re: Selecting Hatch Causes Lag

Post by CVH » Tue Oct 18, 2022 5:19 pm

All,
John Hyslop wrote:
Thu Oct 06, 2022 4:59 am
Extreme Lag When Selecting Solid or Pattern Hatch
On Oct 14 Andrew reverted back from interpolating Arc segments with tiny line segments.
John's example will cause little to no delay for the newly added hatch properties. :P
Arcs with small radii are now also supported. :P
Husky wrote:
Tue Oct 11, 2022 8:32 am
Wie ich feststellen muss hast Du offensichtlich nicht verstanden was die Funktion ausliest.
Meanwhile Andrew fixed the length property that will show the originally (3.27.7) intended length of all boundaries.
With a hatch pattern QCAD 3.27.8 returned the total length of all the pattern line segments. :?
https://qcad.org/bugtracker/index.php?d ... sk_id=2408

All that is for the next release/snapshot. :wink:

@ Andrew:
Does that mean that RHatchData proxy is updated to handle 'no segmentation' = -1.0?
At the time I coded Centroids a value of 0 or -1 crashed QCAD.
See remark in InfoAreaCentroid.js line 1705 :wink:

Regards,
CVH

Post Reply

Return to “QCAD Troubleshooting and Problems”