Skip to main content

grid_pattern

Function grid_pattern 

Source
pub fn grid_pattern(
    topo: &mut Topology,
    solid: SolidId,
    dir_x: Vec3,
    dir_y: Vec3,
    spacing_x: f64,
    spacing_y: f64,
    count_x: usize,
    count_y: usize,
) -> Result<CompoundId, OperationsError>
Expand description

Create a 2D grid pattern of a solid.

Produces count_x × count_y copies arranged in a rectangular grid. Each row is offset by spacing_x along dir_x, each column by spacing_y along dir_y. The original solid occupies position (0, 0).

Returns a compound containing all copies.

§Errors

Returns an error if either count is less than 1, either spacing is non-positive, either direction is zero-length, or copy/transform fails.