import trimesh from cadquery.occ_impl.exporters import exportShape def generate_3d_stl(height, radius, thickness): """ Create and export the 3D STL file for the ear-like bird shell. """ bird_shell_model = create_bird_ear_shell(height, radius, thickness) stl_path = "ear_bird_shell.stl" with open(stl_path, "wb") as f: exportShape(bird_shell_model.val(), "STL", f) return stl_path def visualize_3d_stl(stl_path): """ Visualize the 3D model from the STL file. """ # Load the STL file into a Trimesh object shell_mesh = trimesh.load(stl_path) # Display the 3D model shell_mesh.show()