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](/proxy/?url=https://content.instructables.com/F8I/VMJT/KNOLY0FP/F8IVMJTKNOLY0FP.png&filename=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](/proxy/?url=https://content.instructables.com/F55/OSI4/KNOLY0B8/F55OSI4KNOLY0B8.png&filename=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 Surfacesdef paramsurfD(u, v):r =(1+0.1*math.cos(10*(u+v)))x = math.cos(u) * math.cos(v)*r*sxy = math.sin(u) * math.cos(v)*r*syz = math.sin(v)*r*szreturn geom.Point3d(x, y, z)
These parts are for rendering the shape.
# Create mesh with geometry point information.u = u0du = (u1 - u0) / float(nu)v = v0dv = (v1 - v0) / float(nv)i = 0j = 0k = 0ms = geom.Mesh.CreateFromPlane(geom.Plane.WorldXY, geom.Interval(u0, u1), geom.Interval(v0, v1), nu, nv)v = v0for j in range(0,nv+1):u = u0for i in range(0,nu+1):ms.Vertices.SetVertex(k, paramsurfD(u, v))u = u+duk = k+1v = v+dvms.FaceNormals.ComputeFaceNormals();ms.Normals.ComputeNormals();a = ms;plu =[]plv = []v = v0j=0i=0for j in range(0,nv+1):u = u0pl = geom.Polyline()for i in range(0,nu+1):pl.Add(paramsurfD(u, v))u += duv += dvplu.Add(pl)u = u0;j=0i=0for i in range(0,nu+1):v = v0pl = geom.Polyline()for j in range(0,nv+1):pl.Add(paramsurfD(u, v))v = v+dv;u = u+duplv.Add(pl)b = pluc = 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](/proxy/?url=https://content.instructables.com/FM3/94TG/KNOLY0B9/FM394TGKNOLY0B9.png&filename=4_lampshape.png)
This is the shape of the lamp created by Step 1.
Calibration With Actual Size of the Lamp
![2_connector1.png](/proxy/?url=https://content.instructables.com/FYS/HNMB/KNOLY0A5/FYSHNMBKNOLY0A5.png&filename=2_connector1.png)
![2_3connectorPrintout.png](/proxy/?url=https://content.instructables.com/FOP/DKJJ/KNOLY0A3/FOPDKJJKNOLY0A3.png&filename=2_3connectorPrintout.png)
![2_2Connectormodel.png](/proxy/?url=https://content.instructables.com/F23/4MC0/KNOLY0A1/F234MC0KNOLY0A1.png&filename=2_2Connectormodel.png)
![2_UsedLampConnector.png](/proxy/?url=https://content.instructables.com/FHU/9DAH/KNOLY0A7/FHU9DAHKNOLY0A7.png&filename=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](/proxy/?url=https://content.instructables.com/FP3/A936/KNOLY0BA/FP3A936KNOLY0BA.png&filename=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](/proxy/?url=https://content.instructables.com/F6F/HQMX/KNOLY0BP/F6FHQMXKNOLY0BP.png&filename=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](/proxy/?url=https://content.instructables.com/FH9/OP1O/KNOLY0BB/FH9OP1OKNOLY0BB.png&filename=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*sxy = math.sin(u) * math.cos(v)*r*syz = math.sin(v)*r*szreturn geom.Point3d(x, y, z)
Bumpy Cylinder Shape
![7_E.png](/proxy/?url=https://content.instructables.com/FQU/ZJFF/KNOLY0BC/FQUZJFFKNOLY0BC.png&filename=7_E.png)
def paramsurfD(u, v):r =(1+0.1*math.cos(10*(u+v)))x = math.cos(u)*sx*ry = math.sin(u)*sy*rz = v*szreturn geom.Point3d(x, y, z)
Hemi Spherical Surfaces
![8_F.png](/proxy/?url=https://content.instructables.com/FE1/8CU0/KNOLY0BJ/FE18CU0KNOLY0BJ.png&filename=8_F.png)
def paramsurfD(u, v):r =(1+0.1*math.cos(10*(u+v)))x = math.cos(u) * math.cos(v)*r*sxy = math.sin(u) * math.cos(v)*r*syz = math.sin(v)* math.sin(v)*r*szreturn geom.Point3d(x, y, z)