Skip to content

Instantly share code, notes, and snippets.

var rects = [];
function setup() {
createCanvas(800, 800);
noLoop();
var iterations = 6; // the number of times we'll do the split
rects.push([30, 30, width-30*2, width-30*2]); // initial square
for(var i = 0; i < iterations; i++){ // this can be done with recursion, but it's simple enough this way
int seed = detail(1, "iteration", 0);
vector rand_axis = set(0, 0, 0);
int rand_int = 0;
vector bbox_size = getbbox_size(0);
seed += int(bbox_size[0]*100) + int(bbox_size[1]*100) + int(bbox_size[2]*100);
if(rand(@class+seed+3113) < 1.5){
if (bbox_size.x > bbox_size.y && bbox_size.x > bbox_size.z) {
rand_axis = set(1, 0, 0);
rand_int = 0;
import bpy
import bmesh
from mathutils import Vector
bl_info = {
'name': 'MoveStuff',
'description': 'Two operators: Move Origin to Lowest Point and Set Location.',
'author': 'Paolo Čerić',
'version': (1, 0),
'blender': (4, 0, 0),
% LaTeX Curriculum Vitae Template
%
% Copyright (C) 2004-2009 Jason Blevins <jrblevin@sdf.lonestar.org>
% http://jblevins.org/projects/cv-template/
%
% You may use use this document as a template to create your own CV
% and you may redistribute the source code freely. No attribution is
% required in any resulting documents. I do ask that you please leave
% this notice and the above URL in the source code if you choose to
% redistribute this file.