# Array with Size Increment / Decrement

I am trying to make a step-pyramid with hundreds of steps and it is far too tedious to size one step at a time.

My first instinct is to make an array with reference to a scaled object but this yields results with a curved slope. For example, scaling by .9 produces:

100 x .9 = 90
90  x .9 = 81
81  x .9 = 72.9 ...


Where as what I am trying to simply subtract a value at each step:

100 - 10 = 90
90  - 10 = 80
80  - 10 = 70 ...


The above calculations apply only to the X and Y dimensions while the Z remains constant.

Here is a screenshot. The pyramid on the left was generated with an array and has a curved slope. The one on the right is the desired result with a straight slope and was made by hand.

Is there an easy way to generate the pyramid on the right?

The Add Mesh: Extra Objects addon has a step pyramid mesh. However, it has a maximum of 20 steps. That can be fixed though, by editing the script file.

The location of the addon's initialisation script is shown in the User Preferences window (see the image below, the part marked in green; this shows the location in my installation, and it may differ depending on what OS you're running). The script for the step pyramid is called add_mesh_pyramid.py, and it should be located in the same directory as the __init__.py file.
Open the file, locate num_steps and simply change the max value to something that works for you. With hundreds of steps, you may also need to change the min value of reduce_by to something lower.

To activate it, CtrlAltU to go to user preferences. Click the Add-ons tab, then Add Mesh, then the little check box to the right at Add Mesh: Extra Object. If you want the addon to remain after you close Blender, also click Save User Settings.

I haven't been able to get screenshots from Blender to capture the menus, so I can't show you, but the step pyramid will be available under Add > Mesh > Misc Objects > Step Pyramid. Here's the available settings to tweak it.

This is in case you wanted pyramid of separate objects *linked "share the same data" or not:

• run the script
• select an object
• hit space type "pyramid" select "create a pyramid"
• setup the options through the tool shelf

the script :

import bpy

from bpy.props import IntProperty,FloatProperty,BoolProperty

class Pyramid(bpy.types.Operator):
bl_idname = "object.pyramid"
bl_label = "Create a Pyramid"
bl_options = {'REGISTER', 'UNDO'}

steps = IntProperty(name="Steps",description="Number of items to create",min=1, max=100, default=1  )
Z_offset = FloatProperty(name="Z Offset",description="Z offset",min=-100.0, max=100.0, default=2.0 )
dX = FloatProperty(name="X increment",description="X increment",min=-100.0, max=100.0, default=2.0 )
dY = FloatProperty(name="Y increment",description="Y increment",min=-100.0, max=100.0, default=2.0 )
apply_t = BoolProperty(name="Apply Transform",description="apply object transform",default =False)

def execute(self, context):
steps = self.steps
Z_offset = self.Z_offset
dX = self.dX
dY = self.dY
apply_t=self.apply_t

for x in range(0, steps):

else :
bpy.ops.object.duplicate()

bpy.context.object.dimensions[0] += dX
bpy.ops.transform.translate( value =(0,0,Z_offset))
bpy.context.object.dimensions[1] += dY
bpy.ops.object.transform_apply(scale =True)

return {'FINISHED'}

def register():
bpy.utils.register_class(Pyramid)

def unregister():
bpy.utils.unregister_class(Pyramid)

if __name__ == "__main__":
register()


You might want to try out the Remesh modifier. Create a regular pyramid without any steps and then add a Remesh modifier with the mode set to Blocks. Play around with the modifier's settings and the size of your object in Edit mode until you get a nice result.

• This is a really quick and easy way to get the results but the mesh ends up being unnecessarily dense; the vertical faces are split up into a bunch of skinny rectangles. Feb 18, 2015 at 18:50