Subdividing cubes at different intervals

I'm trying to subdivide a cube at different intervals depending on the length, for example, if I make a 1x1x2 cube and subdivide it, it becomes 8 sections vertically (which is what I want) but also 8 horizontally (bad) I would like it to be 8 vertically and 4 horizontally. Now I can get around this by taking a 1x1x1 cube and subdividing it to have 4x4 segments, and copy pasting another one above to get the desired result, but I'm wondering if there is a better way to do it so I don't have to copy and past each correct block? So I could take a 1x1x2 block and say divide it by 8 on the z axis but only 4 on the x and y? Thank you for your help

The incorrect amount of subdivisions, requires much more clicking to do what I want, but doesn't require copy pasting

The correct amount of subdivisions, but requires copy pasting and seems inefficient

Use Loop Cuts (Ctrl+R)

Position the mouse to select the axis,

Using the Mouse Wheel you can control how many subdivisions you want on each axis.

• Thank you! Great explanation, still a beginner and trying to figure all this out. Thank you for your response. – Joel Banks Mar 3 '18 at 3:00

My solution might be a smidge impractical but once I started, I couldn't stop and after a creative fever, I managed to make a magic cube out of Array Modifiers:

I took a cube, scaled it to one Blender Unit and removed 5 faces. Any object you see, except Hronkar, is a single quad, rotation and scale applied, one unit in length with the Object Origin usually half a Blender Unit away. Where exactly the Object Origin had to be was trial and error. Notice the funny offset location of part 3.

Blender has this weird pseudobug which causes drivers to lag a frame behind when they refer to themselves. That's why I gave Hronkar the tyrant 3 custom properties name X, Y and Z. They determine the dimensions of the magic cube in Blender Units and drive all the arrays.

Here are all the array modifiers. I named them after the objects and by which axis they're driven. X=3, Y=4, Z=5. The start- and end caps make this possible.

Bosscube:

Part 1:

Part 2:

Part 3:

Part 4:

Part 5:

This is one example of the drivers. Single property, Hronkar as the source and a single roperty in square brackets.

It's a bit confusing, I agree. A bit gaga, but, by entering Y, Y and Z values into Hronkars custom props you can create a cube that is made of evenly spaced quads. And it's a watertight mesh, not a bunch of stacked cubes.

All you have to do is start with six planes left from a cube, attach the modifiers as shown and move the object origin around. Once you have managed to set it up, better make 5 independent backups. You might not be able to recreate it, ever.

In order to turn it into a regular mesh, one just has to copy it and apply two modifiers.

Approach based on Subdivide operator means selecting those edges which compose an edge ring in the direction you want to subdivide. So if subdividing vertically you select top and bottom edges, if horizontally - side edges:

Note that to subdivide side of the cube like in example which already was subdivided you need to select whole edge ring in order crossing subdivision to cut through it:

Otherwise it will subdivide only face which shares selected edges.
This is destructive approach which changes mesh geometry so make sure you have either backup or some copy of the object to not change it in a way you didn't mean to.

If you know you want to add a 3 x 4 x 5 subdivided cuboid, it might be easier to set this when the object is created, rather than have to add a cube and then go thru the rigmarole of subdividing on each axis.

Here's a script based on the text editor > templates > python > Addon Add Object example in blender. Adds a cube with bmesh, and subdivides it into dimensions.

Example of adding cuboid in edit mode (pretty crappy gif)

bl_info = {
"author": "batFINGER",
"version": (1, 0),
"blender": (2, 75, 0),
"warning": "",
"wiki_url": "",
}

import bpy
import bmesh
from bpy.types import Operator
from bpy.props import FloatVectorProperty, IntVectorProperty

from mathutils import Matrix

bm = bmesh.new()
mesh = bpy.data.meshes.new(name="Cuboid")
S = Matrix.Scale(1, 4)
for i in range(3):
S[i][i] = self.scale[i] * self.dimensions[i]
bmesh.ops.create_cube(bm, size=1, matrix=S)

#bm.edges.ensure_lookup_table()
axes = [axis for axis in Matrix().to_3x3()]

for cuts, axis in zip(self.dimensions, axes):
def aligned(e):
dir = (e.verts[1].co - e.verts[0].co).normalized()
return abs(dir.dot(axis)) > 0.5
if cuts == 1:
continue
bmesh.ops.subdivide_edges(bm,
edges=[e for e in bm.edges if aligned(e)],
use_grid_fill=True,
cuts=cuts - 1)
for v in bm.verts:
v.select = True
bm.select_flush(True)
bm.to_mesh(mesh)
#mesh.update()
bm.free()
if context.edit_object:
mesh = context.edit_object.data
bmesh.from_edit_mesh(mesh)
bmesh.update_edit_mesh(mesh)

"""Create a subdivided by dimension cuboid"""
bl_options = {'REGISTER', 'UNDO'}

dimensions = IntVectorProperty(
name="Dimensions",
default=(1, 1, 1),
min=1,
max=20
)
scale = FloatVectorProperty(
name="scale",
default=(1.0, 1.0, 1.0),
subtype='TRANSLATION',
description="scaling",
)

def execute(self, context):
return {'FINISHED'}

# Registration

self.layout.operator(
icon='MESH_CUBE')

def register():

EDIT. Change axis test on edges to a simple dot product. Using bmesh.ops.similar_edges(...)` becomes unreliable when scrubbing props in operator panel. New mesh vertices are selected in edit mode.