3 Lamp Shade With Numerical Representations

by AnzuK1 in Craft > Digital Graphics

289 Views, 1 Favorites, 0 Comments

3 Lamp Shade With Numerical Representations

1re_Introduction.png

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

Programming With Grasshopper

3_grasshopper.png

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.

Shape of a Lamp

4_lampshape.png

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

Calibration With Actual Size of the Lamp

2_connector1.png
2_3connectorPrintout.png
2_2Connectormodel.png
2_UsedLampConnector.png

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.

Slice Lamp Shade With Cura

5_PrintTime.png

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.

Done!!

Coverpicture.png

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

Cloud Shape

6_D2.png

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)

Bumpy Cylinder Shape

7_E.png
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)

Hemi Spherical Surfaces

8_F.png
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)