CadQuery 最小矩形阵列 (rarray) 示例

此示例在草图中生成 2x21x1mm 矩形网格,然后拉伸

cadquery_rarray_example.py
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

CadQuery 3D model showing 2x2 rectangular array of extruded 1x1mm rectangles using rarray


Check out similar posts by category: CadQuery, Python