We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1f4b45b commit 4c66293Copy full SHA for 4c66293
1 file changed
ShapeScriptTests/TestShapes/Stack.shape
@@ -3,21 +3,21 @@
3
detail 32
4
5
// Function to stack shapes automatically
6
-// - Parameter shapes: one or more shapes to be stacked
7
-// - Returns: the stacked meshes, inside a group object
8
-define stack(shapes) {
9
- define axis 0 1 0 // y-axis
10
- group {
11
- for mesh in shapes {
12
- mesh
13
- translate axis * mesh.bounds.size
14
- }
+// - Parameters
+// - axis: the axis along which to stack the shapes
+// - children: one or more shapes to be stacked
+// - Returns: the stacked meshes
+define stack {
+ option axis 0 1 0 // y-axis
+ for mesh in children {
+ mesh
+ translate axis * mesh.bounds.size
15
}
16
17
18
// Display stacked objects
19
-stack(
+stack {
20
cube { color red }
21
sphere { color green }
22
cone { color blue }
23
-)
+}
0 commit comments