Skip to content

Instantly share code, notes, and snippets.

@thebusytypist
thebusytypist / halfvector.py
Last active January 23, 2016 20:12
Python scripts demonstrating half vector isocontour
import numpy as np
import matplotlib as mpl
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
def reflect(v, n):
return 2 * np.dot(v, n) * n - v
def transform(beta, theta):
l = np.array([-np.cos(beta), np.sin(beta), 0.0])
@thebusytypist
thebusytypist / InverseUVMapping.py
Created August 31, 2015 01:49
Transform UV coordinates to world space
bl_info = {
"name": "InverseUVMapping",
"description": "Inverse UV coordinate",
"author": "TheBusyTypist",
"category": "Object"
}
import bpy
import bmesh
import mathutils
From d47c6c046b6272b46b3a292f861bbcf2d9173b14 Mon Sep 17 00:00:00 2001
From: thebusytypist <ounanding@gmail.com>
Date: Fri, 14 Aug 2015 23:19:59 +0800
Subject: [PATCH 1/2] Render new context button.
---
source/blender/editors/space_buttons/buttons_context.c | 3 +++
source/blender/makesdna/DNA_space_types.h | 1 +
source/blender/makesrna/intern/rna_space.c | 5 +++++
3 files changed, 9 insertions(+)
From 011dec2b84f5c9b61a4b5ef8bddf1ed0b6e891f2 Mon Sep 17 00:00:00 2001
From: thebusytypist <ounanding@gmail.com>
Date: Mon, 3 Aug 2015 12:00:05 +0800
Subject: [PATCH 1/6] Add skeleton code for modifier tetrahedron; add
definition of TetrahedronModifierData; include tetrahedron modifier in build
system.
---
source/blender/makesdna/DNA_modifier_types.h | 5 ++
source/blender/modifiers/CMakeLists.txt | 1 +
bl_info = {
"name": "Genus",
"description": "Compute genus",
"author": "TheBusyTypist",
"category": "Object"
}
import bpy
import bmesh
import math
@thebusytypist
thebusytypist / DualContouring3D.py
Created July 25, 2015 09:53
3D Dual Contouring
bl_info = {
"name": "3D Implicit Function Contouring",
"description": "Contour 3D implicit function",
"author": "TheBusyTypist",
"location": "View3D > Add > Mesh",
"category": "Add Mesh"
}
import bpy
import bmesh
@thebusytypist
thebusytypist / DualContouring2D.py
Last active August 29, 2015 14:25
2D Dual Contouring
bl_info = {
"name": "2D Implicit Function Contouring",
"description": "Contour 2D implicit function",
"author": "TheBusyTypist",
"location": "View3D > Add > Mesh",
"category": "Add Mesh"
}
import bpy
import bmesh
@thebusytypist
thebusytypist / SelectVisibleVertices.py
Created February 9, 2014 15:33
SelectVisibleVertices Blender operator
bl_info = {
"name": "Select Visible Vertices",
"category": "Object",
}
import bpy
import mathutils
import bmesh
def Frustum(l, r, b, t, n, f):