Fix:path conflictcheck

Coincident lines are considered as intersecting
jira:STUDIO-14085

Change-Id: I1487e6e2479e2488a3fd55651b8b4fb1bc1f4ced
(cherry picked from commit 2348328a96a8d805c35cae8f03ebaa0869b1313e)
This commit is contained in:
jiangkai.zhao
2025-08-19 11:24:39 +08:00
committed by Noisyfox
parent 69b2b5d86d
commit 6923230495
3 changed files with 18 additions and 2 deletions

View File

@@ -288,6 +288,9 @@ ConflictComputeOpt ConflictChecker::line_intersect(const LineWithID &l1, const L
constexpr double SUPPORT_THRESHOLD = 100; // this large almost disables conflict check of supports
constexpr double OTHER_THRESHOLD = 0.01;
if (l1._id == l2._id) { return {}; } // return true if lines are from same object
double overlap_length = 0.;
bool overlap = l1._line.overlap(l2._line, overlap_length);
if (overlap && overlap_length > scaled(OTHER_THRESHOLD)) return std::make_optional<ConflictComputeResult>(l1._id, l2._id);
Point inter;
bool intersect = l1._line.intersection(l2._line, &inter);