| $fn=60; | |
| difference() | |
| { | |
| sphere(r=1.5); | |
| cylinder(h=4,r=1,center=true); | |
| } |
| import openstl | |
| class importstl(ThreeDScene): | |
| def construct(self): | |
| self.set_camera_orientation(phi=30*DEGREES, theta=45*DEGREES, gamma=120*DEGREES) | |
| stlobj = openstl.read(r"bilder\20251214_spherehole.stl") | |
| obj = VGroup( | |
| *[ | |
| Polygon( | |
| *[vertex for vertex in poly[1:]], | |
| fill_color=BLUE, | |
| fill_opacity=0.3, | |
| stroke_width=1, | |
| ) | |
| for poly in stlobj | |
| ] | |
| ).center().scale_to_fit_width(5) | |
| self.add(obj) | |
| self.begin_ambient_camera_rotation(rate=0.5) | |
| self.wait(5) |