{ "cells": [ { "cell_type": "markdown", "id": "ae242799", "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": "149cb489", "metadata": {}, "source": [ "## Perform required imports\n", "\n", "Perform the required imports." ] }, { "cell_type": "code", "execution_count": 1, "id": "911725be", "metadata": { "execution": { "iopub.execute_input": "2024-10-08T08:38:49.920810Z", "iopub.status.busy": "2024-10-08T08:38:49.920810Z", "iopub.status.idle": "2024-10-08T08:38:53.480851Z", "shell.execute_reply": "2024-10-08T08:38:53.480851Z" } }, "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": "0f5236ec", "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": "3755bdb3", "metadata": { "execution": { "iopub.execute_input": "2024-10-08T08:38:53.480851Z", "iopub.status.busy": "2024-10-08T08:38:53.480851Z", "iopub.status.idle": "2024-10-08T08:38:56.734632Z", "shell.execute_reply": "2024-10-08T08:38:56.734632Z" } }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "c959407602f14fb6a1fb3e8008eecbfd", "version_major": 2, "version_minor": 0 }, "text/plain": [ "EmbeddableWidget(value='" } }, "cb1b7fa05bd0401b8e1f32a3a59f474d": { "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 } }, "e18b03bc8dcf4070a2f47330efca1603": { "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": "" } }, "f1ed721d99c24cd1abf0553c885fd37d": { "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_cb1b7fa05bd0401b8e1f32a3a59f474d", "placeholder": "​", "style": "IPY_MODEL_e18b03bc8dcf4070a2f47330efca1603", "value": "" } } }, "version_major": 2, "version_minor": 0 } } }, "nbformat": 4, "nbformat_minor": 5 }