### Install with uv (Preferred) Source: https://deepwiki.com/ansys/pyansys-geometry/7.1-development-environment-setup Preferred development setup using uv. Clones the repository, changes into it, and runs uv sync with the dev group, which includes doc and tests groups, creating a virtual environment and installing all dependencies. ```bash git clone https://github.com/ansys/pyansys-geometry cd pyansys-geometry uv sync --group dev ``` -------------------------------- ### Quick setup commands Source: https://deepwiki.com/ansys/pyansys-geometry/7-development-and-contributing Commands to clone the repository and set up the development environment using uv or pip. The uv command installs the dev group, while pip installs the package in editable mode. ```bash # Clone repository git clone https://github.com/ansys/pyansys-geometry cd pyansys-geometry # Using uv (recommended) uv sync --group dev # Or using pip python -m pip install --upgrade pip pip install -e . ``` -------------------------------- ### Install with pip (Editable Mode) Source: https://deepwiki.com/ansys/pyansys-geometry/7.1-development-environment-setup Alternative setup using standard Python tools. Clones the repository, upgrades pip, and installs the package in editable mode with the dev group. ```bash git clone https://github.com/ansys/pyansys-geometry cd pyansys-geometry python -m pip install --upgrade pip pip install -e . --group dev ``` -------------------------------- ### Development installation with uv or pip Source: https://deepwiki.com/ansys/pyansys-geometry/1.1-installation-and-quick-start Development installation: clone the repository and install in editable mode. uv is preferred; pip alternative is provided. Verify with tox. ```bash # Using uv (Preferred) git clone https://github.com/ansys/pyansys-geometry cd pyansys-geometry uv sync --group dev # Using pip pip install -e . --group dev ``` -------------------------------- ### Install pre-commit with pip and install hooks Source: https://deepwiki.com/ansys/pyansys-geometry/7.2-code-quality-and-pre-commit-hooks Install the pre-commit package and set up the hooks locally to prevent CI failures. ```bash pip install pre-commit pre-commit install ``` -------------------------------- ### Shell commands: Install documentation dependencies and build Source: https://deepwiki.com/ansys/pyansys-geometry/7.6-documentation-build-system Commands to install the documentation dependency group and build the documentation on Windows and Linux/macOS. Run from the 'doc' directory after installation. ```bash # Install documentation dependencies pip install .[doc] # Build on Windows cd doc ./make.bat html # Build on Linux/macOS cd doc make html ``` -------------------------------- ### Integrated Workflow Example Source: https://deepwiki.com/ansys/pyansys-geometry/8.2-script-execution-and-discovery-integration Shows a complete workflow: create a design, run a script with arguments, and continue working with the updated design. The script is passed a dictionary of parameters and return_design=True to get the modified design object. ```python # Create design in Python design = modeler.create_design("Integrated_Example") design.extrude_sketch("Box", Sketch().box(Point2D([0, 0]), 1, 1), 1) # Modify via script values, design = modeler.run_script_file( "integrated_script.py", {"radius": "1"}, return_design=True ) # Continue working in Python assert len(design.bodies) == 2 ``` -------------------------------- ### Install pre-commit hooks with uv Source: https://deepwiki.com/ansys/pyansys-geometry/7.2-code-quality-and-pre-commit-hooks Install the pre-commit hooks using uv, an alternative to pip. ```bash uv run pre-commit install ``` -------------------------------- ### Install documentation dependencies and build HTML documentation Source: https://deepwiki.com/ansys/pyansys-geometry/7-development-and-contributing Commands to install documentation dependencies using uv and build HTML documentation from the doc/ directory. On Windows, use make.bat html. ```bash # Install documentation dependencies uv sync --group doc # Build HTML documentation (from doc/ directory) # On Windows: ./make.bat html ``` -------------------------------- ### Development Installation Workflow Diagram Source: https://deepwiki.com/ansys/pyansys-geometry/7.1-development-environment-setup Mermaid diagram illustrating the development installation workflow, showing the two installation methods (uv and pip) and the steps from cloning to verification. ```mermaid graph LR [start] -- "Developer Machine" --> [start] [clone] -- "git clone" --> [clone] [repo] -- "Local Repository" --> [repo] subgraph "Installation_Methods" [uv_path] -- "uv sync --group dev" --> [uv_path] [pip_path] -- "pip install -e . --group dev" --> [pip_path] end [verify] -- "Verify Installation" --> [verify] [ready] -- "Ready for Development" --> [ready] [start] --> [clone] [clone] --> [repo] [repo] --> [uv_path] [repo] --> [pip_path] [uv_path] --> [verify] [pip_path] --> [verify] [verify] --> [ready] [uv_path] -. "uses" .-> [uv.lock] [pip_path] -. "installs" .-> [editable_mode] ``` -------------------------------- ### Install ansys-geometry-core with pip or uv Source: https://deepwiki.com/ansys/pyansys-geometry/1.1-installation-and-quick-start Install ansys-geometry-core via pip or uv. Ensure pip is up to date before installing. ```bash # Using pip python -m pip install ansys-geometry-core # Using uv uv add ansys-geometry-core ``` -------------------------------- ### Minimal Working Example: Create and Export a Cylinder Source: https://deepwiki.com/ansys/pyansys-geometry/1.1-installation-and-quick-start Minimal working example that creates a cylinder by extruding a circle. It imports launch_modeler, Plane, Point3D, Point2D, UNITS, Distance, and Sketch, defines a sketch plane, creates a circle, launches a modeler session, creates a design, extrudes the sketch, and exports the model to an SCDOCX file. ```python from ansys.geometry.core import launch_modeler from ansys.geometry.core.math import Plane, Point3D, Point2D from ansys.geometry.core.misc import UNITS, Distance from ansys.geometry.core.sketch import Sketch # Define a sketch plane origin = Point3D([0, 0, 10]) plane = Plane(origin, direction_x=[1, 0, 0], direction_y=[0, 1, 0]) # Create a sketch with a circle sketch = Sketch(plane) sketch.circle(Point2D([1, 1]), 30 * UNITS.m) # Start a modeler session and create a design modeler = launch_modeler() design = modeler.create_design("ModelingDemo") # Create a body by extruding the sketch body = design.extrude_sketch( name="CylinderBody", sketch=sketch, distance=Distance(80, unit=UNITS.m) ) # Export the model file_path = design.export_to_scdocx() ``` -------------------------------- ### Install Pre-commit Hooks Source: https://deepwiki.com/ansys/pyansys-geometry/7.1-development-environment-setup Installs the pre-commit hooks defined in `.pre-commit-config.yaml`, ensuring tools like `ruff` and `codespell` run before every commit. ```bash pre-commit install ``` -------------------------------- ### Install test dependencies and run test suite with tracker Source: https://deepwiki.com/ansys/pyansys-geometry/7-development-and-contributing Commands to install test dependencies using uv and run the full test suite with the --use-tracker=yes option. The test suite requires a running Geometry service backend. ```bash # Install test dependencies uv sync --group tests # Run full test suite with specific protocol version uv run pytest -v --use-tracker=yes ``` -------------------------------- ### Installation Flow Diagram Source: https://deepwiki.com/ansys/pyansys-geometry/1.1-installation-and-quick-start Mermaid diagram showing the installation channels (PyPI, Conda, Dev_Source, Offline_Archive) and the code entry points (ansys.geometry.core, launch_modeler, Modeler_Instance). ```mermaid graph TB ["User"] -- "Installs via" --> ["Installation_Channels"] subgraph ["Installation_Channels"] ["PyPI"] -- "pip install ansys-geometry-core" --> ["Installed_Package"] ["Conda"] -- "conda install -c conda-forge ansys-geometry-core" --> ["Installed_Package"] ["Dev_Source"] -- "git clone + pip install -e ." --> ["Installed_Package"] ["Offline_Archive"] -- "wheelhouse zip" --> ["Installed_Package"] end ["Installed_Package"] -- "provides" --> ["ansys.geometry.core"] subgraph ["Code_Entry_Points"] ["ansys.geometry.core"] -- "import" --> ["launch_modeler"] ["launch_modeler"] -- "initializes" --> ["Modeler_Instance"] end ``` -------------------------------- ### Offline installation from wheelhouse (Linux, Python 3.12) Source: https://deepwiki.com/ansys/pyansys-geometry/1.1-installation-and-quick-start Offline installation for Linux, Python 3.12: unzip the wheelhouse archive and install with pip using the wheelhouse as the only index. ```bash unzip ansys_geometry_core-v0.16.dev0-all-wheelhouse-ubuntu-3.12.zip wheelhouse pip install ansys-geometry-core -f wheelhouse --no-index --upgrade --ignore-installed ``` -------------------------------- ### Set Up Virtual Environment with venv Source: https://deepwiki.com/ansys/pyansys-geometry/7.1-development-environment-setup Creates and activates a virtual environment using `venv`, then installs the package in editable mode with the `dev` dependency group. The activation command differs by platform: `source .venv/bin/activate` for Linux/macOS and `.venv\Scripts\Activate.ps1` for Windows PowerShell. ```bash python -m venv .venv source .venv/bin/activate # On Linux/macOS .venv\Scripts\Activate.ps1 # On Windows (PowerShell) pip install -e . --group dev ``` -------------------------------- ### Install ansys-geometry-core with conda Source: https://deepwiki.com/ansys/pyansys-geometry/1.1-installation-and-quick-start Install ansys-geometry-core from conda-forge. First updates conda in the base environment. ```bash conda update -n base -c defaults conda conda install -c conda-forge ansys-geometry-core ``` -------------------------------- ### Arc.__init__(start, end, center, clockwise) Source: https://deepwiki.com/ansys/pyansys-geometry/4.2-arc-construction-strategies Primary constructor for creating an arc by specifying start point, end point, center point, and rotation direction. Performs validation checks for point distinctness, equidistance, positive radius, and angle computation. ```APIDOC ## Arc.__init__(start, end, center, clockwise) ### Description Creates an arc by directly specifying the start point, end point, center point, and rotation direction. Validates that points are distinct, start and end are equidistant from center, radius is positive, and computes the arc angle. ### Method Constructor ### Parameters - **start** (Point2D) - Required - The starting point of the arc. - **end** (Point2D) - Required - The ending point of the arc. - **center** (Point2D) - Required - The center point of the arc. - **clockwise** (bool) - Required - Rotation direction; if True, the arc is drawn clockwise. ### Validation Logic 1. **Point Distinctness:** Start, end, and center must all be different points. 2. **Equidistance:** Start and end must be equidistant from center (within numerical tolerance). 3. **Positive Radius:** The computed radius must be positive. 4. **Angle Computation:** The arc angle is computed counter-clockwise using `get_angle_between`, then adjusted if clockwise rotation is specified. ### Exceptions - **ValueError** - If start, end, or center are not distinct. - **ValueError** - If start and end are not equidistant from center. ### Example ```python arc = Arc(Point2D([10, 10]), Point2D([10, -10]), Point2D([10, 0]), clockwise=False) ``` ``` -------------------------------- ### Windows container build workflow Source: https://deepwiki.com/ansys/pyansys-geometry/7.4-cicd-pipeline Mermaid flowchart showing the steps of the build-windows-container job. It downloads the windows-core-binaries.zip artifact, builds a Docker image, installs the package, runs tests, compresses and uploads the Dockerfile, and cleans up containers and images. ```mermaid graph TB Download["Download Artifact
windows-core-binaries.zip"] Build["docker build
-f windows/coreservice/Dockerfile
-t ghcr.io/ansys/geometry:windows-tmp"] Install["pip install -e .
--group tests"] Start["docker run --detach
-e LICENSE_SERVER
-p 700:50051"] Test["pytest -v
--use-existing-service=yes"] Compress["Compress Dockerfile
windows-core-dockerfile.zip"] Upload["Upload Dockerfile artifact"] Clean["docker stop/rm
docker system prune"] Download --> Build Build --> Install Install --> Start Start --> Test Test --> Compress Compress --> Upload Upload --> Clean ``` -------------------------------- ### Verify PyAnsys Geometry Installation Source: https://deepwiki.com/ansys/pyansys-geometry/7.1-development-environment-setup Verifies that PyAnsys Geometry is installed and can connect to a service. The output should show a `Healthy` connection status and the target address (defaulting to `localhost:652`). ```python from ansys.geometry.core import Modeler modeler = Modeler() print(modeler) ``` -------------------------------- ### Mermaid diagram: Notebook execution and rendering flow Source: https://deepwiki.com/ansys/pyansys-geometry/7.6-documentation-build-system A Mermaid diagram illustrating the build process, showing how environment variables, the geometry service, and PyVista interact with Sphinx to generate example HTML pages. ```mermaid graph LR subgraph "Execution_Environment" ENV["Environment Variables (PYANSYS_VISUALIZER_DOC_MODE)"] SERVICE["Geometry Service (Docker/Local)"] end subgraph "Build_Process" NB["examples/*.mystnb"] SPHINX["Sphinx-build (doc/source/conf.py)"] PYVISTA["PyVista (Headless)"] end ENV --> SPHINX NB --> SPHINX SPHINX -- "gRPC Communication" --> SERVICE SPHINX -- "Tessellation Rendering" --> PYVISTA PYVISTA --> HTML["doc/_build/html/examples/"] ``` -------------------------------- ### Sketch arc() and arc_to_point() direct arc construction Source: https://deepwiki.com/ansys/pyansys-geometry/4.2-arc-construction-strategies Direct arc construction using the Sketch convenience methods. Must first create a Sketch instance to use these methods. The first line uses arc() with explicit start, end, and center points; the following lines use arc_to_point() which starts from the previous edge endpoint (here, the endpoint of the segment from [0,0] to [3,3]). ```python # Explicit start point sketch.arc(Point2D([10, 10]), Point2D([10, -10]), Point2D([10, 0])) # Fluent API with context tracking sketch.segment(Point2D([0, 0]), Point2D([3, 3])) sketch.arc_to_point(Point2D([0, 0]), Point2D([3, 0])) # Starts from [3, 3] ``` -------------------------------- ### Get Active Document for Discovery/SpaceClaim Desktop Source: https://deepwiki.com/ansys/pyansys-geometry/8.2-script-execution-and-discovery-integration Use this to access the active document when running on Discovery or SpaceClaim Desktop. ```python doc = GetActiveWindow().Document ``` -------------------------------- ### Sketch.arc(start, end, center) Source: https://deepwiki.com/ansys/pyansys-geometry/4.2-arc-construction-strategies Convenience method on the Sketch class to create an arc by explicitly specifying all three points: start, end, and center. ```APIDOC ## Sketch.arc(start, end, center) ### Description Creates an arc by explicitly specifying the start point, end point, and center point. This method is a convenience wrapper around the Arc constructor. ### Method Method ### Parameters - **start** (Point2D) - Required - The starting point of the arc. - **end** (Point2D) - Required - The ending point of the arc. - **center** (Point2D) - Required - The center point of the arc. ### Example ```python sketch.arc(Point2D([10, 10]), Point2D([10, -10]), Point2D([10, 0])) ``` ``` -------------------------------- ### Failing script example that may raise GeometryRuntimeError Source: https://deepwiki.com/ansys/pyansys-geometry/8.2-script-execution-and-discovery-integration Example of a script that may fail if numpy is not available in the backend environment, causing a GeometryRuntimeError. The script imports numpy and then contains geometry logic, returning a result dictionary with 'design' and 'design_body' keys. ```python # Failing script example import numpy as np # Might fail if numpy is not in backend environment # ... geometry logic ... result = {"design": doc, "design_body": db} ``` -------------------------------- ### Minimum Requirements Testing Job Configuration Source: https://deepwiki.com/ansys/pyansys-geometry/7.4-cicd-pipeline Defines the testing-min-reqs job that validates the package with minimum supported dependency versions. It runs on Ubuntu with Python 3.12, 3.13, and 3.14, and installs the tests-minimal group. ```yaml testing-min-reqs: name: Testing with minimum requirements needs: [smoke-tests] runs-on: ubuntu-latest strategy: fail-fast: false matrix: python-version: ['3.12', '3.13', '3.14'] steps: # ... setup steps ... - name: Install minimum requirements run: | python -m pip install --upgrade pip pip install -e .[all] --group tests-minimal ``` -------------------------------- ### Get Active Document for Core Geometry Service Source: https://deepwiki.com/ansys/pyansys-geometry/8.2-script-execution-and-discovery-integration Use this to access the active document when running on the Core Geometry Service (Linux/Windows). ```python doc = GetActiveDocument() ``` -------------------------------- ### Sketch.arc_to_point(end, center) Source: https://deepwiki.com/ansys/pyansys-geometry/4.2-arc-construction-strategies Convenience method on the Sketch class to create an arc by specifying the end point and center point, with the start point taken from the previous edge endpoint. ```APIDOC ## Sketch.arc_to_point(end, center) ### Description Creates an arc by specifying the end point and center point, with the start point taken from the previous edge endpoint. This method is part of the fluent API with context tracking. ### Method Method ### Parameters - **end** (Point2D) - Required - The ending point of the arc. - **center** (Point2D) - Required - The center point of the arc. ### Example ```python sketch.segment(Point2D([0, 0]), Point2D([3, 3])) sketch.arc_to_point(Point2D([0, 0]), Point2D([3, 0])) # Starts from [3, 3] ``` ``` -------------------------------- ### Run pre-commit on all files with uv Source: https://deepwiki.com/ansys/pyansys-geometry/7.2-code-quality-and-pre-commit-hooks Execute all pre-commit hooks on all files using uv. ```bash uv run pre-commit run --all-files ``` -------------------------------- ### Docs job: build documentation with Sphinx Source: https://deepwiki.com/ansys/pyansys-geometry/7.4-cicd-pipeline This job named 'docs' runs on ubuntu-latest and sets up a headless display using the PyVista action. It pulls and launches a geometry service Docker container, then invokes the Ansys doc-build action with Python version, PDF/HTML assets, LaTeX dependencies, and Sphinx options. Sphinx options include '-j 1' (single-threaded), '-W' (treat warnings as errors), and '--color'. ```yaml docs: name: Documentation needs: [docs-style] runs-on: ubuntu-latest steps: - name: Set up headless display uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3 - name: Pull and launch geometry service run: | docker pull ${ANSRV_GEO_IMAGE_DOCS_TAG} docker run --detach --name ${GEO_CONT_NAME} -e LICENSE_SERVER=${ANSRV_GEO_LICENSE_SERVER} -p ${ANSRV_GEO_PORT}:50051 ${ANSRV_GEO_IMAGE_DOCS_TAG} ${TRANSPORT_MODE_SELECTION} - name: Run Ansys documentation building action uses: ansys/actions/doc-build@0b23d99e6800f16337ff173fcfbfcc1251130e99 # v11.0.2 with: python-version: ${{ env.MAIN_PYTHON_VERSION }} add-pdf-html-docs-as-assets: true needs-quarto: false dependencies: 'pandoc texlive-xetex texlive-fonts-recommended texlive-fonts-extra texlive-latex-extra texlive-luatex lmodern latexmk' sphinxopts: '-j 1 -W --color' group-dependencies-name: "doc" ``` -------------------------------- ### Connection Lifecycle Diagram (Mermaid) Source: https://deepwiki.com/ansys/pyansys-geometry/2-core-architecture Mermaid diagram illustrating the connection lifecycle, from initialization through launch_modeler() and wait_until_healthy(), to active usage with Modeler and Design, and cleanup via GrpcClient.close() and instance.delete(). ```mermaid graph TB subgraph "Initialization" Launch["launch_modeler()"] WaitHealthy["wait_until_healthy()"] end subgraph "Active" Modeler["Modeler Instance"] Design["Design Operations"] end subgraph "Cleanup" Close["GrpcClient.close()"] InstanceDel["instance.delete()"] end Launch --> WaitHealthy WaitHealthy --> Modeler Modeler --> Design Design --> Close Close --> InstanceDel ``` -------------------------------- ### Manual Build Workflow Diagram Source: https://deepwiki.com/ansys/pyansys-geometry/7.5-docker-image-lifecycle Flowchart of the manual build workflow for the Windows Docker image. It shows the sequence from detecting AWP_ROOT* environment variables, selecting the version, verifying ANSYS_PATH, creating a temporary directory, copying the GeometryService, archiving binaries, and finally running docker build with the tag core-windows-latest. ```mermaid graph TD Script["build_docker_windows.py"] AWP["AWP_ROOT* Env Var Detection"] Select["User Version Selection"] Path["ANSYS_PATH Verification"] Temp["Create TMP_DIR"] Copy["shutil.copytree GeometryService"] Zip["shutil.make_archive binaries"] Docker["docker build -t core-windows-latest"] Script --> AWP AWP --> Select Select --> Path Path --> Temp Temp --> Copy Copy --> Zip Zip --> Docker ``` -------------------------------- ### Run integration tests against existing service Source: https://deepwiki.com/ansys/pyansys-geometry/7.3-testing-infrastructure Runs integration tests against an existing service, specifying the proto version and transport mode. ```bash pytest tests/integration/ --use-existing-service=yes --proto-version=v1 --transport-mode=insecure ``` -------------------------------- ### Data flow from Modeler to cyberchannel.create_channel Source: https://deepwiki.com/ansys/pyansys-geometry/2.4.3-transport-modes-and-security Flowchart showing the data flow from Modeler.__init__ through GrpcClient.__init__, wait_until_healthy(), _create_geometry_channel(), and finally to cyberchannel.create_channel(). It highlights the gRPC options for MAX_MESSAGE_LENGTH and the subgraph of client.py components. ```mermaid flowchart LR M["modeler.py:Modeler.__init__"] -- "transport_mode, uds_dir, certs_dir" --> GC["client.py:GrpcClient.__init__"] GC -- "calls" --> WUH["client.py:wait_until_healthy()"] WUH -- "if channel is str" --> CGC["client.py:_create_geometry_channel()"] CGC -- "configures" --> Options["grpc_options:MAX_MESSAGE_LENGTH"] Options -- "Final Call" --> Cyber["cyberchannel:create_channel()"] subgraph "src/ansys/geometry/core/connection/client.py" GC WUH CGC end ``` -------------------------------- ### Deployment Interaction Flow Sequence Diagram Source: https://deepwiki.com/ansys/pyansys-geometry/2.3-docker-container-deployment A Mermaid sequence diagram illustrating the interaction between the user, Python client, Docker engine, and the Geometry service container. ```mermaid sequenceDiagram participant U as "User/Script" participant M as "Modeler (Python Client)" participant D as "Docker Engine" participant S as "Geometry Service (Inside Container)" U->>D: docker run -e ANSYSLMD_LICENSE_FILE=... -p 50051:50051 D->>S: Start Presentation.ApiServerCoreService.dll S->>S: Listen on 0.0.0.0:50051 U->>M: modeler = Modeler(host="localhost", port=50051) M->>S: gRPC Connection Request S-->>M: Connection Established ``` -------------------------------- ### Run pre-commit on all files Source: https://deepwiki.com/ansys/pyansys-geometry/7.2-code-quality-and-pre-commit-hooks Execute all pre-commit hooks on all files without committing. ```bash pre-commit run --all-files ``` -------------------------------- ### full_fillet() Source: https://deepwiki.com/ansys/pyansys-geometry/5.2-geometrycommands-api Creates a full fillet on selected faces. The implementation differs between gRPC service versions V0 and V1. ```APIDOC ## full_fillet() ### Description Creates a full fillet on selected faces. The implementation differs between gRPC service versions V0 and V1. ### Method full_fillet ### Parameters - **faces** (list) - Required - The faces to fillet. ### Response Returns the modified bodies. ``` -------------------------------- ### Run integration tests with tracker enabled Source: https://deepwiki.com/ansys/pyansys-geometry/7.3-testing-infrastructure Runs integration tests with the tracker enabled. ```bash pytest tests/integration/ --use-tracker=yes ``` -------------------------------- ### Script Format Routing Diagram Source: https://deepwiki.com/ansys/pyansys-geometry/8.2-script-execution-and-discovery-integration Mermaid diagram showing how Python, SpaceClaim, and Discovery scripts are routed to the GRPCCommandsScriptServiceV1 based on their file extensions. ```mermaid graph LR subgraph "Supported_Extensions" ["Python_Script"] -- ".py" --> ["Script_Router"] ["SpaceClaim_Script"] -- ".scscript" --> ["Script_Router"] ["Discovery_Script"] -- ".dscript" --> ["Script_Router"] end subgraph "Execution_Context" ["Script_Router"] --> ["GRPCCommandsScriptServiceV1"] end ``` -------------------------------- ### Verify backend connection with Modeler Source: https://deepwiki.com/ansys/pyansys-geometry/1.1-installation-and-quick-start Verifies the connection to the backend service using the Modeler class. The expected output shows the modeler and client object addresses, the target localhost:652, and a healthy connection status. ```python from ansys.geometry.core import Modeler modeler = Modeler() print(modeler) ``` ```text Ansys Geometry Modeler (0x205c5c17d90) Ansys Geometry Modeler Client (0x205c5c16e00) Target: localhost:652 Connection: Healthy ``` -------------------------------- ### Integration Testing Workflow Diagram Source: https://deepwiki.com/ansys/pyansys-geometry/7.4-cicd-pipeline Mermaid diagram illustrating the integration testing workflow for both Windows and Linux jobs, showing the matrix strategy, test execution steps, and artifact upload. ```mermaid graph TB subgraph "testing-windows" WinMatrix["Matrix Strategy:
use-tracker: [no, yes]
docker-image: [stable, unstable]
Excludes: v0 + tracker"] end subgraph "testing-linux" LinMatrix["Matrix Strategy:
use-tracker: [no, yes]
docker-image: [stable, unstable]
Excludes: v0 + tracker"] end subgraph "Test Execution Steps" Setup["Setup Python 3.14
Setup headless display
Install test dependencies"] Docker["Login GHCR
Pull geometry image
docker run with LICENSE_SERVER"] Cache["Restore pyvista image cache
Key: OS-pyproject.toml hash"] Pytest["pytest -v
--use-tracker"] Upload["Upload artifacts:
- integration logs
- pyvista images
- coverage HTML/XML"] Stop["docker stop/logs/rm"] end WinMatrix --> Setup LinMatrix --> Setup Setup --> Docker Docker --> Cache Cache --> Pytest Pytest --> Upload Upload --> Stop ``` -------------------------------- ### Build Linux container job Source: https://deepwiki.com/ansys/pyansys-geometry/7.4-cicd-pipeline GitHub Actions job that builds the Linux Docker container. It downloads the linux-core-binaries.zip artifact, builds the image, and runs the test suite with the --use-existing-service=yes flag. ```yaml build-linux-container: name: Building Geometry Service - Linux runs-on: ubuntu-latest needs: [fetch-release-artifacts] steps: - name: Download Linux binaries uses: actions/download-artifact@fa0b92f8cc0bfe9080cd720917daa21d4007c1bc # v4.1.8 with: name: linux-core-binaries.zip path: docker/linux-core-binaries.zip - name: Build Docker image working-directory: docker run: | docker build -f linux/coreservice/Dockerfile -t ghcr.io/ansys/geometry:linux-tmp . - name: Run pytest uses: ansys/actions/tests-pytest@0b23d99e6800f16337ff173fcfbfcc1251130e99 # v11.0.2 with: pytest-extra-args: "--use-existing-service=yes" ``` -------------------------------- ### CodeQL Security Analysis Workflow Diagram Source: https://deepwiki.com/ansys/pyansys-geometry/7.4-cicd-pipeline Mermaid diagram illustrating the CodeQL security analysis workflow. It shows that a weekly schedule (Thursday 22:45 UTC) and PR/push to main trigger the codeql.yml analyze job, which initializes CodeQL for Python, autobuilds, performs analysis, and uploads results to security events. ```mermaid graph LR Schedule["Weekly Schedule
Thursday 22:45 UTC"] PRPush["PR/Push to main"] Schedule --> CodeQL["codeql.yml
analyze job"] PRPush --> CodeQL CodeQL --> Init["Initialize CodeQL
Python language"] Init --> Autobuild["Autobuild"] Autobuild --> Analyze["Perform CodeQL Analysis"] Analyze --> Upload["Upload to Security Events"] ``` -------------------------------- ### Basic Sketch construction pattern Source: https://deepwiki.com/ansys/pyansys-geometry/4.1-sketch-primitives-and-construction Basic construction pattern for creating a Sketch. Imports Sketch, Point2D, Plane, and Point3D; creates a sketch on the default XY plane or a custom plane with origin at [0,0,5]; then adds a circle and a segment. ```python from ansys.geometry.core.sketch import Sketch from ansys.geometry.core.math import Point2D, Plane, Point3D # Create sketch on default XY plane sketch = Sketch() # Create sketch on custom plane custom_plane = Plane(origin=Point3D([0, 0, 5])) sketch = Sketch(plane=custom_plane) # Add geometry to sketch sketch.circle(Point2D([0, 0]), radius=10) sketch.segment(Point2D([0, 0]), Point2D([10, 10])) ``` -------------------------------- ### GeometryCommands Method Mapping Diagram Source: https://deepwiki.com/ansys/pyansys-geometry/5.2-geometrycommands-api Mermaid diagram showing the mapping between GeometryCommands methods and backend services. Use to understand which service handles each operation category. ```mermaid graph LR subgraph "GeometryCommands Methods" subgraph "Edge/Face Modification" chamfer["chamfer()"] fillet["fillet()"] full_fillet["full_fillet()"] end subgraph "Extrusion Operations" extrude_faces["extrude_faces()"] extrude_edges["extrude_edges()"] end subgraph "Pattern Operations" create_linear["create_linear_pattern()"] create_circular["create_circular_pattern()"] create_fill["create_fill_pattern()"] end subgraph "Revolve Operations" revolve_faces["revolve_faces()"] revolve_pts["revolve_points()"] end subgraph "Other Operations" split["split_body()"] detach_faces["detach_faces()"] end end subgraph "Backend Services" model_tools["model_tools service"] faces_svc["faces service"] edges_svc["edges service"] patterns_svc["patterns service"] end chamfer --> model_tools fillet --> model_tools full_fillet --> model_tools detach_faces --> model_tools extrude_faces --> faces_svc extrude_edges --> edges_svc create_linear --> patterns_svc create_circular --> patterns_svc create_fill --> patterns_svc split --> model_tools ``` -------------------------------- ### run_script_file Source: https://deepwiki.com/ansys/pyansys-geometry/8.2-script-execution-and-discovery-integration Executes a script file (.py, .scscript, or .dscript) in the SpaceClaim environment. Returns the updated Design object if return_design is True. ```APIDOC ## run_script_file ### Description Executes a script file (.py, .scscript, or .dscript) in the SpaceClaim environment. Returns the updated Design object if return_design is True. ### Method run_script_file ### Parameters - **file_path** (string) - Required - Path to the script file (`.py`, `.scscript`, or `.dscript`) - **script_args** (dict) - Required - Dictionary of parameters to pass to the script (accessible as `argsDict` inside the script context) - **return_design** (bool) - Optional - If `True`, returns the updated `Design` object after script execution - **api_version** (ApiVersions) - Optional - SpaceClaim API version to use. Use `ApiVersions.LATEST` to target the most recent supported version ### Request Example ```python values, design = modeler.run_script_file( "integrated_script.py", {"radius": "1"}, return_design=True ) ``` ### Response Returns a tuple containing the script output values and, if `return_design` is True, the updated `Design` object. ``` -------------------------------- ### Nightly Test and Promotion Flow (Mermaid) Source: https://deepwiki.com/ansys/pyansys-geometry/7.5-docker-image-lifecycle Mermaid flowchart showing the nightly schedule (0300, 1100, 1900 UTC) triggering the nightly_docker_test.yml workflow. The workflow compares stable vs unstable manifests, runs Windows and Linux tests with a use-tracker matrix, promotes on success, and notifies Microsoft Teams on failure. ```mermaid flowchart LR subgraph Schedule["Nightly Schedule (UTC)"] T1["0300"] T2["1100"] T3["1900"] end subgraph Workflow["nightly_docker_test.yml"] Manifests["manifests Job
Compare stable vs unstable"] WinTests["windows-tests Job
Matrix: use-tracker"] LinTests["linux-tests Job
Matrix: use-tracker"] PromoteWin["promote-windows Job"] PromoteLin["promote-linux Job"] end subgraph Notification["Failure Handling"] Teams["Microsoft Teams Webhook
skitionek/notify-microsoft-teams"] end T1 --> Manifests T2 --> Manifests T3 --> Manifests Manifests --> WinTests Manifests --> LinTests WinTests --> PromoteWin LinTests --> PromoteLin WinTests -.->|Failure| Teams LinTests -.->|Failure| Teams ``` -------------------------------- ### Version Compatibility and Service Selection Diagram Source: https://deepwiki.com/ansys/pyansys-geometry/8.2-script-execution-and-discovery-integration Mermaid diagram showing how the Modeler checks GeometryApiProtos to select between V0 and V1 services based on API version, with a warning log for ApiVersions.LATEST. ```mermaid graph TD subgraph "Code_Entity_Space" ["Modeler"] -- "checks" --> ["GeometryApiProtos"] ["GeometryApiProtos"] -- "selects" --> ["V0_Service"] ["GeometryApiProtos"] -- "selects" --> ["V1_Service"] end subgraph "Compatibility_Logic" ["V0_Service"] -- "limit" --> ["API_Version_LT_271"] ["V1_Service"] -- "support" --> ["API_Version_GE_271"] ["ApiVersions.LATEST"] -- "triggers" --> ["Warning_Log"] end ``` -------------------------------- ### Access Repair and Measurement Tools via Modeler Source: https://deepwiki.com/ansys/pyansys-geometry/5.5-repair-tools Shows the correct way to access RepairTools and MeasurementTools through the Modeler instance. Direct instantiation raises a GeometryRuntimeError. ```python modeler = launch_modeler() repair_tools = modeler.repair_tools measurement_tools = modeler.measurement_tools ``` -------------------------------- ### fillet() Source: https://deepwiki.com/ansys/pyansys-geometry/5.2-geometrycommands-api Creates a fillet on selected edges. Handled differently in GRPCModelToolsServiceV0 and GRPCModelToolsServiceV1. ```APIDOC ## fillet() ### Description Creates a fillet on selected edges. The implementation differs between gRPC service versions V0 and V1. ### Method fillet ### Parameters - **edges** (list) - Required - The edges to fillet. - **radius** (Distance) - Required - The fillet radius. ### Response Returns the modified bodies. ``` -------------------------------- ### gRPC Repair Service Implementation Mapping Diagram Source: https://deepwiki.com/ansys/pyansys-geometry/5.5-repair-tools Mermaid diagram showing the architecture of the repair tools gRPC service layer, including the RepairTools class, base service, and version-specific implementations (v0 and v1) with their stubs. ```mermaid graph TD subgraph "Natural Language Space" RepairInterface["Repair Interface"] ProblemDetection["Problem Detection"] end subgraph "Code Entity Space" RepairTools["RepairTools
(repair_tools.py)"] BaseService["GRPCRepairToolsService
(base/repair_tools.py)"] V0Service["GRPCRepairToolsServiceV0
(v0/repair_tools.py)"] V1Service["GRPCRepairToolsServiceV1
(v1/repair_tools.py)"] V0Stub["RepairToolsStub (v0)"] V1Stub["RepairStub (v1)"] end RepairInterface --> RepairTools ProblemDetection --> RepairTools RepairTools --> BaseService BaseService <|-- V0Service BaseService <|-- V1Service V0Service -->|"FindSplitEdges()"| V0Stub V1Service -->|"FindSplitEdges()"| V1Stub ``` -------------------------------- ### Package job: build library with SLSA attestation Source: https://deepwiki.com/ansys/pyansys-geometry/7.4-cicd-pipeline This job named 'package' builds source and wheel artifacts using the Ansys build-library action. It sets permissions for attestations, contents, and id-token, and enables SLSA provenance attestation with 'attest-provenance: true'. The job waits for all required test and documentation jobs to pass. ```yaml package: name: Package library needs: [testing-windows, testing-linux, testing-min-reqs, testing-no-graphics, docs] runs-on: ubuntu-latest permissions: attestations: write contents: read id-token: write steps: - name: Build library source and wheel artifacts uses: ansys/actions/build-library@0b23d99e6800f16337ff173fcfbfcc1251130e99 # v11.0.2 with: library-name: ${{ env.PACKAGE_NAME }} python-version: ${{ env.MAIN_PYTHON_VERSION }} attest-provenance: true ``` -------------------------------- ### create_fill_pattern() Source: https://deepwiki.com/ansys/pyansys-geometry/5.2-geometrycommands-api Creates a fill pattern. Communicates with the patterns service via gRPC. ```APIDOC ## create_fill_pattern() ### Description Creates a fill pattern. ### Method create_fill_pattern ### Parameters - **boundary** (list) - Required - The boundary for the fill pattern. - **pattern_type** (PatternType) - Required - The type of fill pattern. - **spacing** (Distance) - Required - The spacing between instances. - **angle** (Angle) - Optional - The angle for the pattern. - **origin** (Point) - Optional - The origin for the pattern. ### Response Returns the created bodies from the pattern operation. ``` -------------------------------- ### Release pipeline job dependency graph (Mermaid) Source: https://deepwiki.com/ansys/pyansys-geometry/7.7-release-process Mermaid flowchart showing the dependencies between CI jobs during a tag push release. It illustrates the sequence from tag push through testing, packaging, and release. ```mermaid flowchart TD "Tag_push:v*.*.*"["Tag push: v*.*.*"] --> "update-changelog" "Tag_push:v*.*.*" --> "vulnerabilities" "Tag_push:v*.*.*" --> "actions-security" "Tag_push:v*.*.*" --> "smoke-tests" "Tag_push:v*.*.*" --> "testing-windows" "Tag_push:v*.*.*" --> "testing-linux" "Tag_push:v*.*.*" --> "docs" "Tag_push:v*.*.*" --> "testing-backwards-compatibility-windows" "smoke-tests" --> "package" "testing-windows" --> "package" "testing-linux" --> "package" "docs" --> "package" "testing-backwards-compatibility-windows" --> "package" "package" --> "release" "release" --> "public-release-pypi" "release" --> "doc-deploy-stable" ``` -------------------------------- ### Docker Manifest Comparison Workflow Diagram Source: https://deepwiki.com/ansys/pyansys-geometry/7.5-docker-image-lifecycle Mermaid flowchart depicting the manifest comparison workflow. It shows the sequence: logging into GHCR, inspecting stable and unstable Docker image manifests, comparing them, and setting a skip flag based on whether they are identical. ```mermaid flowchart TD Start["Start: manifests Job"] Login["Login to GHCR
docker/login-action"] InspectStable["docker manifest inspect
ghcr.io/ansys/geometry:core-{os}-latest"] InspectUnstable["docker manifest inspect
ghcr.io/ansys/geometry:core-{os}-latest-unstable"] Compare{"diff stable.json
unstable.json"} SetSkip["Set skip_{service}=1"] SetNoSkip["Set skip_{service}=0"] Output["Output to GITHUB_OUTPUT"] Start --> Login Login --> InspectStable InspectStable --> InspectUnstable InspectUnstable --> Compare Compare -- "Manifests identical" --> SetSkip Compare -- "Manifests different" --> SetNoSkip SetSkip --> Output SetNoSkip --> Output ``` -------------------------------- ### CI/CD Pipeline Architecture Diagram Source: https://deepwiki.com/ansys/pyansys-geometry/7.4-cicd-pipeline Mermaid diagram showing the pipeline stages: triggers, quality gates, build/test, integration tests, documentation, packaging, and release. Arrows indicate dependencies between jobs. ```mermaid graph TB subgraph "Triggers" PR["Pull Request"] MainPush["Push to main"] TagPush["Push tag *"] Manual["workflow_dispatch"] end subgraph "Quality Gates" Vuln["vulnerabilities
check-vulnerabilities action"] ActSec["actions-security
check-actions-security action"] PRName["pr-name
check-pr-title action"] DocsStyle["docs-style
doc-style action"] DockerStyle["docker-style
docker-style action"] end subgraph "Build & Test" Smoke["smoke-tests
build-wheelhouse action
OS: ubuntu/windows/macos
Python: 3.12-3.14"] Manifests["manifests
Compare stable vs unstable"] end subgraph "Integration Tests" WinTest["testing-windows
Proto: v0/v1
Tracker: yes/no
Images: stable/unstable"] LinTest["testing-linux
Proto: v0/v1
Tracker: yes/no
Images: stable/unstable"] MinReqs["testing-min-reqs
Python: 3.12-3.14"] NoGraphics["testing-no-graphics
Python: 3.12, 3.14"] end subgraph "Documentation" Docs["docs
doc-build action
HTML + PDF"] end subgraph "Packaging" Package["package
build-library action
wheel + sdist"] end subgraph "Release (tags only)" FetchArtifacts["fetch-release-artifacts
Self-hosted Windows"] BuildWin["build-windows-container
Self-hosted Windows"] BuildLinux["build-linux-container
Ubuntu"] Release["release
GitHub + PyPI + Docs"] end PR --> Vuln PR --> ActSec PR --> PRName PR --> DocsStyle PR --> DockerStyle PR --> Smoke Smoke --> Manifests Smoke --> MinReqs Smoke --> NoGraphics Manifests --> WinTest Manifests --> LinTest DocsStyle --> Docs WinTest --> Package LinTest --> Package MinReqs --> Package NoGraphics --> Package Docs --> Package TagPush --> FetchArtifacts WinTest --> FetchArtifacts LinTest --> FetchArtifacts Docs --> FetchArtifacts FetchArtifacts --> BuildWin FetchArtifacts --> BuildLinux BuildWin --> Release BuildLinux --> Release Package --> Release ``` -------------------------------- ### GRPCBodyService class diagram Source: https://deepwiki.com/ansys/pyansys-geometry/2.4.1-service-layer-organization Mermaid class diagram showing the abstract GRPCBodyService base class and its two implementations, GRPCBodyServiceV0 and GRPCBodyServiceV1, with their gRPC stubs and key methods. ```mermaid classDiagram class GRPCBodyService { <> +__init__(channel: grpc.Channel) +create_sphere_body(**kwargs) dict* +create_extruded_body(**kwargs) dict* +create_sweeping_profile_body(**kwargs) dict* +translate(**kwargs) dict* +get_faces(**kwargs) dict* +get_edges(**kwargs) dict* +get_vertices(**kwargs) dict* +boolean(**kwargs) dict* } class GRPCBodyServiceV0 { -stub: BodiesStub -command_stub: CommandsStub +__init__(channel) +create_sphere_body(**kwargs) } class GRPCBodyServiceV1 { -stub: BodyStub -edit_stub: EditStub -face_stub: FaceStub +__init__(channel) +create_sphere_body(**kwargs) } GRPCBodyService <|-- GRPCBodyServiceV0 : implements GRPCBodyService <|-- GRPCBodyServiceV1 : implements ```