ktongue's picture
download
raw
1.84 kB
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "ad1564ab",
"metadata": {},
"outputs": [],
"source": [
"# Make sure the repo root is on sys.path so we can import cylinder.py\n",
"import sys, pathlib\n",
"repo_root = pathlib.Path.cwd()\n",
"if str(repo_root) not in sys.path:\n",
" sys.path.insert(0, str(repo_root))\n",
"\n",
"# Import cadquery and the notebook viewer helper\n",
"try:\n",
" import cadquery as cq\n",
" from cadquery import exporters\n",
" from jupyter_cadquery import show\n",
"except Exception as e:\n",
" raise RuntimeError(\n",
" \"This notebook requires the 'cadquery' conda env with 'jupyter-cadquery' installed.\"\n",
" ) from e\n",
"\n",
"# Import the helper from the repo and create the cylinder\n",
"from cylinder import draw_cylinder\n",
"c = draw_cylinder(radius=5, height=15, center=True)\n",
"\n",
"# Display in the notebook (jupyter-cadquery)\n",
"show(c)\n",
"\n",
"# Also export an STL next to the notebook for external viewing\n",
"exporters.export(c, 'cylinder_notebook.stl')\n",
"print('Exported: cylinder_notebook.stl')"
]
},
{
"cell_type": "markdown",
"id": "3ea1f216",
"metadata": {},
"source": [
"**How to run:**\n",
"1. Activate the cadquery environment: `conda activate cadquery`\n",
"2. From the repository root run: `jupyter lab` (or `jupyter notebook`)\n",
"3. Open `examples/cylinder_notebook.ipynb` and run the cells.\n",
"\n",
"If you prefer to view the exported STL outside the notebook, open `cylinder_notebook.stl` with MeshLab, Blender or Quick Look (macOS)."
]
}
],
"metadata": {
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 5
}

Xet Storage Details

Size:
1.84 kB
·
Xet hash:
700bae43227d72ca9727c68d6d6550d62b50f1fdc66ca01e844de2d8e11a1f6d

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.