- Status Assigned
- Percent Complete
- Task Type Bug Report
- Category QCAD (main)
-
Assigned To
andrew - Operating System All
- Severity Low
- Priority Very Low
- Reported Version n/a
- Due in Version Undecided
-
Due Date
Undecided
- Votes
- Private
FS#2751 - RArc::getVectorTo(point) does not exclude point at center with infinite solutions
Version: Since initial commit of QCAD3.
Current art: https://github.com/qcad/qcad/blob/master/src/core/math/RArc.cpp
For a point coinciding with the center, getAngleTo() at line 788 returns zero by default.
For an arc starting at, ending at or spanning over orientation zero
(verified and not excluded by line 789-791)
the method returns a defined point on the arc at zero rads.
Analog to RCircle::getVectorTo there are infinite solutions and thus none well defined.
The RCircle method excludes a point at the center and returns an invalid RVector.
… However:
Comparing the SquaredMagnitude() with 1e-18 is fundamentally incorrect (FS#2741)
Correctly squaring both sides of (|d - v| < tol) results in: ((d - v)² < tol²)
And this expands to: (d² - 2dv + v² < tol²) where one still needs to know the magnitude.
… Additionally:
getAngleTo() returns zero by default when the two points are 1e-6 units or less apart.
A factor thousand times larger than RS.PointTolerance.
This can still result in a defined point on the arc at zero rads for
points at a distance between 1e-9 to 1e-6 from the center.
As like all getVectorTo() methods it is a key resource.
RArc::getClosestPointOnShape() can for example return a false solution.
Fixing this may for example break InfoDistanceEP.prototype.pickCoordinate or RSnapPerpendicular::snapEntity …
… Only if you manage to indicate really near the center of an arbitrary arc.
Then RSnapPerpendicular::snapEntity has no solution for a circle and its center.
But it has a solution at zero rads for an arc.
Regards,
CVH
Loading...
Available keyboard shortcuts
- Alt + ⇧ Shift + l Login Dialog / Logout
- Alt + ⇧ Shift + a Add new task
- Alt + ⇧ Shift + m My searches
- Alt + ⇧ Shift + t focus taskid search
Tasklist
- o open selected task
- j move cursor down
- k move cursor up
Task Details
- n Next task
- p Previous task
- Alt + ⇧ Shift + e ↵ Enter Edit this task
- Alt + ⇧ Shift + w watch task
- Alt + ⇧ Shift + y Close Task
Task Editing
- Alt + ⇧ Shift + s save task