Skip to content

Instantly share code, notes, and snippets.

@atartanian
atartanian / curvify_points.py
Created April 23, 2017 06:57
blender script to connect all the points of a mesh object into a line
import bpy, bmesh
def main(context):
bpy.ops.object.mode_set(mode='EDIT')
active_obj = bpy.context.active_object
me = active_obj.data
bm = bmesh.from_edit_mesh(me)
verts = bm.verts
@atartanian
atartanian / add_perlin_plane.py
Created April 20, 2017 06:11
add perlin plane to blender
import bpy
import bmesh
from mathutils import noise
def add_perlin_plane(width=1.0, length=1.0, x_res=10, y_res=10, min_z=-0.5, max_z=0.5, noise_scale=0.5, seed=0.0, x_offset=0.0, y_offset=0.0):
"""
This function takes inputs and returns vertex and face arrays.
no actual mesh data creation is done here.
"""
@atartanian
atartanian / multiloft.scad
Created April 10, 2017 18:52
morph skin of a series of profiles
fn=5;
profiles=[
transform(translation([0,0,-.01]), rectangle_profile([1.9,0.1])),
transform(translation([0,0,3.01]), circle_profile(fn=20,r=0.45)),
transform(translation([0,0,6.01]), star_profile(r1=.45,r2=.8,n=6)),
];
skin(morph(profiles, 20, "cubic"));