{ "cells": [ { "cell_type": "markdown", "id": "5a628ec5", "metadata": {}, "source": [ "# Sketching: Dynamic sketch plane\n", "\n", "The sketch is a lightweight, two-dimensional modeler driven primarily by client-side execution.\n", "\n", "At any point, the current state of a sketch can be used for operations such as extruding a body,\n", "projecting a profile, or imprinting curves.\n", "\n", "The sketch is designed as an effective *functional-style* API with all operations receiving 2D configurations.\n", "\n", "For easy reuse of sketches across different regions of your design, you can move a sketch around the\n", "global coordinate system by modifying the plane defining the current sketch location.\n", "\n", "This example creates a multi-layer PCB from many extrusions of the same sketch, creating unique\n", "design bodies for each layer." ] }, { "cell_type": "markdown", "id": "26b25632", "metadata": {}, "source": [ "## Perform required imports\n", "\n", "Perform the required imports." ] }, { "cell_type": "code", "execution_count": 1, "id": "63689d5b", "metadata": { "execution": { "iopub.execute_input": "2024-10-31T14:35:33.206946Z", "iopub.status.busy": "2024-10-31T14:35:33.206946Z", "iopub.status.idle": "2024-10-31T14:35:35.680294Z", "shell.execute_reply": "2024-10-31T14:35:35.680294Z" } }, "outputs": [], "source": [ "from pint import Quantity\n", "\n", "from ansys.geometry.core import launch_modeler\n", "from ansys.geometry.core.math import UNITVECTOR3D_Z, Point2D\n", "from ansys.geometry.core.misc import UNITS\n", "from ansys.geometry.core.sketch import Sketch" ] }, { "cell_type": "markdown", "id": "8534c8d6", "metadata": {}, "source": [ "## Define sketch profile\n", "\n", "You can create, modify, and plot ``Sketch`` instances independent of supporting\n", "Geometry service instances.\n", "\n", "To define the sketch profile for the PCB, you create a sketch outline of individual\n", "``Segment`` and ``Arc`` objects with two circular through-hole attachment points added\n", "within the profile boundary to maintain a single, closed sketch face.\n", "\n", "Create a single ``Sketch`` instance to use for multiple design operations." ] }, { "cell_type": "code", "execution_count": 2, "id": "710dc43a", "metadata": { "execution": { "iopub.execute_input": "2024-10-31T14:35:35.680294Z", "iopub.status.busy": "2024-10-31T14:35:35.680294Z", "iopub.status.idle": "2024-10-31T14:35:38.183468Z", "shell.execute_reply": "2024-10-31T14:35:38.183468Z" } }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "bb9f088df1ce40e0a57e7027aa1fa8ac", "version_major": 2, "version_minor": 0 }, "text/plain": [ "EmbeddableWidget(value='" } }, "c84661ce91ef495bae977803760c3d66": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "e1f760e65fed4fbebbcdf8e502eb82a4": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HTMLModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_c84661ce91ef495bae977803760c3d66", "placeholder": "​", "style": "IPY_MODEL_152b897224014067af366af7e54f751c", "value": "" } } }, "version_major": 2, "version_minor": 0 } } }, "nbformat": 4, "nbformat_minor": 5 }