mirror of https://codeberg.org/topola/topola.git
refactor(drawing): more aggressive out-factoring in update_this_and_outward_bows
This commit is contained in:
parent
da6b825ee7
commit
822bba8fde
|
|
@ -537,42 +537,35 @@ impl<CW: Copy, R: AccessRules> Drawing<CW, R> {
|
||||||
while let Some(rail) = maybe_rail {
|
while let Some(rail) = maybe_rail {
|
||||||
let rail_primitive = self.primitive(rail);
|
let rail_primitive = self.primitive(rail);
|
||||||
let joints = rail_primitive.joints();
|
let joints = rail_primitive.joints();
|
||||||
|
let width = rail_primitive.width();
|
||||||
|
|
||||||
let from_head = self.rear_head(joints.1);
|
let from_head = self.rear_head(joints.1);
|
||||||
let to_head = self.rear_head(joints.0);
|
let to_head = self.rear_head(joints.0);
|
||||||
let rail_width = rail_primitive.width();
|
|
||||||
|
|
||||||
let (from, to, offset) = if let Some(inner) = rail_primitive.inner() {
|
let (from, to, offset) = if let Some(inner) = rail_primitive.inner() {
|
||||||
let from = self
|
let inner = inner.into();
|
||||||
.head_around_bend_segment(&from_head, inner.into(), true, rail_width)?
|
let from = self.head_around_bend_segment(&from_head, inner, true, width)?;
|
||||||
.end_point();
|
let to = self.head_around_bend_segment(&to_head, inner, false, width)?;
|
||||||
let to = self
|
let offset = self.head_around_bend_offset(&from_head, inner, width);
|
||||||
.head_around_bend_segment(&to_head, inner.into(), false, rail_width)?
|
|
||||||
.end_point();
|
|
||||||
let offset = self.head_around_bend_offset(&from_head, inner.into(), rail_width);
|
|
||||||
(from, to, offset)
|
(from, to, offset)
|
||||||
} else {
|
} else {
|
||||||
let core = rail_primitive.core();
|
let core = rail_primitive.core().into();
|
||||||
let from = self
|
let from = self.head_around_dot_segment(&from_head, core, true, width)?;
|
||||||
.head_around_dot_segment(&from_head, core.into(), true, rail_width)?
|
let to = self.head_around_dot_segment(&to_head, core, false, width)?;
|
||||||
.end_point();
|
let offset = self.head_around_dot_offset(&from_head, core, width);
|
||||||
let to = self
|
|
||||||
.head_around_dot_segment(&to_head, core.into(), false, rail_width)?
|
|
||||||
.end_point();
|
|
||||||
let offset = self.head_around_dot_offset(&from_head, core.into(), rail_width);
|
|
||||||
(from, to, offset)
|
(from, to, offset)
|
||||||
};
|
};
|
||||||
|
|
||||||
self.move_dot_with_infringables(
|
self.move_dot_with_infringables(
|
||||||
recorder,
|
recorder,
|
||||||
joints.0.into(),
|
joints.0.into(),
|
||||||
from,
|
from.end_point(),
|
||||||
Some(&self.bend_outer_bows(rail)),
|
Some(&self.bend_outer_bows(rail)),
|
||||||
)?;
|
)?;
|
||||||
self.move_dot_with_infringables(
|
self.move_dot_with_infringables(
|
||||||
recorder,
|
recorder,
|
||||||
joints.1.into(),
|
joints.1.into(),
|
||||||
to,
|
to.end_point(),
|
||||||
Some(&self.bend_outer_bows(rail)),
|
Some(&self.bend_outer_bows(rail)),
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue