pub fn surface_grid<S: ParametricSurface>(
surface: &S,
u_range: (f64, f64),
v_range: (f64, f64),
nu: usize,
nv: usize,
) -> Vec<Vec<Point3>>Expand description
Sample a regular N×M grid of surface points.
Returns nu rows, each with nv points.
- Row
icorresponds tou = u_range.0 + i*(u_range.1 - u_range.0) / (nu - 1). - Column
jcorresponds tov = v_range.0 + j*(v_range.1 - v_range.0) / (nv - 1).
Edge cases:
- If
nu == 0ornv == 0, an emptyVecis returned. - If
nu == 1, the single row is evaluated atu_range.0. - If
nv == 1, each row contains one point evaluated atv_range.0.