Skip to content

Instantly share code, notes, and snippets.

View andrearastelli's full-sized avatar
🏴‍☠️

Andrea Rastelli andrearastelli

🏴‍☠️
View GitHub Profile
@andrearastelli
andrearastelli / unitCube.py
Created March 5, 2017 11:42
MAYA - unitCube using MFnMesh
import maya.api.OpenMaya as OpenMaya
mesh = OpenMaya.MFnMesh()
# Simple unitCube coordinates
vertices = []
vertices.append(OpenMaya.MPoint( 1, 1, 1)) # 0
vertices.append(OpenMaya.MPoint( 1, -1, 1)) # 1
vertices.append(OpenMaya.MPoint( 1, -1, -1)) # 2
@andrearastelli
andrearastelli / PoissonSampling.java
Last active July 29, 2018 11:16
Processing - Bridson Fast Poisson Disk Sampling
import java.awt.*;
ArrayList<Point> points = new ArrayList<Point>();
ArrayList<Point> active_list = new ArrayList<Point>();
int WINDOW = 400;
float radius = 10;
int size = 200;
int rejection = 3;
int size_ratio = WINDOW / size;
@andrearastelli
andrearastelli / Houdini_voronoi_cell_naming.h
Last active January 28, 2021 22:49
Houdini - Voronoi cell naming over poligons
int np = nearpoint(1, @P);
s@name = concat("piece_", itoa(np));