Paste Along Entity (PE) doesn't always use the correct start and endpoint.

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
CVH
Premier Member
Posts: 3364
Joined: Wed Sep 27, 2017 4:17 pm

Paste Along Entity (PE) doesn't always use the correct start and endpoint.

Post by CVH » Tue Nov 08, 2022 7:18 am

All,
I was investigating if this: https://www.qcad.org/rsforum/viewtopic.php?f=31&t=3909
could be integrated in Paste Along Entity (PE).
I doubt that because PE works with positions and doesn't consider the overall size of what it is pasting.
Even then, it can never work out correctly on all supported entities regarding all options.


When indicating an entity to paste on with PE it only seems it always start at the start point of that entity.
CVH wrote:
Sun Oct 30, 2022 8:08 am
The tool always starts at the beginning of the base entity.
Is thus a faulty determination that was based on the used angles.
The tool is intended to start at the indicated side what can be tested with a distance not fitting the full base, excluding endings.

On this condition for the indicated point and the nearby shape:
if (this.pos.getDistanceTo(this.shape.getEndPoint()) < this.pos.getDistanceTo(this.shape.getStartPoint()))
It detirmines to start at the begin or at the end of the entity.
Variable from is then RS.FromStart or RS.FromEnd, and notFrom is the inversed.

The endings their associated local angles are:
- Angle at start ... this.shape.getAngleAt(0.0, from|RS.AlongPolyline)
- Angle at end ... this.shape.getAngleAt(0.0, notFrom|RS.AlongPolyline)
What means that the angle values are swapped depending the indicated side.

But as start point it always includes: this.shape.getStartPoint().
And as endpoint: this.shape.getEndPoint().
Meaning that these are :!: not swapped :!:

This issue can be best visualized on an arc segment with option 'Align' and option 'Include end points' indicating beyond halfway the base entity.
PE-start-end -errors.png
PE-start-end -errors.png (4.81 KiB) Viewed 11175 times

Another issue that surfaced is that when indicating nearby at certain spots the results were not on the entity.
In fact, they are on non-visible (hidden) entities of a block from other tests, even if set not snappable.
Locked or not is here of no issue because we aren't going to alter the indicated base.
Only 'Freezing' excludes them.
Probably because this.shape = entity.getClosestShape(this.pos); returns an RShape nevertheless.

This function and thus the same pops up in different tools, below an example using Arc Area (IC)
Test-getClosestShape.dxf
(97.11 KiB) Downloaded 349 times

I suppose FS1345 is still a valid request for a new tool but in essence has nothing to do with PE as in topic 3909.
I suppose 2 bug reports are in order and a global one on excluding invisible shapes where .getClosestShape() is used.

Regards,
CVH

Post Reply

Return to “QCAD Troubleshooting and Problems”