docs(drawing): rephrase docstrings

This commit is contained in:
Mikolaj Wielgus 2024-12-01 23:42:40 +01:00
parent 3bdfa8c12e
commit 638979364c
4 changed files with 23 additions and 25 deletions

View File

@ -1,22 +1,23 @@
use crate::drawing::{
use super::{
bend::LooseBendIndex,
dot::LooseDotIndex,
graph::PrimitiveIndex,
primitive::{GetInterior, GetJoints, GetOtherJoint, LooseBend, LooseDot},
rules::AccessRules,
seg::SeqLooseSegIndex,
Drawing,
};
use super::rules::AccessRules;
/// A cane is a sequence consisting of a seg followed by a dot followed by a
/// bend, with the dot joining the seg with the bend as a joint.
///
/// The name "cane" comes from the iconic cane: a slender walking stick that
/// ends with a round bend that is its handle. Topola's canes are of similar
/// shape.
#[derive(Debug, Clone, Copy)]
/// Geometrical structure to define Navigation Cord Head
pub struct Cane {
/// Loose segment of the Cane
pub seg: SeqLooseSegIndex,
/// Loose dot of the Cane structure
pub dot: LooseDotIndex,
/// Bend of the Cane
pub bend: LooseBendIndex,
}

View File

@ -15,13 +15,11 @@ pub trait GetFace {
fn face(&self) -> DotIndex;
}
/// The head is the working part of the running end of the currently routed
/// band. Both bare and cane heads have a face, which is the fixed dot that
/// terminates the running end.
#[enum_dispatch(GetFace)]
#[derive(Debug, Clone, Copy)]
/// Defines possible Head objects
///
/// Head is the working end of routed band, which can be
/// either Bare when nothing has been routed yet, or Cane
/// when routed process has been started
pub enum Head {
Bare(BareHead),
Cane(CaneHead),
@ -33,10 +31,12 @@ impl<'a, CW: Copy, R: AccessRules> MakeRef<'a, HeadRef<'a, CW, R>, Drawing<CW, R
}
}
/// The head is bare when the routed band is not pulled out (i.e. is of zero
/// length). This happens on the first routing step and when the routed band was
/// contracted due to the routing algorithm backtracking. In these situations a
/// cane head cannot be used because there is obviously no cane behind the face.
#[derive(Debug, Clone, Copy)]
/// Defines not started Head
pub struct BareHead {
/// Describes face of not started Head
pub face: FixedDotIndex,
}
@ -46,12 +46,12 @@ impl GetFace for BareHead {
}
}
/// The head is a cane head when the routed band is of nonzero length (i.e. is
/// pulled out). It differs from the bare head by having a `cane` member, which
/// is the terminal cane on the running end of the currently routed band.
#[derive(Debug, Clone, Copy)]
/// Defines Head during routing process
pub struct CaneHead {
/// Describes face of not started Head
pub face: LooseDotIndex,
/// Last cane followed on the unfinished end
pub cane: Cane,
}

View File

@ -16,16 +16,13 @@ use super::{
};
#[derive(Debug)]
/// Structure containing information about Navigation Cord Stepper
///
/// Navigation Cord is a one of chosen possible ways to connect
/// both Navigation Vertex
/// Stepper for the Navcord.
pub struct NavcordStepper {
/// Path of the current Navigation Cord
/// The currently chosen path.
pub path: Vec<NavvertexIndex>,
/// Type of Navigaction Cord head
/// Head of the routed band.
pub head: Head,
/// Width of the cord
/// Width of the routed band.
pub width: f64,
}

View File

@ -255,7 +255,7 @@ impl Navmesh {
trianvertex.into(),
);
}
};
}
}
for edge in triangulation.edge_references() {