February 16, 2025
Description
This is a parametric case made of two snap-fit halves, intended to protect your sunglasses, for example when stored in a backpack.
The overall shape is made of curved surfaces that should closely match the (convex hull of) your sunglasses, for minimum space requirement. It has two planes of symmetry, so the sunglasses can be inserted without paying attention to orientation.
The shape is determined from two 2d profiles:
The top and side views will be the corresponding projections of the resulting 3d shape, but this is not just an intersection of those. It's more "rounded" than the intersection.
You can use the Thingiverse or OpenScad Customizer to tune the parameters and view the 2d profiles and the 3d shape (the latter is faster and more convenient). Each 2d profile should contain the corresponding 2d projection of the sunglasses, with a slight margin. Taking pictures of the two sunglasses views is a simple way of doing this. The following section explains how to use such pitctures as a base for setting the profile parameters using the Thingiverse or OpenScad Customizer.
In addition to the shape parameters, you may want to tune the clearance and thickness too. More parameters can be used to customize the snap-fit profiles.
You need one picture for each profile. They should be cropped with a ratio of 3/2 for the top profile and 1 (square) for the side profile. The last two pictures show an example Also, you will need to know the actual picture dimension (width) in millimeters. This is 160mm for the example top profile and 85mm for the side profile, as shown on the ruler.
The pictures can be uploaded directly through the Thingiverse Customizer interface, which will automatically convert them to height maps of predefined sizes (150x100 and 100x100). Set the "part" parameter to "top_profile" (respectively, side_profile) to display the captured profile and the corresponding profile in the design.
If you use the OpenScad Customizer instead, you should convert your cropped images to png images of the expected size (150x100, 100x100). This can be done easily by running convert file.jpg -resize 150x100 file.png
For each picture, the brightness threshold can be adjusted. If yousing the OpenScad Customizer, you need to multiply the brightness threshold by 100 as png images are read with gray scale values ranging in [0-100] while the Thingiverse Customizer script converts input images to a height map in the [0,1] range.
Coordinate parameters allow you to move and rotate the profile in the correct place. They should be centered on the middle of the X axis, and have the front slightly below the axis (to allow some tolerance as the snap-fit is "indide" the bottom part). Then, you can set the parameters in the profile sections to match the captured profiles.
Don't forget to set precision to 2 (print) before printing !
No supports are required. I used 0.15 layer height, three perimeters. I had good success with ABS, which profides good impact resistance. Nylon would be an even better option but I had more warping with it.
You can test the shape by printing the inside volume is vase mode first. This will be much faster and use less material.
License:
Creative Commons - Attribution - Share Alike