{ "cells": [ { "cell_type": "markdown", "id": "356842bb", "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": "8d87aab2", "metadata": {}, "source": [ "## Perform required imports\n", "\n", "Perform the required imports." ] }, { "cell_type": "code", "execution_count": 1, "id": "0fb9ba6e", "metadata": { "execution": { "iopub.execute_input": "2025-01-16T08:15:16.934194Z", "iopub.status.busy": "2025-01-16T08:15:16.934194Z", "iopub.status.idle": "2025-01-16T08:15:21.375632Z", "shell.execute_reply": "2025-01-16T08:15:21.375632Z" } }, "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": "e1a95e02", "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": "5afd2a1a", "metadata": { "execution": { "iopub.execute_input": "2025-01-16T08:15:21.380773Z", "iopub.status.busy": "2025-01-16T08:15:21.380773Z", "iopub.status.idle": "2025-01-16T08:15:25.429936Z", "shell.execute_reply": "2025-01-16T08:15:25.429936Z" } }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "e6d655a34df9472eb8280af5136a1803", "version_major": 2, "version_minor": 0 }, "text/plain": [ "EmbeddableWidget(value='" } }, "6c7de114c03841dcb45747d7b2901782": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "DescriptionStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "6fb9d2d373934db09c080196a99477b5": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "DescriptionStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "94bf313d49e94140b88e941e624fe48f": { "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 } }, "e6d655a34df9472eb8280af5136a1803": { "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_94bf313d49e94140b88e941e624fe48f", "placeholder": "​", "style": "IPY_MODEL_6fb9d2d373934db09c080196a99477b5", "value": "" } } }, "version_major": 2, "version_minor": 0 } } }, "nbformat": 4, "nbformat_minor": 5 }