Category Archives: 23-parametricobject

amwatson

15 Feb 2015

“My program parametrically generates knit patterns for the Disney Research knitting machine”

I decided to make use of the industrial knitting machine at Disney Research Pittsburgh.  The native interface to the machine lacks a lot of abstraction — it takes in a series of machine instructions — which needle/bed to loop on, direction of knit, transfers from one needle to another, etc. — and executes them in order.  Researchers have built a small layer on top that translates these instructions to JavaScript, but the layer of abstraction remains pretty thin.  Essentially, in order to knit something with the knitting machine, you need to translate your vision for the garment into a list of instructions to the knitting machine, which is both tricky to get right and very hard to generalize.

This gulf between vision and execution is what inspired me to try and create a parametric knit object.  Working so closely with machine primitives would make it challenging, because it would require building up some generalizable (and easily parameterized) abstractions, as well as making sure the patterns were physically feasible, and the instructions, when executed, would result in a well-formed, knittable object.  Unfortunately, this also means the machine lacks realistic renderings, and so output cannot be visualized until it is fed into the machine.  Currently, I’m not posting the output files, because I’m not sure whether Disney considers them proprietary.  I’ll find out.

I’d knit some simple patterns with the machine before, and spent a lot of time trying to figure out what forms could be generalized without everything breaking.  Originally, I was interested in trying to make hats, but the process of making a closed tube on the machine ended up being much too complicated to easily generalize.  After consulting with other researchers, I decided that a good first step would be to create generative patterns on flat, knit rectangles.

Cables

Ribs

A lot of the cooler knit patterns seemed to be formed out of “ribs” (raised lines of purl stitches) and “cables” (crossed purls that form a braid).  Alone, they were pretty simple to knit, but when used effectively, they could be combined to create some pretty elaborate looking patterns:

 

 

My first step, then, was to create generalized abstractions for ribs and cables.  After a lot of experimentation,  I came up with two parametric forms (both allow the width and height of the knit object to be specified):

Sketch of pattern 1

1. The first pattern generates n vertical ribs spanning the height of the pattern.  The ribs curve in random directions, and have an “affinity” for one another: when two ribs come within a certain distance horizontally, they merge and combine as a single cable.

While the pattern itself was simple, figuring out exactly when two ribs would collide is actually quite tricky, and curved ribs “colliding” with one another easily breaks a pattern when handled wrong.  Fixing this required a lot of ugly code to check updates, and treat sufficiently close ribs as a single, larger rib.

Sketch of pattern 2

Example of the knit output from pattern 2

2. The second pattern has straight, vertical ribs evenly spaced across the pattern, and generative places cross-cables in random locations to “bridge” them.  While simpler and mostly lacking in the collision problem, I found this pattern to be more aesthetically pleasing than the other one.  I suppose there’s something to be said about simplicity.

Disney researchers are still in the process of building up abstractions for the knitting machine that will allow one to specify a garment as a program.  I’m glad I was able to contribute to the space by create some parameterized patterns that try to make generalizable patterns out of primitive instructions.  I think there’s still a lot of work to be done in this area, and I’d be interested in learning more about what common patterns can be generalized without breaking down in execution.

Zack Aman

15 Feb 2015

Parametric Jellyfish by @zackaman is a rhinopython script for generating jellyfish with different bodies and tentacles.

The idea for the parametric jellyfish actually started as a flower.flower and vase

 

I thought a flower with a variable number and shape of petals along with some swirly stamens would make for a nice parametric object.  After doing the first (non-parametric) sketch above, however, I realized I mostly wanted to focus on the swirly bits, so I decided to turn it upside down and make it a jellyfish.

The script takes several variables: body height and width, number of tentacles, tentacle height, tentacle swirl, and tentacle bend. The tentacles are generated by creating an interpolated arc for each tentacle, and generating the points with a circle per bend, plus some randomness in height between circles and radius.

Some sketches (can’t figure out how to make WordPress not rotate these images):

A basic jellyfish, with a plain head, five tentacles, no swirl, and no bend in the tentacles:

jellyfish6

A slightly more complicated jellyfish, with three tentacles, no swirl, but a fair amount of bend:

jellyfish5

A nice pancake top jellyfish.  This one has a wide but shallow body and just a slight swirl and bend:

