QCAD Bugtracker

  • Status Assigned
  • Percent Complete
    0%
  • Task Type Suggestion
  • Category ECMAScript
  • Assigned To
    Andrew
  • Operating System All
  • Severity Low
  • Priority Very Low
  • Reported Version 3.32.6
  • Due in Version Undecided
  • Due Date Undecided
  • Votes 1
    • CVH (03.03.2026)
  • Private
Attached to Project: QCAD Bugtracker
Opened by CVH - 03.03.2026
Last edited by CVH - 03.03.2026

FS#2708 - getVectorTo() strictRange: Ambiguous or not used at all

strictRange by default typically RMAXDOUBLE

Expected is a vector with a magnitude strictly not larger than the given range.

But the behavior is very different in regards with the shape:
- RArc: Unused, compare strictRange with distance to center minus radius
- RLine: Only applied for non-perpendicular vectors towards the nearest endpoint if limited
- RCircle: Unused, see RArc
There is always a perpendicular vector towards an RCircle
- REllipse: Unused, there are 0-4 normals for a full or limited ellipse shape
Compare strictRange with distance to (nearest) point on ellipse ...
... At least, if that would be a point exactly on the ellipse or not a false positive
- RPoint: Unused, compare strictRange with distance to point
- RPolyline: Only applied for non-perpendicular vectors towards limited line segments
- RXLine: Unused, handled as unlimited RLine
There is always a perpendicular vector towards an RXLine
- RRay: Unused for unlimited, not passed on for limited ⇒ RMAXDOUBLE
- RSpline: Undocumented for proxy, otherwise handled as RPolyline
- ...

Turns out that for a returned valid vector one still has to verify that it is within range or not.
getDistanceTo is itself based on getVectorTo ... Doing things twice.
Or that the projected point is on the limited shape ... Also doing things twice.

Then I don’t understand the purpose as it is only implemented for an RLine (segment) when limited. And then only when the projected position is not on the limited shape.
What requires an extra diversification on perpendicular or not.

I only see a purpose for RLine.getVectorTo(pos, false, 1e-6)
What is equally tolerant for the start and end of a limited line (segment).
Except that the magnitude from the start is always exactly zero, even when near.

Regards,
CVH

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing