Skip to content

Instantly share code, notes, and snippets.

const DPI = 600;
const MM_PER_IN = 25.4;
// === RETRANSFER CANVAS (source of truth) ===
const TOTAL_W = 2100;
const TOTAL_H = 1344;
// === PHYSICAL CARD SIZE (ISO ID-1) ===
const CARD_W_MM = 85.6;
const CARD_H_MM = 54;
const DPI = 300;
const MM_PER_IN = 25.4;
const CONTENT_W_MM = 85.6;
const CONTENT_H_MM = 54;
const BLEED_MM = 3;
const CONTENT_W = Math.round(CONTENT_W_MM * DPI / MM_PER_IN);
const CONTENT_H = Math.round(CONTENT_H_MM * DPI / MM_PER_IN);
const DPI = 300;
const MM_PER_IN = 25.4;
const CONTENT_W_MM = 85.6;
const CONTENT_H_MM = 54;
const BLEED_MM = 3;
const CONTENT_W = Math.round(CONTENT_W_MM * DPI / MM_PER_IN);
const CONTENT_H = Math.round(CONTENT_H_MM * DPI / MM_PER_IN);
from PIL import Image
import struct
import os
import re
def gb2312_offset(char, size):
gb = char.encode('gb2312')
area = gb[0] - 0xA1
index = gb[1] - 0xA1
bytes_per_char = size * size // 8
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
% 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.
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),
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;
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
var l1, l2;
function setup() {
createCanvas(400, 400);
l1 = createGraphics(width, height);
l2 = createGraphics(width, height);
}
function draw() {