pancake

A complex jellyfish, with many tentacles, a large amount of bend a large amount of swirl:

jellyfish3

Python script code:

import rhinoscriptsyntax as rs
import math
import random

origin = (0,0,0)


#make jellyfish body
#get radius
#get height
bodyRadius = rs.GetInteger("Set radius (1-10)", 5, 1, 10)
print(bodyRadius)
bodyHeight = rs.GetInteger("Set body height (1-20)", 5, 1, 20)
print(bodyHeight)

#set three points to make interpolated curve: origin, origin + radius / height, some midpoint (half of height, random radius added)
bodyList = []
bodyList.append(origin)
midRadius = random.random() * bodyRadius
midpoint = (0, midRadius, 0 - (bodyHeight / 2))
bodyList.append(midpoint)
endpoint = (0, bodyRadius, 0 - bodyHeight)
bodyList.append(endpoint)
print(bodyList)
bodyLine = rs.AddInterpCurve(bodyList)

bodyAxis = [(0,0,0), (0,0,1)]
bodySurface = rs.AddRevSrf(bodyLine, bodyAxis)
print("bodySurface")
print(bodySurface)

#bodySolid = rs.OffsetSurface(bodySurface, 10, 0.01, False, True)
if rs.IsSurface(bodySurface):
    print("is a surface")
    #bodySolid = rs.OffsetSurface(bodySurface, 1)
    centerLine = rs.AddLine(bodyAxis[0], bodyAxis[1])
    bodySolid = rs.ExtrudeSurface(bodySurface, centerLine)
print("bodySolid")
print(bodySolid)


#make jellyfish tentacles
#get number of tentacles
tentacleNum = rs.GetInteger("How many tentacles? (1-10)", 5, 1, 10)
print(tentacleNum)
#get swirliness - 0 : num tentacles, governs how far over the tentacle wil move to the next circle
tentacleSwirl = rs.GetInteger("How much swirl? (0 - "+str(tentacleNum)+")", 0, 0, tentacleNum)
print(tentacleSwirl)
#get bendiness
tentacleBend = rs.GetInteger("How much bendiness in tentacles? (2-10)", 3, 2, 10)
print(tentacleBend)
#get height - use variation from 75% - 125%
tentacleHeight = rs.GetInteger("Set tentacle height (5-50)", 20, 5, 50)
print(tentacleHeight)

curHeight = -0.5
tentacleArc = math.radians(360 / tentacleNum)
curAngle = 0
tentaclePoints = []

#for bendiness, set up circle of points
for i in range(0, tentacleBend):
    #set up circle
    
    print(curHeight)
    bendPoints = []
    
    #place points around circle
    for j in range(0, tentacleNum):
        if(i == 0):
            curPoint = (0, 0, -1)
            bendPoints.append(curPoint)
        else:
            curRadius = random.randint(50, 150) / 100 * bodyRadius
            curPoint = (math.cos(curAngle)*curRadius,math.sin(curAngle)*curRadius,curHeight)
            bendPoints.append(curPoint)
            curAngle += tentacleArc
    
    tentaclePoints.append(bendPoints)
    
    curHeight -= abs(tentacleHeight/tentacleBend * 5 * random.random())
    
print tentaclePoints

#for each tentacle
for i in range(0, tentacleNum):
    curTentacle = []
    curIndex = i
    for j in range(0, tentacleBend):
        curTentacle.append(tentaclePoints[j][curIndex])
        curIndex += tentacleSwirl
        if(curIndex >= tentacleNum):
            curIndex = curIndex % tentacleNum
    
    print(curTentacle)
    
    
    
    tentacleRail = rs.AddInterpCurve(curTentacle)
    
    #tentacleCross = rs.AddCircle([(1,0,-1),(1,0, -1),(10,-1,-1), (0,1,-1)], 1)
    tentacleCross = rs.AddCircle((0,0,-1), 1)
    
    newTentacle = rs.AddSweep1(tentacleRail, [tentacleCross])
    rs.ExtrudeSurface(newTentacle, centerLine)

Repository with script and miscellaneous screenshots available on GitHub.

Embeds:

[sketchfab id=”03d454fa1d164dc7b3aea6b0f2cebf4a” start=”1″ spin=”1″ controls=”1″]

