5
$\begingroup$

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.

A pyramid generated with an array vs one made by hand

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

$\endgroup$
4
$\begingroup$

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.

enter image description here

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.
enter image description here

$\endgroup$
3
$\begingroup$

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

enter image description here

the script :

import bpy

from bpy.props import IntProperty,FloatProperty,BoolProperty

class Pyramid(bpy.types.Operator):
    """Add a simple box mesh"""
    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 )
    linked = BoolProperty(name="Linked",description="created objects are linked to the original",default =False)
    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
        linked = self.linked
        apply_t=self.apply_t

        for x in range(0, steps):

            if linked :
                bpy.ops.object.duplicate_move_linked()
            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
            if apply_t and not linked:
                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()
$\endgroup$
1
$\begingroup$

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.

$\endgroup$
  • $\begingroup$ 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. $\endgroup$ – splic Feb 18 '15 at 18:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.