File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change 11from geometry_script import *
22
33@tree ("Repeat Grid" )
4- def repeat_grid (geometry : Geometry , width : Int , height : Int ):
4+ def repeat_grid (geometry : Geometry , columns : Int , rows : Int ):
5+ # measure your geometry’s bounds
6+ bbox = geometry .bounding_box ()
7+ span_x = bbox .max .x - bbox .min .x
8+ span_y = bbox .max .y - bbox .min .y
9+
10+ # total grid size = N * object size
11+ total_x = columns * span_x
12+ total_y = rows * span_y
13+
14+ # one extra vertex gives N cells
515 g = grid (
6- size_x = width , size_y = height ,
7- vertices_x = width , vertices_y = height
8- ).mesh_to_points ()
16+ size_x = total_x , size_y = total_y ,
17+ vertices_x = columns + 1 , vertices_y = rows + 1
18+ ).mesh .mesh_to_points ()
19+
920 return g .instance_on_points (instance = geometry )
You can’t perform that action at this time.
0 commit comments