[sketchfab id=”a87d3265b3d147a1b3d7ac9fb26b667c” start=”1″ spin=”1″ controls=”1″]

 

Parametric Construction Toy Kit Rod Part

TWEETABLE: Parametric Construction Toy Kit Rod Part is a small reminder of childhood fun and creativity.

For this piece I had considered making an entire assortment of parts that would fit together for building things given all the parameters for the parts. This became too much of an endeavor after waiting 4 minutes for OpenSCAD to compile and render the rounded version of my part. Thus I decided to make just one part, the rod component. The inspiration behind this procedural project is K’NEX.

With radius set to 1 and grooves set to 4.openscad 2015-02-10 08-11-58-31

This configuration is wider with more grooves.

r10g8

This configuration has grooves that span the whole rod length.

r2g6allgroove

//CUSTOMIZER VARIABLES

//The length of the rod
length = 40;

//The radius of the rod
rod_rad = 1;

//The length of the peg portion
peg_len = 3;

//The length of the rod portion that isn't grooved
non_groove_len = 3;

//Round it?
rounded = 0;//[0, 1]

//The amount of roundness (applied as a sphere's radius applied with minkowski)
roundness = 0.5;

//The number of grooves
grooves = 4;

//Red
R = 140;//[0:255]
//Green
G = 60;//[0:255]
//Blue
B = 40;//[0:255]
//Alpha
A = 255;//[0:255]

//CUSTOMIZER VARIABLES END

$fn = 50;
rod_color = [R/255.0, G/255.0, B/255.0, A/255.0];

//The diameter of the rod
module rod(length, peg_len = 3, non_groove_len = 3, roundness = 0.5, grooves = 6, rod_rad = 1){
	union(){
		cylinder(h = peg_len, r1 = rod_rad, r2 = rod_rad*0.75);
		translate([0,0,peg_len]){
			difference(){
				cylinder(h = length - 2*peg_len, r = rod_rad);
				translate([0,0,non_groove_len]){
					for (i = [0:grooves-1]){
						rotate([0,0,i*360.0/grooves]){
							translate([0.3,0.3*sin(360.0/grooves),0]){
								linear_extrude(length - 2*peg_len - 2*non_groove_len){
									polygon([[rod_rad/2,0],
												[rod_rad*2,0],
												[cos(360.0/grooves)*rod_rad*2,sin(360.0/grooves)*rod_rad*2],
												[cos(360.0/grooves)*rod_rad/2,sin(360.0/grooves)*rod_rad/2]]);
								}
							}
						}
					}
				}
			}
		}
		translate([0,0,length - peg_len]){
			cylinder(h = peg_len, r1 = rod_rad*0.75, r2 = rod_rad);
		}
	}
}

color(rod_color){
	if (rounded==1){
		minkowski(){
			sphere(roundness);
			rod(length, peg_len, non_groove_len, roundness, grooves, rod_rad);
		}
	} else{
		rod(length, peg_len, non_groove_len, roundness, grooves, rod_rad);
	}
}

[TODO: sketches , github]

sejalpopat

10 Feb 2015

I had a lot of trouble with the parametric object project and am still working on it. My first idea was to have some kind of 3d tiling involved in generating a shelled animal. Then I thought a sting ray (or flatter animal) with the top of its body patterned and overall body shape adjusted would be more achievable. These are some screenshots of models I made but haven’t yet found a good way to wrap them onto an organic form.

Zach Rispoli

10 Feb 2015

This OF app takes videos of things in the sky (birds, kites, stars, airplanes etc.) and creates constellations by connecting them together, resulting in a 2d mesh. Each frame of the video is converted into a mesh, and those meshes are then combined into a pillar. (I’m not exactly sure what this technique is called but lots of people have done it before)

I’m using ofxOpenCV to track objects. You can see the whole process in these gifs:

test3

test2

test

test4

test5

The resulting forms:

Screen Shot 2015-02-09 at 9.49.04 PM

Screen Shot 2015-02-09 at 8.57.23 PM

Screen Shot 2015-02-09 at 9.55.07 PM

Screen Shot 2015-02-09 at 9.55.16 PM

Screen Shot 2015-02-09 at 9.52.30 PM

Screen Shot 2015-02-09 at 9.55.34 PM