{ "cells": [ { "cell_type": "markdown", "id": "3dacd84e4e8e39b9", "metadata": {}, "source": [ "# Modelling with adapy" ] }, { "cell_type": "code", "execution_count": 1, "id": "initial_id", "metadata": { "ExecuteTime": { "end_time": "2025-03-16T13:30:38.909006Z", "start_time": "2025-03-16T13:30:38.481311Z" } }, "outputs": [], "source": [ "import ada" ] }, { "cell_type": "markdown", "id": "5a3bfdef-8d31-46e9-8c21-ac431a38f23a", "metadata": {}, "source": [ "## Solid Primitives\n", "First lets look at the different solid primitives supported by adapy" ] }, { "cell_type": "code", "execution_count": 3, "id": "8caeb99f00c2b95a", "metadata": { "ExecuteTime": { "end_time": "2025-03-16T13:30:41.909092Z", "start_time": "2025-03-16T13:30:40.554664Z" } }, "outputs": [ { "data": { "text/html": [ "
" ], "text/plain": [ "" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "bm = ada.Beam('bm1', (0,0,0), (1,0,0), 'IPE300')\n", "bm.show(embed_glb=True)" ] }, { "cell_type": "code", "execution_count": 4, "id": "f37a9af66ff0a156", "metadata": { "ExecuteTime": { "end_time": "2025-03-16T13:30:42.160846Z", "start_time": "2025-03-16T13:30:42.070555Z" } }, "outputs": [ { "data": { "text/html": [ "
" ], "text/plain": [ "" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pl = ada.Plate('pl1', [(0,0), (1,0), (1,1), (0,1)], 0.01)\n", "pl.show(embed_glb=True)" ] }, { "cell_type": "code", "execution_count": 5, "id": "830fd437-f098-4c0a-aa4d-bfaeff497441", "metadata": { "ExecuteTime": { "end_time": "2025-03-16T13:30:42.604660Z", "start_time": "2025-03-16T13:30:42.515527Z" } }, "outputs": [ { "data": { "text/html": [ "
" ], "text/plain": [ "" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "box = ada.PrimBox(\"box1\", (0,0,0), (1,1,1))\n", "box.show(embed_glb=True)" ] }, { "cell_type": "code", "execution_count": 6, "id": "fa65c8b1-a388-4e45-93ce-e13c6fedf01f", "metadata": { "ExecuteTime": { "end_time": "2025-03-16T13:30:43.189302Z", "start_time": "2025-03-16T13:30:43.081124Z" } }, "outputs": [ { "data": { "text/html": [ "
" ], "text/plain": [ "" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "cyl = ada.PrimCyl(\"cyl1\", (0,0,0), (0,0,1), 0.1)\n", "cyl.show(embed_glb=True)" ] }, { "cell_type": "code", "execution_count": 7, "id": "be6f0f3186c68db5", "metadata": { "ExecuteTime": { "end_time": "2025-03-16T13:30:43.621908Z", "start_time": "2025-03-16T13:30:43.516882Z" } }, "outputs": [ { "data": { "text/html": [ "
" ], "text/plain": [ "" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "extr = ada.PrimExtrude('extr1', [(0,0), (0.1,0), (0.05, 0.05)], 1, (0,0,1), (0,0,0), (1,0,0))\n", "extr.show(embed_glb=True)" ] }, { "cell_type": "code", "execution_count": 8, "id": "91fc1edc-5fe5-470f-b0cf-0f02ae147c2f", "metadata": { "ExecuteTime": { "end_time": "2025-03-16T13:30:43.924255Z", "start_time": "2025-03-16T13:30:43.807281Z" } }, "outputs": [ { "data": { "text/html": [ "
" ], "text/plain": [ "" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "cone = ada.PrimCone('cone1', (0,0,0), (1,0,0), 0.3)\n", "cone.show(embed_glb=True)" ] }, { "cell_type": "code", "execution_count": 9, "id": "08b25dca-694a-4b67-8ecc-d73bb628d5e7", "metadata": { "ExecuteTime": { "end_time": "2025-03-16T13:30:44.251607Z", "start_time": "2025-03-16T13:30:44.120764Z" } }, "outputs": [ { "data": { "text/html": [ "
" ], "text/plain": [ "" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "rev = ada.PrimRevolve('rev1', [(0,0), (0.1,0), (0.1,0.1), (0,0.1)], 90, (0,0,0),(1,0,0),(0,1,0))\n", "rev.show(embed_glb=True)" ] }, { "cell_type": "code", "execution_count": 10, "id": "ba1a9e14-08f8-4740-995e-369c369c14f1", "metadata": { "ExecuteTime": { "end_time": "2025-03-16T13:30:55.125903Z", "start_time": "2025-03-16T13:30:55.032997Z" } }, "outputs": [ { "data": { "text/html": [ "
" ], "text/plain": [ "" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sphere = ada.PrimSphere('sphere1', (0,0,0), 0.3)\n", "sphere.show(embed_glb=True)" ] }, { "cell_type": "code", "execution_count": 11, "id": "c70fe6e1-219f-4db2-bd3e-f21ce73f79bc", "metadata": { "ExecuteTime": { "end_time": "2025-03-16T13:30:55.636122Z", "start_time": "2025-03-16T13:30:55.519396Z" } }, "outputs": [ { "data": { "text/html": [ "
" ], "text/plain": [ "" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sweep = ada.PrimSweep('sweep1', [(0,0,0), (0.5,0,0,0.2), (0.8, 0.8, 1),(0.8, 0.8, 2)],[(0,0), (0.1,0),(0.1,0.1),(0,0.1)], (1,0,0), (0,0,0),(0,0,1))\n", "sweep.show(embed_glb=True)" ] }, { "cell_type": "code", "execution_count": 12, "id": "9d3d0cc7-f8c9-4eb8-9cd6-1498961e4ba9", "metadata": { "ExecuteTime": { "end_time": "2025-03-16T13:30:56.489672Z", "start_time": "2025-03-16T13:30:56.296892Z" } }, "outputs": [ { "data": { "text/html": [ "
" ], "text/plain": [ "" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pipe = ada.Pipe('pipe1', [(0,0,0), (1,0,0), (1,1,0), (1,1.5,0), (3,1.5,0)], \"OD200x5\")\n", "pipe.show(embed_glb=True)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.9" } }, "nbformat": 4, "nbformat_minor": 5 }