[−][src]Function lasy::interpolate_euler_circuit
pub fn interpolate_euler_circuit<P, R>(
points: &[P],
ec: &EulerCircuit,
eg: &EulerGraph,
target_points: u32,
conf: &InterpolationConfig
) -> Vec<R> where
P: Clone + Into<R> + Position + Weight,
R: Blanked + Clone + Lerp<Scalar = f32>,
Interpolate the given EulerCircuit
with the given configuration in order to produce a path
ready to be submitted to the DAC.
The interpolation process will attempt to generate target_points
number of points along the
circuit, but may generate more points in the user's InterpolationConfig
indicates that more
are required for interpolating the specified circuit.
Performs the following steps:
- Determine the minimum number of required points:
- 1 for each edge plus the 1 for the end.
- The number of points required for each edge.
- For lit edges:
- The distance of each edge accounting for minimum points per distance.
- The angular distance to the following lit edge (none if blank).
- For blank edges:
- The specified blank delay.
- For lit edges:
- If the total is greater than
target_points
, we're done. If not, goto 3. - Determine a weight per lit edge based on the distance of each edge.
- Distribute the remaining points between each lit edge distance based on their weights.
**Panic!**s if the given graph is not actually a EulerCircuit
.