Skip to content

Instantly share code, notes, and snippets.

@FFY00
Last active February 9, 2021 21:27
Show Gist options
  • Save FFY00/ee171e2b72810ad46126ef3d3d97f736 to your computer and use it in GitHub Desktop.
Save FFY00/ee171e2b72810ad46126ef3d3d97f736 to your computer and use it in GitHub Desktop.
Microscope tube fit
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};',
)
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment