Last active
February 9, 2021 21:27
-
-
Save FFY00/ee171e2b72810ad46126ef3d3d97f736 to your computer and use it in GitHub Desktop.
Microscope tube fit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from solid import * | |
from solid.utils import * | |
SEGMENTS = 200 | |
def tube(inner, outer, height): | |
assert inner < outer | |
return cylinder(d=outer, h=height) - cylinder(d=inner, h=height) | |
def piece(top_r, bot_r, thickness, height): | |
return ( | |
tube(bot_r, bot_r+thickness, height) + | |
up(height - 3)( | |
tube(top_r, top_r+thickness, height) | |
) | |
) | |
if __name__ == '__main__': | |
scad_render_to_file( | |
piece( | |
bot_r=26.9+0.1, | |
top_r=24.9+0.1, | |
thickness=5, | |
height=20, | |
), | |
'piece.scad', | |
file_header=f'$fn = {SEGMENTS};', | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment