Introduction: 3 Lamp Shade With Numerical Representations

In this project, using grasshopper, I made the lamp shape with numerical representations of the surface.

Step 1: Programming With Grasshopper

In the python code, to make the shape of the lamp, I changed the following part of the program from Jennifer's example code.

# Anzu's original geometry_Spherical Surfaces
def paramsurfD(u, v):
r =(1+0.1*math.cos(10*(u+v)))
x = math.cos(u) * math.cos(v)*r*sx
y = math.sin(u) * math.cos(v)*r*sy
z = math.sin(v)*r*sz
return geom.Point3d(x, y, z)

These parts are for rendering the shape.

# Create mesh with geometry point information.
u = u0
du = (u1 - u0) / float(nu)
v = v0
dv = (v1 - v0) / float(nv)
i = 0
j = 0
k = 0

ms = geom.Mesh.CreateFromPlane(geom.Plane.WorldXY, geom.Interval(u0, u1), geom.Interval(v0, v1), nu, nv)
v = v0
for j in range(0,nv+1):
u = u0
for i in range(0,nu+1):
ms.Vertices.SetVertex(k, paramsurfD(u, v))
u = u+du
k = k+1
v = v+dv

ms.FaceNormals.ComputeFaceNormals();
ms.Normals.ComputeNormals();
a = ms;

plu =[]
plv = []
v = v0
j=0
i=0
for j in range(0,nv+1):
u = u0
pl = geom.Polyline()
for i in range(0,nu+1):
pl.Add(paramsurfD(u, v))
u += du
v += dv
plu.Add(pl)

u = u0;
j=0
i=0
for i in range(0,nu+1):
v = v0
pl = geom.Polyline()
for j in range(0,nv+1):
pl.Add(paramsurfD(u, v))
v = v+dv;
u = u+du
plv.Add(pl)

b = plu
c = plv

The output of the mesh data is processed by OffMesh to make offset and create solid. Msh2Psrf converts from the mesh data to a nurbs poly surface.

Step 2: Shape of a Lamp

This is the shape of the lamp created by Step 1.

Step 3: Calibration With Actual Size of the Lamp

To connect with the actual existing lamp, I made the connecter of the lamp shade first and check the connection.

The connecter fits well with the lamp. Therefore, based on this connecter, I adjusted the size of the lamp shade model.

Step 4: Slice Lamp Shade With Cura

The estimated print time is 6 hours and 51 min. I used preview to see each slice if this lampshade model was processed without any problem.

Step 5: Done!!

This is the 3D printed shape of the lampshade. It connects with the existing lamp, and it is lighting like this picture.

Step 6: Cloud Shape

We can make other numerical representations of the surface.

In the part of python code, we can change it like this.

def paramsurfD(u, v):
r =(1+0.1*math.cos(10*u)*math.sin(10*v))
x = math.cos(u) * math.cos(v)*r*sx
y = math.sin(u) * math.cos(v)*r*sy
z = math.sin(v)*r*sz
return geom.Point3d(x, y, z)

Step 7: Bumpy Cylinder Shape

def paramsurfD(u, v):
r =(1+0.1*math.cos(10*(u+v)))
x = math.cos(u)*sx*r
y = math.sin(u)*sy*r
z = v*sz
return geom.Point3d(x, y, z)

Step 8: Hemi Spherical Surfaces

def paramsurfD(u, v):
r =(1+0.1*math.cos(10*(u+v)))
x = math.cos(u) * math.cos(v)*r*sx
y = math.sin(u) * math.cos(v)*r*sy
z = math.sin(v)* math.sin(v)*r*sz
return geom.Point3d(x, y, z)