3 Lamp Shade With Numerical Representations
by AnzuK1 in Craft > Digital Graphics
312 Views, 1 Favorites, 0 Comments
3 Lamp Shade With Numerical Representations
In this project, using grasshopper, I made the lamp shape with numerical representations of the surface.
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 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
This is the shape of the lamp created by Step 1.
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.
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.
Done!!
This is the 3D printed shape of the lampshade. It connects with the existing lamp, and it is lighting like this picture.
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*sxy = math.sin(u) * math.cos(v)*r*syz = math.sin(v)*r*szreturn geom.Point3d(x, y, z)
Bumpy Cylinder Shape
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
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)