{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Beam" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "%matplotlib widget" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "89f7ba3c96cc4fc7b2734667b00b9ba4", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Canvas(toolbar=Toolbar(toolitems=[('Home', 'Reset original view', 'home', 'home'), ('Back', 'Back to previous …" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "\"\"\"A very simple beam.\"\"\"\n", "from pysketcher import *\n", "\n", "L = 8.0\n", "H = 1.0\n", "xpos = 2.0\n", "ypos = 3.0\n", "\n", "drawing_tool.set_coordinate_system(xmin=0, xmax=xpos+1.2*L,\n", " ymin=0, ymax=ypos+5*H,\n", " axis=True)\n", "drawing_tool.set_linecolor('blue')\n", "drawing_tool.set_grid(True)\n", "drawing_tool.set_fontsize(22)\n", "\n", "P0 = point(xpos,ypos)\n", "main = Rectangle(P0, L, H)\n", "h = L/16 # size of support, clamped wall etc\n", "support = SimplySupportedBeam(P0, h)\n", "clamped = Rectangle(P0 + point(L, 0) - point(0,2*h), h, 6*h).set_filled_curves(pattern='/')\n", "F_pt = point(P0[0]+L/2, P0[1]+H)\n", "force = Force(F_pt + point(0,2*H), F_pt, '$F$').set_linewidth(3)\n", "L_dim = Distance_wText((xpos,P0[1]-3*h), (xpos+L,P0[1]-3*h), '$L$')\n", "beam = Composition({'main': main, 'simply supported end': support,\n", " 'clamped end': clamped, 'force': force,\n", " 'L': L_dim})\n", "beam.draw()\n", "beam.draw_dimensions()\n", "drawing_tool.display()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "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.8.5" } }, "nbformat": 4, "nbformat_minor": 4 }