fix(planar-incr-embed): Fix Edge lhs vs. rhs association

This commit is contained in:
Ellen Emilia Anna Zscheile 2025-06-18 17:32:12 +02:00
parent ed06170db5
commit cfde2eac20
3 changed files with 6 additions and 14 deletions

View File

@ -93,8 +93,8 @@ where
b_idx, b_idx,
&b, &b,
Edge { Edge {
lhs: Some(delaunay.from().data().idx.clone()), lhs: Some(delaunay.to().data().idx.clone()),
rhs: Some(delaunay.to().data().idx.clone()), rhs: Some(delaunay.from().data().idx.clone()),
}, },
); );
} }

View File

@ -455,9 +455,8 @@ fn cane_around<R: AccessRules>(
sense sense
); );
// TODO: fix `-sense` vs `sense`.
let ret = match inner { let ret = match inner {
None => layout.cane_around_dot(recorder, old_head, core, -sense, width), None => layout.cane_around_dot(recorder, old_head, core, sense, width),
Some(inner) => { Some(inner) => {
// now, inner is expected to be a bend. // now, inner is expected to be a bend.
// TODO: handle the case that the same path wraps multiple times around the same core // TODO: handle the case that the same path wraps multiple times around the same core
@ -478,7 +477,7 @@ fn cane_around<R: AccessRules>(
}) })
.next(); .next();
if let Some(inner_bend) = inner_bend { if let Some(inner_bend) = inner_bend {
layout.cane_around_bend(recorder, old_head, inner_bend.into(), -sense, width) layout.cane_around_bend(recorder, old_head, inner_bend.into(), sense, width)
} else { } else {
return Err(EvalException::BendNotFound { return Err(EvalException::BendNotFound {
core: core, core: core,

View File

@ -105,10 +105,7 @@ impl PolygonRouting {
origin: destination, origin: destination,
}); });
}; };
let cw = match self.cw { let cw = matches!(self.cw, RotationSense::Clockwise);
RotationSense::Counterclockwise => false,
RotationSense::Clockwise => true,
};
Ok(if invert_cw ^ cw { lhs } else { rhs }) Ok(if invert_cw ^ cw { lhs } else { rhs })
} }
@ -175,11 +172,7 @@ impl PolygonRouting {
); );
let mut mr = mayrev::MaybeReversed::new(&self.convex_hull.0[..]); let mut mr = mayrev::MaybeReversed::new(&self.convex_hull.0[..]);
// the convex hull is oriented counter-clockwise // the convex hull is oriented counter-clockwise
// FIXME(fogti): I have no clue where the orientation gets wrong... mr.reversed = matches!(self.cw, RotationSense::Clockwise);
mr.reversed = !match self.cw {
RotationSense::Counterclockwise => false,
RotationSense::Clockwise => true,
};
let mut route_length = 0.0; let mut route_length = 0.0;