Skip to content

Commit 830f610

Browse files
author
Luca Toniolo
committed
fix C1 discontinuity from collinear consolidation after blend trim
Block segment consolidation when prev_tc has been trimmed by a blend. pmCartLineInit recomputes uVec from (trimmed_start → new_end), changing the line direction, while the attached blend still references the old uVec — causing 0.4-0.9° direction jumps at bezier→line split boundaries. Also add endpoint dκ/ds fields to Bezier9 for curvature-rate analysis.
1 parent 4093962 commit 830f610

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/emc/motion_planning/motion_planning_9d_userspace.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,6 +1291,14 @@ static int canConsolidateLines(TC_STRUCT const *prev_tc, TC_STRUCT const *tc)
12911291
if (fabs(prev_tc->reqvel - tc->reqvel) > 1e-6)
12921292
return 0;
12931293

1294+
// Don't consolidate into a segment that has been trimmed by a blend.
1295+
// Trimming moves the start/end, so pmCartLineInit would recompute uVec
1296+
// from (trimmed_start → new_end), changing the direction. The blend
1297+
// attached at the trimmed boundary still uses the OLD uVec direction,
1298+
// creating a C1 discontinuity (direction jump at the split boundary).
1299+
if (prev_tc->target < prev_tc->nominal_length - TP_POS_EPSILON)
1300+
return 0;
1301+
12941302
// cos(1°) ≈ 0.99985 — matches BLEND9_MIN_THETA threshold
12951303
double const cos_thresh = 0.99985;
12961304
double dot;

0 commit comments

Comments
 (0)