CadQuery minimal rectangular array (rarray) example
This example generates a 2x2
grid of 1x1mm
rectangles in a sketch, then extrudes it
import cadquery as cq
# Create workplane (2d coordinate system for us to create the sketch in)
wp = cq.Workplane("XY")
# Create sketch & extrude
result = wp.sketch().rarray(
1.5, # X distance between center points of rectangles
1.5, # Y distance between center points of rectangles
2, # Number of rectangles in X direction
2 # Number of rectangles in Y direction
).rect(1,1).finalize().extrude(0.1)
result # This line is just to show the result in cq-editor or jupyter