Skip to main content
code formatting
Source Link
Ray Mairlot
  • 29.4k
  • 12
  • 105
  • 126

ImI'm generating cubes with this code:

for a in range(10): x = random.randint(-5, 4) y = random.randint(-2, 7) z = random.randint(3, 10) bpy.ops.mesh.primitive_cube_add(location=(x,y,z), radius = 1)

for a in range(10):
    x = random.randint(-5, 4)
    y = random.randint(-2, 7)
    z = random.randint(3, 10)
    bpy.ops.mesh.primitive_cube_add(location=(x,y,z), radius = 1)`

What do I add to make sure no one of these 10 cubes are created with some part of it inside of one of the earlier created cubes?

Im generating cubes with this code:

for a in range(10): x = random.randint(-5, 4) y = random.randint(-2, 7) z = random.randint(3, 10) bpy.ops.mesh.primitive_cube_add(location=(x,y,z), radius = 1)

What do I add to make sure no one of these 10 cubes are created with some part of it inside of one of the earlier created cubes?

I'm generating cubes with this code:

for a in range(10):
    x = random.randint(-5, 4)
    y = random.randint(-2, 7)
    z = random.randint(3, 10)
    bpy.ops.mesh.primitive_cube_add(location=(x,y,z), radius = 1)`

What do I add to make sure no one of these 10 cubes are created with some part of it inside of one of the earlier created cubes?

Tweeted twitter.com/StackBlender/status/937458503043682310
Source Link

Generate x cubes at random locations but not inside each other?

Im generating cubes with this code:

for a in range(10): x = random.randint(-5, 4) y = random.randint(-2, 7) z = random.randint(3, 10) bpy.ops.mesh.primitive_cube_add(location=(x,y,z), radius = 1)

What do I add to make sure no one of these 10 cubes are created with some part of it inside of one of the earlier created cubes?