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.
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.
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)
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