// Create an `EdgeProfile` for the edge at the given index.
Create an `EdgeProfile` for the edge at the given index.
Create an ` EdgeProfile ` for the edge at the given index .
fn from_index(ix: usize, ec: &EulerCircuit, eg: &EulerGraph) -> Self {
            let e = ec[ix];
            let e_ref = &eg.raw_edges()[e.index()];
            let a = eg[e_ref.source()];
            let a_weight = a.weight;
            let kind = match e_ref.weight {
                SegmentKind::Blank => EdgeProfileKind::Blank,
                SegmentKind::Lit => {
                    let a_pos = a.position;
                    let b_pos = eg[e_ref.target()].position;
                    let distance = distance_squared(a_pos, b_pos).sqrt();
                    let next_ix = (ix + 1) % ec.len();
                    let e_ref = &eg.raw_edges()[ec[next_ix].index()];
                    let c_pos = eg[e_ref.target()].position;
                    let end_corner = straight_angle_variance(a_pos, b_pos, c_pos);
                    EdgeProfileKind::Lit { distance, end_corner }
                }
            };
            EdgeProfile { a_weight, kind }
        }
fn from_index ( ix : usize , ec : & EulerCircuit , eg : & EulerGraph ) -> Self { let e = ec [ ix ] ; let e_ref = & eg . raw_edges ( ) [ e . index ( ) ] ; let a = eg [ e_ref . source ( ) ] ; let a_weight = a . weight ; let kind = match e_ref . weight { SegmentKind :: Blank => EdgeProfileKind :: Blank , SegmentKind :: Lit => { let a_pos = a . position ; let b_pos = eg [ e_ref . target ( ) ] . position ; let distance = distance_squared ( a_pos , b_pos ) . sqrt ( ) ; let next_ix = ( ix + 1 ) % ec . len ( ) ; let e_ref = & eg . raw_edges ( ) [ ec [ next_ix ] . index ( ) ] ; let c_pos = eg [ e_ref . target ( ) ] . position ; let end_corner = straight_angle_variance ( a_pos , b_pos , c_pos ) ; EdgeProfileKind :: Lit { distance , end_corner } } } ; EdgeProfile { a_weight , kind } }
Create an `EdgeProfile` for the edge at the given index.
Create an ` EdgeProfile ` for the edge at the given index .
ix
usize
ec
&EulerCircuit
eg
&EulerGraph