├── .gitattributes ├── .github ├── CODEOWNERS ├── codeql-config.yml ├── dependabot.yml ├── labeler.yml ├── labels.yml ├── pull_request_template.md └── workflows │ ├── ci_cd.yml │ ├── codeql.yml │ ├── docker_ansyslab_linux.yml │ ├── docker_ansyslab_windows.yml │ ├── docker_cleanup.yml │ ├── label.yml │ └── nightly_docker_test.yml ├── .gitignore ├── .pre-commit-config.yaml ├── AUTHORS ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── CONTRIBUTORS.md ├── LICENSE ├── README.rst ├── SECURITY.md ├── codecov.yml ├── doc ├── .vale.ini ├── Makefile ├── changelog.d │ ├── 2023.maintenance.md │ ├── 2024.dependencies.md │ ├── 2025.maintenance.md │ ├── 2026.documentation.md │ ├── 2027.dependencies.md │ ├── 2028.dependencies.md │ ├── 2029.maintenance.md │ └── changelog_template.jinja ├── make.bat ├── source │ ├── _static │ │ ├── assets │ │ │ ├── download │ │ │ │ ├── .gitignore │ │ │ │ └── README.txt │ │ │ ├── index_api.png │ │ │ ├── index_api.svg │ │ │ ├── index_contribute.png │ │ │ ├── index_contribute.svg │ │ │ ├── index_download.png │ │ │ ├── index_download.svg │ │ │ ├── index_examples.png │ │ │ ├── index_examples.svg │ │ │ ├── index_getting_started.png │ │ │ ├── index_getting_started.svg │ │ │ ├── index_user_guide.png │ │ │ └── index_user_guide.svg │ │ ├── custom.css │ │ ├── images │ │ │ ├── ahmed_body_schematic.jpg │ │ │ ├── boi_schematic.jpg │ │ │ ├── enclosure_schematic.jpg │ │ │ └── sketch_planes.jpg │ │ ├── logo │ │ │ ├── logo.png │ │ │ ├── logo.svg │ │ │ └── logo_1280_640.png │ │ └── thumbnails │ │ │ ├── 101_getting_started.png │ │ │ ├── add_design_material.png │ │ │ ├── advanced_sketching_gears.png │ │ │ ├── ahmed_body.png │ │ │ ├── basic_usage.png │ │ │ ├── block_with_parameters.png │ │ │ ├── boolean_operations.png │ │ │ ├── chamfer.png │ │ │ ├── cut_operation_on_extrude.png │ │ │ ├── design_organization.png │ │ │ ├── design_tree.png │ │ │ ├── dynamic_sketch_plane.png │ │ │ ├── export_design.png │ │ │ ├── naca_airfoils.png │ │ │ ├── naca_fluent.png │ │ │ ├── plate_with_hole.png │ │ │ ├── quarter_sphere.png │ │ │ ├── revolving.png │ │ │ ├── scale_map_mirror_bodies.png │ │ │ ├── service_colors.png │ │ │ ├── sweep_chain_profile.png │ │ │ └── tessellation_usage.png │ ├── _templates │ │ └── README.md │ ├── assets.rst │ ├── changelog.rst │ ├── cheatsheet │ │ ├── .gitignore │ │ └── cheat_sheet.qmd │ ├── conf.py │ ├── contributing.rst │ ├── examples.rst │ ├── examples │ │ ├── 01_getting_started │ │ │ ├── 01_math.mystnb │ │ │ ├── 02_units.mystnb │ │ │ ├── 03_sketching.mystnb │ │ │ ├── 04_modeling.mystnb │ │ │ └── 05_plotter_picker.mystnb │ │ ├── 02_sketching │ │ │ ├── advanced_sketching_gears.mystnb │ │ │ ├── basic_usage.mystnb │ │ │ └── dynamic_sketch_plane.mystnb │ │ ├── 03_modeling │ │ │ ├── .gitignore │ │ │ ├── add_design_material.mystnb │ │ │ ├── boolean_operations.mystnb │ │ │ ├── chamfer.mystnb │ │ │ ├── cut_operation_on_extrude.mystnb │ │ │ ├── design_organization.mystnb │ │ │ ├── design_parameters.mystnb │ │ │ ├── design_tree.mystnb │ │ │ ├── export_design.mystnb │ │ │ ├── plate_with_hole.mystnb │ │ │ ├── revolving.mystnb │ │ │ ├── scale_map_mirror_bodies.mystnb │ │ │ ├── service_colors.mystnb │ │ │ ├── surface_bodies.mystnb │ │ │ ├── sweep_chain_profile.mystnb │ │ │ └── tessellation_usage.mystnb │ │ ├── 04_applied │ │ │ ├── .gitignore │ │ │ ├── 01_naca_airfoils.mystnb │ │ │ ├── 02_naca_fluent.mystnb │ │ │ └── 03_ahmed_body_fluent.mystnb │ │ └── 99_misc │ │ │ └── template.mystnb │ ├── getting_started │ │ ├── compatibility.rst │ │ ├── docker │ │ │ ├── common_docker.jinja │ │ │ ├── index.rst │ │ │ └── windows_container.rst │ │ ├── existing │ │ │ └── index.rst │ │ ├── faq.rst │ │ ├── index.rst │ │ ├── installation.rst │ │ ├── local │ │ │ └── index.rst │ │ └── remote │ │ │ └── index.rst │ ├── index.rst │ └── user_guide │ │ ├── designer.rst │ │ ├── index.rst │ │ ├── primitives.rst │ │ └── shapes.rst └── styles │ ├── .gitignore │ └── config │ └── vocabularies │ └── ANSYS │ ├── accept.txt │ └── reject.txt ├── docker ├── README.rst ├── build_docker_windows.py ├── linux │ └── coreservice │ │ └── Dockerfile └── windows │ ├── coreservice │ └── Dockerfile │ └── dms │ └── Dockerfile ├── pyproject.toml ├── pytest-nographics.ini ├── src └── ansys │ └── geometry │ └── core │ ├── __init__.py │ ├── _grpc │ ├── _services │ │ ├── _service.py │ │ ├── base │ │ │ ├── admin.py │ │ │ ├── bodies.py │ │ │ ├── conversions.py │ │ │ ├── coordinate_systems.py │ │ │ ├── dbuapplication.py │ │ │ ├── designs.py │ │ │ ├── driving_dimensions.py │ │ │ ├── edges.py │ │ │ ├── faces.py │ │ │ ├── materials.py │ │ │ ├── measurement_tools.py │ │ │ ├── named_selection.py │ │ │ ├── parts.py │ │ │ ├── prepare_tools.py │ │ │ └── repair_tools.py │ │ ├── v0 │ │ │ ├── admin.py │ │ │ ├── bodies.py │ │ │ ├── conversions.py │ │ │ ├── coordinate_systems.py │ │ │ ├── dbuapplication.py │ │ │ ├── designs.py │ │ │ ├── driving_dimensions.py │ │ │ ├── edges.py │ │ │ ├── faces.py │ │ │ ├── materials.py │ │ │ ├── measurement_tools.py │ │ │ ├── named_selection.py │ │ │ ├── parts.py │ │ │ ├── prepare_tools.py │ │ │ └── repair_tools.py │ │ └── v1 │ │ │ ├── admin.py │ │ │ ├── bodies.py │ │ │ ├── coordinate_systems.py │ │ │ ├── dbuapplication.py │ │ │ ├── designs.py │ │ │ ├── driving_dimensions.py │ │ │ ├── edges.py │ │ │ ├── faces.py │ │ │ ├── materials.py │ │ │ ├── measurement_tools.py │ │ │ ├── named_selection.py │ │ │ ├── parts.py │ │ │ ├── prepare_tools.py │ │ │ └── repair_tools.py │ └── _version.py │ ├── connection │ ├── __init__.py │ ├── backend.py │ ├── client.py │ ├── conversions.py │ ├── defaults.py │ ├── docker_instance.py │ ├── launcher.py │ ├── pim_configuration.json │ ├── product_instance.py │ └── validate.py │ ├── designer │ ├── __init__.py │ ├── beam.py │ ├── body.py │ ├── component.py │ ├── coordinate_system.py │ ├── design.py │ ├── designpoint.py │ ├── edge.py │ ├── face.py │ ├── geometry_commands.py │ ├── part.py │ └── selection.py │ ├── errors.py │ ├── logger.py │ ├── materials │ ├── __init__.py │ ├── material.py │ └── property.py │ ├── math │ ├── __init__.py │ ├── bbox.py │ ├── constants.py │ ├── frame.py │ ├── matrix.py │ ├── misc.py │ ├── plane.py │ ├── point.py │ └── vector.py │ ├── misc │ ├── __init__.py │ ├── accuracy.py │ ├── auxiliary.py │ ├── checks.py │ ├── measurements.py │ ├── options.py │ └── units.py │ ├── modeler.py │ ├── parameters │ ├── __init__.py │ └── parameter.py │ ├── plotting │ ├── __init__.py │ ├── plotter.py │ └── widgets │ │ ├── __init__.py │ │ ├── _images │ │ ├── +xy.png │ │ ├── +xz.png │ │ ├── +yz.png │ │ ├── -xy.png │ │ ├── -xz.png │ │ ├── -yz.png │ │ ├── designpoint.png │ │ ├── downarrow.png │ │ ├── isometric.png │ │ ├── measurement.png │ │ ├── ruler.png │ │ ├── upxarrow.png │ │ ├── upyarrow.png │ │ └── upzarrow.png │ │ └── show_design_point.py │ ├── shapes │ ├── __init__.py │ ├── box_uv.py │ ├── curves │ │ ├── __init__.py │ │ ├── circle.py │ │ ├── curve.py │ │ ├── curve_evaluation.py │ │ ├── ellipse.py │ │ ├── line.py │ │ ├── nurbs.py │ │ └── trimmed_curve.py │ ├── parameterization.py │ └── surfaces │ │ ├── __init__.py │ │ ├── cone.py │ │ ├── cylinder.py │ │ ├── plane.py │ │ ├── sphere.py │ │ ├── surface.py │ │ ├── surface_evaluation.py │ │ ├── torus.py │ │ └── trimmed_surface.py │ ├── sketch │ ├── __init__.py │ ├── arc.py │ ├── box.py │ ├── circle.py │ ├── edge.py │ ├── ellipse.py │ ├── face.py │ ├── gears.py │ ├── polygon.py │ ├── segment.py │ ├── sketch.py │ ├── slot.py │ ├── trapezoid.py │ └── triangle.py │ ├── tools │ ├── __init__.py │ ├── check_geometry.py │ ├── measurement_tools.py │ ├── prepare_tools.py │ ├── problem_areas.py │ ├── repair_tool_message.py │ ├── repair_tools.py │ └── unsupported.py │ └── typing.py ├── tests ├── __init__.py ├── conftest.py ├── integration │ ├── README.md │ ├── __init__.py │ ├── conftest.py │ ├── files │ │ ├── BoxWithRound.scdocx │ │ ├── DuplicateFaces.scdocx │ │ ├── DuplicateFacesDesignBefore.scdocx │ │ ├── Edge_Slice_Test.dsco │ │ ├── ExtraEdges.scdocx │ │ ├── ExtraEdgesDesignBefore.scdocx │ │ ├── ExtraEdges_NoComponents.scdocx │ │ ├── Fan_OneBlade_CircularPatter.scdocx │ │ ├── FillPattern.scdocx │ │ ├── FillPatternUpdate.scdocx │ │ ├── InExactEdgesBefore.scdocx │ │ ├── InspectAndRepair01.scdocx │ │ ├── LinearPatterns.scdocx │ │ ├── LinearPatternsModify.scdocx │ │ ├── MissingFaces.scdocx │ │ ├── MissingFacesDesignBefore.scdocx │ │ ├── MixingTank.scdocx │ │ ├── NamedSelectionImport.scdocx │ │ ├── SOBracket2.scdocx │ │ ├── SOBracket2_HalfModel.scdocx │ │ ├── ShortEdges.scdocx │ │ ├── ShortEdgesBefore.scdocx │ │ ├── SimpleInterference.scdocx │ │ ├── SmallFaces.scdocx │ │ ├── SmallFacesBefore.scdocx │ │ ├── SplitEdgeDesignTest.scdocx │ │ ├── Stitch_And_MissingFaces.scdocx │ │ ├── blockswithparameters.dsco │ │ ├── bracket-with-split-edges.scdocx │ │ ├── disco_scripts │ │ │ ├── failing_script.py │ │ │ ├── integrated_script.py │ │ │ ├── simple_script.dscript │ │ │ ├── simple_script.py │ │ │ └── simple_script.scscript │ │ ├── gear.scdocx │ │ ├── hollowCylinder.scdocx │ │ ├── import │ │ │ ├── ACAD │ │ │ │ └── CylinderBox_2024.dwg │ │ │ ├── CAT5 │ │ │ │ └── Bracket_Hole_2024.CATPart │ │ │ ├── CAT6 │ │ │ │ └── Skateboard A.1_2023x.3dxml │ │ │ ├── Creo │ │ │ │ └── rearwheel_creo11.prt.2 │ │ │ ├── Inventor │ │ │ │ └── ai_param_dsdm_part1_2026.ipt │ │ │ ├── JT │ │ │ │ └── assly_sub-assly_asso.jt │ │ │ ├── NX │ │ │ │ └── base_plate_2412.prt │ │ │ ├── Parasolid │ │ │ │ └── blockhole_M.x_t │ │ │ ├── Rhino │ │ │ │ └── box.3dm │ │ │ ├── SOLIDWORKS │ │ │ │ └── Base_Plate.SLDPRT │ │ │ ├── SolidEdge │ │ │ │ └── L_Solid_2025.par │ │ │ ├── Tank_Bottom.par │ │ │ ├── box.3dm │ │ │ ├── catia_car │ │ │ │ ├── A.CATPart │ │ │ │ ├── B.CATProduct │ │ │ │ ├── Base.CATPart │ │ │ │ ├── Car1.CATProduct │ │ │ │ ├── Wheel1.CATPart │ │ │ │ └── car.CATProduct │ │ │ ├── disk1.prt │ │ │ ├── partColor.SLDPRT │ │ │ ├── sample_box.project │ │ │ ├── twoCars.igs │ │ │ ├── twoCars.stp │ │ │ └── twoCars.stride │ │ ├── partWithLogos.scdocx │ │ └── stitch_before.scdocx │ ├── image_cache │ │ └── .gitignore │ ├── logs │ │ └── .gitignore │ ├── test_client.py │ ├── test_design.py │ ├── test_design_export.py │ ├── test_design_import.py │ ├── test_edges.py │ ├── test_geometry_commands.py │ ├── test_issues.py │ ├── test_launcher_local.py │ ├── test_launcher_product.py │ ├── test_launcher_remote.py │ ├── test_logging_client.py │ ├── test_material.py │ ├── test_measurement_tools.py │ ├── test_plotter.py │ ├── test_prepare_tools.py │ ├── test_repair_tools.py │ ├── test_runscript.py │ ├── test_tessellation.py │ └── test_trimmed_geometry.py ├── test_connection.py ├── test_logging.py ├── test_math.py ├── test_metadata.py ├── test_misc_accuracy.py ├── test_misc_checks.py ├── test_misc_measurements.py ├── test_parameterization.py ├── test_primitives.py └── test_sketch.py └── tox.ini /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto !eol 2 | *.sh eol=lf 3 | *.bat eol=crlf 4 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # This is a comment. 2 | # Each line is a file pattern followed by one or more owners. 3 | 4 | # These owners will be the default owners for everything in 5 | # the repo. Unless a later match takes precedence, 6 | # they will be requested for review when someone opens a pull request. 7 | * @ansys/pyansys-geometry-maintainers 8 | 9 | # Documentation review required from Docs team (as well) on the following set of files: 10 | *.rst @PipKat @ansys/pyansys-geometry-maintainers 11 | *.mystnb @PipKat @ansys/pyansys-geometry-maintainers 12 | -------------------------------------------------------------------------------- /.github/codeql-config.yml: -------------------------------------------------------------------------------- 1 | # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs 2 | paths: 3 | - src 4 | - tests 5 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | enable-beta-ecosystems: true # TODO: to be removed once the beta is stable for cooldown 3 | updates: 4 | - package-ecosystem: "pip" 5 | directory: "/" 6 | schedule: 7 | interval: "daily" 8 | cooldown: 9 | default-days: 5 # Fallback cooldown if no specific rule applies 10 | semver-major-days: 30 # Cooldown for major version updates 11 | semver-minor-days: 7 # Cooldown for minor version updates 12 | semver-patch-days: 3 # Cooldown for patch updates 13 | exclude: 14 | - "ansys-api-geometry" 15 | labels: 16 | - "maintenance" 17 | - "dependencies" 18 | assignees: 19 | - "pyansys-ci-bot" 20 | commit-message: 21 | prefix: "build" 22 | groups: 23 | grpc-deps: 24 | patterns: 25 | - "grpc*" 26 | - "protobuf" 27 | docs-deps: 28 | patterns: 29 | - "ansys-sphinx-theme*" 30 | - "ipyvtklink" 31 | - "jupyter_sphinx" 32 | - "jupytext" 33 | - "myst-parser" 34 | - "nbconvert" 35 | - "nbsphinx" 36 | - "notebook" 37 | - "numpydoc" 38 | - "sphinx" 39 | - "sphinx*" 40 | 41 | - package-ecosystem: "github-actions" 42 | directory: "/" 43 | schedule: 44 | interval: "daily" 45 | # TODO: This should be activated once it's supported 46 | # cooldown: 47 | # default-days: 5 # Fallback cooldown if no specific rule applies 48 | # semver-major-days: 30 # Cooldown for major version updates 49 | # semver-minor-days: 7 # Cooldown for minor version updates 50 | # semver-patch-days: 3 # Cooldown for patch updates 51 | # exclude: 52 | # - "ansys/actions/*" 53 | labels: 54 | - "maintenance" 55 | assignees: 56 | - "pyansys-ci-bot" 57 | commit-message: 58 | prefix: "ci" 59 | groups: 60 | actions: 61 | patterns: 62 | - "*" 63 | -------------------------------------------------------------------------------- /.github/labeler.yml: -------------------------------------------------------------------------------- 1 | documentation: 2 | - changed-files: 3 | - any-glob-to-any-file: 'doc/source/**/*' 4 | - any-glob-to-any-file: 'README.rst' 5 | maintenance: 6 | - changed-files: 7 | - any-glob-to-any-file: '.github/**/*' 8 | - any-glob-to-any-file: 'pyproject.toml' 9 | testing: 10 | - changed-files: 11 | - any-glob-to-any-file: 'tests/*' 12 | -------------------------------------------------------------------------------- /.github/labels.yml: -------------------------------------------------------------------------------- 1 | - name: bug 2 | description: Something isn't working 3 | color: d42a34 4 | 5 | - name: dependencies 6 | description: Related with project dependencies 7 | color: ffc0cb 8 | 9 | - name: documentation 10 | description: Improvements or additions to documentation 11 | color: 0677ba 12 | 13 | - name: enhancement 14 | description: New features or code improvements 15 | color: FFD827 16 | 17 | - name: good first issue 18 | description: Easy to solve for newcomers 19 | color: 62ca50 20 | 21 | - name: maintenance 22 | description: Package and maintenance related 23 | color: f78c37 24 | 25 | - name: release 26 | description: Anything related to an incoming release 27 | color: ffffff 28 | 29 | - name: PRIORITY 30 | description: Issue/PR assigned with this tag must be given priority over the rest of the backlog 31 | color: 7A1FCC 32 | 33 | - name: SERVER-IMPLEMENTATION 34 | description: Issue/PR assigned with this tag must be solved server-side 35 | color: 086C8E 36 | 37 | - name: testing 38 | description: Anything related to tests 39 | color: BFE4D6 40 | 41 | - name: security 42 | description: Anything related to security advisories 43 | color: FF0000 44 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ## Description 2 | **Please provide a brief description of the changes made in this pull request.** 3 | 4 | ## Issue linked 5 | **Please mention the issue number or describe the problem this pull request addresses.** 6 | 7 | ## Checklist 8 | - [ ] I have tested my changes locally. 9 | - [ ] I have added necessary documentation or updated existing documentation. 10 | - [ ] I have followed the coding style guidelines of this project. 11 | - [ ] I have added appropriate unit tests. 12 | - [ ] I have reviewed my changes before submitting this pull request. 13 | - [ ] I have linked the issue or issues that are solved to the PR if any. 14 | - [ ] I have assigned this PR to myself. 15 | - [ ] I have added the minimum version decorator to any new backend method implemented. 16 | - [ ] I have made sure that the title of my PR follows [Conventional commits style](https://www.conventionalcommits.org/en/v1.0.0/#summary) (e.g. ``feat: extrude circle to cylinder``) 17 | -------------------------------------------------------------------------------- /.github/workflows/codeql.yml: -------------------------------------------------------------------------------- 1 | name: "CodeQL" 2 | 3 | on: 4 | push: 5 | branches: [ "main" ] 6 | pull_request: 7 | branches: [ "main" ] 8 | schedule: 9 | - cron: '45 22 * * 4' 10 | 11 | jobs: 12 | analyze: 13 | name: Analyze 14 | runs-on: 'ubuntu-latest' 15 | timeout-minutes: 360 16 | permissions: 17 | actions: read 18 | contents: read 19 | security-events: write 20 | steps: 21 | - name: Checkout repository 22 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 23 | 24 | - name: Initialize CodeQL 25 | uses: github/codeql-action/init@fca7ace96b7d713c7035871441bd52efbe39e27e # v3.28.19 26 | with: 27 | languages: 'python' 28 | config-file: ./.github/codeql-config.yml 29 | 30 | - name: Autobuild 31 | uses: github/codeql-action/autobuild@fca7ace96b7d713c7035871441bd52efbe39e27e # v3.28.19 32 | 33 | # If the Autobuild fails above, remove it and uncomment the following three lines. 34 | # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. 35 | 36 | # - run: | 37 | # echo "Run, Build Application using script" 38 | # ./location_of_script_within_repo/buildscript.sh 39 | 40 | - name: Perform CodeQL Analysis 41 | uses: github/codeql-action/analyze@fca7ace96b7d713c7035871441bd52efbe39e27e # v3.28.19 42 | with: 43 | category: "/language:python" 44 | -------------------------------------------------------------------------------- /.github/workflows/docker_ansyslab_linux.yml: -------------------------------------------------------------------------------- 1 | name: Upload Linux latest to Ansys Lab 2 | 3 | on: 4 | workflow_dispatch: 5 | workflow_call: 6 | 7 | concurrency: 8 | group: ${{ github.workflow }}-${{ github.ref }} 9 | cancel-in-progress: true 10 | 11 | permissions: 12 | packages: read 13 | 14 | env: 15 | LINUX_STABLE_GHCR: ghcr.io/ansys/geometry:core-linux-latest 16 | LINUX_STABLE_FUJI: azwepsifujiaksacr.azurecr.io/ansys/discovery/geometry:linux-latest 17 | 18 | jobs: 19 | linux-ansyslab: 20 | name: Publish Linux latest image on AnsysLab 21 | runs-on: 22 | group: ansys-network 23 | labels: [Linux, pygeometry] 24 | steps: 25 | - name: Login in Github Container registry 26 | uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 27 | with: 28 | registry: ghcr.io 29 | username: ${{ github.actor }} 30 | password: ${{ secrets.GITHUB_TOKEN }} 31 | 32 | - name: Pull Linux latest stable container 33 | run: docker pull ${{ env.LINUX_STABLE_GHCR }} 34 | 35 | - name: Login in AnsysLab registry 36 | uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 37 | with: 38 | registry: azwepsifujiaksacr.azurecr.io 39 | username: ${{ secrets.FUJI_USER }} 40 | password: ${{ secrets.FUJI_TOKEN }} 41 | 42 | - name: Tag container as latest (stable) for AnsysLab registry 43 | run: docker tag ${{ env.LINUX_STABLE_GHCR }} ${{ env.LINUX_STABLE_FUJI }} 44 | 45 | - name: Publish latest stable container in AnsysLab registry 46 | run: docker push ${{ env.LINUX_STABLE_FUJI }} 47 | 48 | - name: Remove images (free space) 49 | run: docker image rm ${{ env.LINUX_STABLE_FUJI }} ${{ env.LINUX_STABLE_GHCR }} 50 | -------------------------------------------------------------------------------- /.github/workflows/docker_ansyslab_windows.yml: -------------------------------------------------------------------------------- 1 | name: Upload Windows latest to Ansys Lab (DMS) 2 | 3 | on: 4 | workflow_dispatch: 5 | workflow_call: 6 | 7 | concurrency: 8 | group: ${{ github.workflow }}-${{ github.ref }} 9 | cancel-in-progress: true 10 | 11 | permissions: 12 | packages: read 13 | 14 | env: 15 | WINDOWS_STABLE_GHCR: ghcr.io/ansys/geometry:core-windows-latest 16 | WINDOWS_STABLE_FUJI: azwepsifujiaksacr.azurecr.io/ansys/discovery/geometry:core-windows-latest 17 | 18 | jobs: 19 | windows-ansyslab: 20 | name: Publish Windows latest image on AnsysLab 21 | runs-on: 22 | group: ansys-network 23 | labels: [Windows, pygeometry] 24 | steps: 25 | - name: Login in Github Container registry 26 | uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 27 | with: 28 | registry: ghcr.io 29 | username: ${{ github.actor }} 30 | password: ${{ secrets.GITHUB_TOKEN }} 31 | 32 | - name: Pull Windows latest unstable container 33 | run: docker pull ${{ env.WINDOWS_STABLE_GHCR }} 34 | 35 | - name: Login in AnsysLab registry 36 | uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 37 | with: 38 | registry: azwepsifujiaksacr.azurecr.io 39 | username: ${{ secrets.FUJI_USER }} 40 | password: ${{ secrets.FUJI_TOKEN }} 41 | 42 | - name: Tag container as latest (stable) for AnsysLab registry 43 | run: docker tag ${{ env.WINDOWS_STABLE_GHCR }} ${{ env.WINDOWS_STABLE_FUJI }} 44 | 45 | - name: Publish latest stable container in AnsysLab registry 46 | run: docker push ${{ env.WINDOWS_STABLE_FUJI }} 47 | -------------------------------------------------------------------------------- /.github/workflows/docker_cleanup.yml: -------------------------------------------------------------------------------- 1 | name: Docker images - Cleanup 2 | on: 3 | workflow_dispatch: 4 | schedule: # UTC at 0200 5 | - cron: "0 2 * * *" 6 | 7 | concurrency: 8 | group: ${{ github.workflow }}-${{ github.ref }} 9 | cancel-in-progress: true 10 | 11 | permissions: 12 | contents: write 13 | packages: write 14 | 15 | jobs: 16 | cleanup: 17 | name: Cleaning unnecessary packages 18 | runs-on: ubuntu-latest 19 | env: 20 | PACKAGE_DELETION_TOKEN: ${{ secrets.GITHUB_TOKEN }} 21 | 22 | steps: 23 | 24 | - name: "Perform versions cleanup - except certain tags" 25 | uses: ansys/actions/hk-package-clean-except@4e01d5cb4927325e0ab2e8b1f60fd5b0b2777bf7 # v10.0.8 26 | with: 27 | package-name: 'geometry' 28 | token: ${{ secrets.GITHUB_TOKEN }} 29 | tags-kept: 'windows-latest, windows-latest-unstable, core-windows-latest, core-windows-latest-unstable, core-linux-latest, core-linux-latest-unstable, 24.1, 24.2, 25.1, windows-24.1, windows-24.2, windows-25.1, windows-25.2, core-windows-25.2, core-linux-25.2, simba-plugin-geometry' 30 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | ci: 2 | autofix_commit_msg: 'chore: auto fixes from pre-commit hooks' 3 | autoupdate_commit_msg: 'chore: pre-commit automatic update' 4 | autoupdate_schedule: weekly 5 | 6 | exclude: "tests/integration/files" 7 | repos: 8 | 9 | - repo: https://github.com/astral-sh/ruff-pre-commit 10 | rev: v0.11.12 11 | hooks: 12 | - id: ruff-check 13 | - id: ruff-format 14 | 15 | - repo: https://github.com/codespell-project/codespell 16 | rev: v2.4.1 17 | hooks: 18 | - id: codespell 19 | args: ["--ignore-words", "doc/styles/config/vocabularies/ANSYS/accept.txt", "-w"] 20 | 21 | - repo: https://github.com/pre-commit/pre-commit-hooks 22 | rev: v5.0.0 23 | hooks: 24 | - id: check-merge-conflict 25 | - id: debug-statements 26 | - id: check-yaml 27 | - id: trailing-whitespace 28 | 29 | - repo: https://github.com/ansys/pre-commit-hooks 30 | rev: v0.5.2 31 | hooks: 32 | - id: add-license-headers 33 | args: 34 | - --start_year=2023 35 | 36 | # this validates our github workflow files 37 | - repo: https://github.com/python-jsonschema/check-jsonschema 38 | rev: 0.33.0 39 | hooks: 40 | - id: check-github-workflows 41 | 42 | # this validates our pre-commit.ci configuration 43 | - repo: https://github.com/pre-commit-ci/pre-commit-ci-config 44 | rev: v1.6.1 45 | hooks: 46 | - id: check-pre-commit-ci-config 47 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the list of PyAnsys Geometry's significant contributors. 2 | # 3 | # This file does not necessarily list everyone who has contributed code. 4 | # 5 | # For contributions made under a Corporate CLA, the organization is 6 | # added to this file. 7 | # 8 | # If you have contributed to the repository and want to be added to this file, 9 | # submit a request. 10 | # 11 | # 12 | ANSYS, Inc. 13 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # CHANGELOG 2 | 3 | This project uses [towncrier](https://towncrier.readthedocs.io/) to generate changelogs. 4 | 5 | Refer to the [raw release notes](doc/source/changelog.rst) for more information. 6 | 7 | [Published release notes](https://geometry.docs.pyansys.com/version/stable/changelog.html) can be found in the online documentation. 8 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our 7 | project and our community a harassment-free experience for everyone, 8 | regardless of age, body size, disability, ethnicity, sex 9 | characteristics, gender identity and expression, level of experience, 10 | education, socioeconomic status, nationality, personal appearance, 11 | race, religion, or sexual identity and orientation. 12 | 13 | ## Our Standards 14 | 15 | Examples of behavior that contributes to creating a positive environment 16 | include: 17 | 18 | * Using welcoming and inclusive language 19 | * Being respectful of differing viewpoints and experiences 20 | * Gracefully accepting constructive criticism 21 | * Focusing on what is best for the community 22 | * Showing empathy towards other community members 23 | 24 | Examples of unacceptable behavior by participants include: 25 | 26 | * The use of sexualized language or imagery and unwelcome sexual 27 | attention or advances 28 | * Trolling, insulting/derogatory comments, and personal or political attacks 29 | * Public or private harassment 30 | * Publishing others' private information, such as a physical or electronic 31 | address, without explicit permission 32 | * Other conduct which could reasonably be considered inappropriate in a 33 | professional setting 34 | 35 | ## Our Responsibilities 36 | 37 | Project maintainers are responsible for clarifying the standards of acceptable 38 | behavior and are expected to take appropriate and fair corrective action in 39 | response to any instances of unacceptable behavior. 40 | 41 | Project maintainers have the right and responsibility to remove, edit, or reject 42 | comments, commits, code, wiki edits, issues, and other contributions that are 43 | not aligned to this Code of Conduct, or to ban temporarily or permanently any 44 | contributor for other behaviors that they deem inappropriate, threatening, 45 | offensive, or harmful. 46 | 47 | ## Scope 48 | 49 | This Code of Conduct applies both within project spaces and in public spaces 50 | when an individual is representing the project or its community. Examples of 51 | representing a project or community include using an official project e-mail 52 | address, posting via an official social media account, or acting as an appointed 53 | representative at an online or offline event. Representation of a project may be 54 | further defined and clarified by project maintainers. 55 | 56 | ## Attribution 57 | 58 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 59 | version 1.4, available at 60 | https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 61 | 62 | [homepage]: https://www.contributor-covenant.org 63 | 64 | For answers to common questions about this code of conduct, see 65 | https://www.contributor-covenant.org/faq 66 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | We absolutely welcome any code contributions and we hope that this 4 | guide will facilitate an understanding of the PyAnsys Geometry code 5 | repository. It is important to note that while the PyAnsys Geometry software 6 | package is maintained by ANSYS and any submissions will be reviewed 7 | thoroughly before merging, we still seek to foster a community that can 8 | support user questions and develop new features to make this software 9 | a useful tool for all users. As such, we welcome and encourage any 10 | questions or submissions to this repository. 11 | 12 | For contributing to this project, please refer to the [PyAnsys Developer's Guide]. 13 | Further information about contributing to PyAnsys Geometry can be found in [Contributing]. 14 | 15 | [PyAnsys Developer's Guide]: https://dev.docs.pyansys.com/index.html 16 | [Contributing]: https://geometry.docs.pyansys.com/version/dev/contributing.html 17 | -------------------------------------------------------------------------------- /CONTRIBUTORS.md: -------------------------------------------------------------------------------- 1 | # Contributors 2 | 3 | ## Project Lead 4 | 5 | * [Roberto Pastor](https://github.com/RobPasMue) 6 | 7 | ## Individual Contributors 8 | 9 | * [Alan George Varghese](https://github.com/agvarghe) 10 | * [Alex Fernandez](https://github.com/AlejandroFernandezLuces) 11 | * [Alex Kaszynski](https://github.com/akaszynski) 12 | * [Bane Sullivan](https://github.com/banesullivan) 13 | * [Beau Dickens](https://github.com/ansbdickens) 14 | * [Camille](https://github.com/clatapie) 15 | * [Chad Queen](https://github.com/chadqueen) 16 | * [Chris Hawkins](https://github.com/chris-hawkins-usa) 17 | * [colton](https://github.com/syscordan) 18 | * [dastan-ansys](https://github.com/dastan-ansys) 19 | * [David Gorman](https://github.com/david-gorman) 20 | * [Dominik Gresch](https://github.com/greschd) 21 | * [German](https://github.com/germa89) 22 | * [Jacob Kerstetter](https://github.com/jacobrkerstetter) 23 | * [JasonWelling](https://github.com/JasonWelling) 24 | * [Jonah Boling](https://github.com/jonahrb) 25 | * [Jorge Martínez](https://github.com/jorgepiloto) 26 | * [Kathy Pippert](https://github.com/PipKat) 27 | * [Kerry McAdams](https://github.com/klmcadams) 28 | * [kmahajan-cadfem](https://github.com/kmahajan-cadfem) 29 | * [LanceX2214](https://github.com/LanceX2214) 30 | * [Matteo Bini](https://github.com/b-matteo) 31 | * [Maxime Rey](https://github.com/MaxJPRey) 32 | * [Maxjrey](https://github.com/Maxjrey) 33 | * [Michael Janes](https://github.com/mdjanes) 34 | * [Mike Kaplan ](https://github.com/mlkaplan36) 35 | * [MikeJanes](https://github.com/MikeJanes) 36 | * [Rajesh Meena](https://github.com/MeenaBytes) 37 | * [Revathy Venugopal](https://github.com/Revathyvenugopal162) 38 | * [Riccardo Manno](https://github.com/rmanno91) 39 | * [Ryan Ward](https://github.com/RyanJWard) 40 | * [smereu](https://github.com/smereu) 41 | * [Sébastien Morais](https://github.com/SMoraisAnsys) 42 | * [Umut Soysal](https://github.com/umutsoysalansys) 43 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 9 | of the Software, and to permit persons to whom the Software is furnished to do 10 | so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | 24 | 25 | # Security Policy 26 | 27 | ## Supported Versions 28 | 29 | | Version | Supported | 30 | | ------- | ------------------ | 31 | | <= 0.7 | :x: | 32 | | 0.8.x | :white_check_mark: | 33 | | 0.9.x | :white_check_mark: | 34 | | 0.10.x | :white_check_mark: | 35 | | dev | :white_check_mark: | 36 | 37 | ## Reporting a vulnerability 38 | 39 | > [!CAUTION] 40 | > Do not use GitHub issues to report any security vulnerabilities. 41 | 42 | If you detect a vulnerability, contact the [PyAnsys Core team](mailto:pyansys.core@ansys.com), 43 | mentioning the repository and the details of your finding. The team will address it as soon as possible. 44 | 45 | Provide the PyAnsys Core team with this information: 46 | 47 | - Any specific configuration settings needed to reproduce the problem 48 | - Step-by-step guidance to reproduce the problem 49 | - The exact location of the problematic source code, including tag, branch, commit, or a direct URL 50 | - The potential consequences of the vulnerability, along with a description of how an attacker could take advantage of the issue 51 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | range: 85..100 3 | round: down 4 | precision: 2 5 | status: 6 | project: 7 | default: 8 | target: 90% 9 | patch: off 10 | 11 | 12 | codecov: 13 | notify: 14 | wait_for_ci: yes -------------------------------------------------------------------------------- /doc/.vale.ini: -------------------------------------------------------------------------------- 1 | # Core settings 2 | # ============= 3 | 4 | # Location of our `styles` 5 | StylesPath = "styles" 6 | 7 | # The options are `suggestion`, `warning`, or `error` (defaults to “warning”). 8 | MinAlertLevel = warning 9 | 10 | # By default, `code` and `tt` are ignored. 11 | IgnoredScopes = code, tt 12 | 13 | # By default, `script`, `style`, `pre`, and `figure` are ignored. 14 | SkippedScopes = script, style, pre, figure 15 | 16 | # WordTemplate specifies what Vale will consider to be an individual word. 17 | WordTemplate = \b(?:%s)\b 18 | 19 | # List of Packages to be used for our guidelines 20 | Packages = Google 21 | 22 | # Define the Ansys vocabulary 23 | Vocab = ANSYS 24 | 25 | [*.{rst}] 26 | 27 | # Apply the following styles 28 | BasedOnStyles = Vale, Google 29 | Google.Headings = NO 30 | Vale.Terms = NO 31 | -------------------------------------------------------------------------------- /doc/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = -j 1 -W --color 6 | SPHINXBUILD = sphinx-build 7 | APIDIR = api 8 | SOURCEDIR = source 9 | BUILDDIR = _build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | 22 | # Customized clean due to examples gallery 23 | clean: 24 | rm -rf $(BUILDDIR)/* 25 | find . -type d -name $(APIDIR) -exec rm -rf {} + 26 | 27 | # Create PDF 28 | pdf: 29 | @$(SPHINXBUILD) -M latex "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 30 | cd $(BUILDDIR)/latex && latexmk -r latexmkrc -pdf *.tex -interaction=nonstopmode || true 31 | (test -f $(BUILDDIR)/latex/ansys-geometry-core.pdf && echo pdf exists) || exit 1 32 | 33 | # Build HTML files and generate examples as .py files 34 | html: 35 | @$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 36 | 37 | # Linkcheck 38 | linkcheck: 39 | @$(SPHINXBUILD) -M linkcheck "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 40 | 41 | # Single example target 42 | single-example: 43 | @if [ -z "$(example)" ]; then \ 44 | echo "No example specified."; \ 45 | echo "Usage --> make single-example example=examples/01_getting_started/01_math.mystnb"; \ 46 | exit 1; \ 47 | fi 48 | @echo "Building single example --> $(example)" 49 | @BUILD_API=False SKIP_BUILD_CHEAT_SHEET=True $(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" -j 1 $(O) -D "include_patterns=index.rst,examples.rst,$(example)" 50 | -------------------------------------------------------------------------------- /doc/changelog.d/2023.maintenance.md: -------------------------------------------------------------------------------- 1 | Update changelog for v0.10.9 -------------------------------------------------------------------------------- /doc/changelog.d/2024.dependencies.md: -------------------------------------------------------------------------------- 1 | Bump jupytext from 1.17.1 to 1.17.2 in the docs-deps group -------------------------------------------------------------------------------- /doc/changelog.d/2025.maintenance.md: -------------------------------------------------------------------------------- 1 | Bump ansys/actions from 10.0.4 to 10.0.6 in the actions group -------------------------------------------------------------------------------- /doc/changelog.d/2026.documentation.md: -------------------------------------------------------------------------------- 1 | Adding extra line -------------------------------------------------------------------------------- /doc/changelog.d/2027.dependencies.md: -------------------------------------------------------------------------------- 1 | Bump ansys-tools-visualization-interface from 0.9.1 to 0.9.2 -------------------------------------------------------------------------------- /doc/changelog.d/2028.dependencies.md: -------------------------------------------------------------------------------- 1 | Bump trame-vtk from 2.8.15 to 2.8.17 -------------------------------------------------------------------------------- /doc/changelog.d/2029.maintenance.md: -------------------------------------------------------------------------------- 1 | Bump ansys/actions from 10.0.6 to 10.0.8 in the actions group -------------------------------------------------------------------------------- /doc/changelog.d/changelog_template.jinja: -------------------------------------------------------------------------------- 1 | {% if sections[""] %} 2 | 3 | .. tab-set:: 4 | 5 | {%+ for category, val in definitions.items() if category in sections[""] %} 6 | 7 | .. tab-item:: {{ definitions[category]['name'] }} 8 | 9 | .. list-table:: 10 | :header-rows: 0 11 | :widths: auto 12 | 13 | {% for text, values in sections[""][category].items() %} 14 | * - {{ text }} 15 | - {{ values|join(', ') }} 16 | 17 | {% endfor %} 18 | {% endfor %} 19 | 20 | {% else %} 21 | No significant changes. 22 | {% endif %} 23 | -------------------------------------------------------------------------------- /doc/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | if "%SPHINXOPTS%" == "" ( 11 | set SPHINXOPTS=-j auto -W --color 12 | ) 13 | set SOURCEDIR=source 14 | set APIDIR=source\api 15 | set BUILDDIR=_build 16 | 17 | if "%1" == "" goto help 18 | if "%1" == "help" goto help 19 | if "%1" == "clean" goto clean 20 | if "%1" == "pdf" goto pdf 21 | if "%1" == "html" goto html 22 | if "%1" == "linkcheck" goto linkcheck 23 | if "%1" == "single-example" goto single-example 24 | 25 | %SPHINXBUILD% >NUL 2>NUL 26 | if errorlevel 9009 ( 27 | echo. 28 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 29 | echo.installed, then set the SPHINXBUILD environment variable to point 30 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 31 | echo.may add the Sphinx directory to PATH. 32 | echo. 33 | echo.If you don't have Sphinx installed, grab it from 34 | echo.http://sphinx-doc.org/ 35 | exit /b 1 36 | ) 37 | 38 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 39 | goto end 40 | 41 | :linkcheck 42 | %SPHINXBUILD% -M linkcheck %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 43 | goto end 44 | 45 | :html 46 | %SPHINXBUILD% -M html %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 47 | goto end 48 | 49 | :pdf 50 | %SPHINXBUILD% -M latex %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 51 | cd "%BUILDDIR%\latex" 52 | for %%f in (*.tex) do ( 53 | pdflatex "%%f" --interaction=nonstopmode) 54 | if NOT EXIST ansys-geometry-core.pdf ( 55 | Echo "no pdf generated!" 56 | exit /b 1) 57 | Echo "pdf generated!" 58 | goto end 59 | 60 | :clean 61 | rmdir /s /q %BUILDDIR% > /NUL 2>&1 62 | rmdir /s /q %APIDIR% > /NUL 2>&1 63 | goto end 64 | 65 | :single-example 66 | if "%2" == "" ( 67 | echo. No example specified. 68 | echo. Example: ./make.bat single-example examples/01_getting_started/01_math.mystnb 69 | exit /b 1 70 | ) 71 | echo Building single example: %2 72 | set BUILD_API=false 73 | set SKIP_BUILD_CHEAT_SHEET=true 74 | set SPHINXOPTS=-j auto 75 | %SPHINXBUILD% -M html %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% -D "include_patterns=index.rst,examples.rst,%2" 76 | goto end 77 | 78 | :help 79 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 80 | goto end 81 | 82 | :end 83 | popd 84 | -------------------------------------------------------------------------------- /doc/source/_static/assets/download/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | !README.txt -------------------------------------------------------------------------------- /doc/source/_static/assets/download/README.txt: -------------------------------------------------------------------------------- 1 | Downloadable assets will be stored here -------------------------------------------------------------------------------- /doc/source/_static/assets/index_api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/doc/source/_static/assets/index_api.png -------------------------------------------------------------------------------- /doc/source/_static/assets/index_api.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 10 | 12 | 14 | 16 | 19 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /doc/source/_static/assets/index_contribute.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/doc/source/_static/assets/index_contribute.png -------------------------------------------------------------------------------- /doc/source/_static/assets/index_contribute.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 10 | 15 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /doc/source/_static/assets/index_download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/doc/source/_static/assets/index_download.png -------------------------------------------------------------------------------- /doc/source/_static/assets/index_download.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /doc/source/_static/assets/index_examples.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/doc/source/_static/assets/index_examples.png -------------------------------------------------------------------------------- /doc/source/_static/assets/index_examples.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 10 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /doc/source/_static/assets/index_getting_started.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/doc/source/_static/assets/index_getting_started.png -------------------------------------------------------------------------------- /doc/source/_static/assets/index_getting_started.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 10 | 13 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/source/_static/assets/index_user_guide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/doc/source/_static/assets/index_user_guide.png -------------------------------------------------------------------------------- /doc/source/_static/assets/index_user_guide.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 10 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /doc/source/_static/custom.css: -------------------------------------------------------------------------------- 1 | @import "../ansys-sphinx-theme.css"; 2 | 3 | /* Do not show number cells in notebooks */ 4 | .nbinput .prompt, 5 | .nboutput .prompt { 6 | display: none !important; 7 | } 8 | 9 | /* Ensure proper font size for notebook cells */ 10 | .nboutput { 11 | font-size: 1.1em; 12 | } 13 | 14 | .nbinput { 15 | font-size: 1em; 16 | } 17 | 18 | /* Expand cell content output to the width of the notebook */ 19 | div.nbinput.container div.input_area, div.nboutput.container div.output_area { 20 | display: block; 21 | } 22 | 23 | /* Center images in notebook output cells */ 24 | .nboutput img { 25 | display: block !important; 26 | margin: 0 auto !important; 27 | } 28 | 29 | .sd-card .sd-card-img-top { 30 | height: 100px; 31 | width: 100px; 32 | margin-left: auto; 33 | margin-right: auto; 34 | } 35 | 36 | .sd-card .sd-card-header { 37 | font-size: var(--pst-font-size-h5); 38 | font-weight: bold; 39 | padding: 1rem 0rem 0.5rem 0rem; 40 | } 41 | 42 | .sd-card .sd-card-footer .sd-card-text { 43 | max-width: 220px; 44 | } 45 | -------------------------------------------------------------------------------- /doc/source/_static/images/ahmed_body_schematic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/doc/source/_static/images/ahmed_body_schematic.jpg -------------------------------------------------------------------------------- /doc/source/_static/images/boi_schematic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/doc/source/_static/images/boi_schematic.jpg -------------------------------------------------------------------------------- /doc/source/_static/images/enclosure_schematic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/doc/source/_static/images/enclosure_schematic.jpg -------------------------------------------------------------------------------- /doc/source/_static/images/sketch_planes.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/doc/source/_static/images/sketch_planes.jpg -------------------------------------------------------------------------------- /doc/source/_static/logo/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/doc/source/_static/logo/logo.png -------------------------------------------------------------------------------- /doc/source/_static/logo/logo_1280_640.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/doc/source/_static/logo/logo_1280_640.png -------------------------------------------------------------------------------- /doc/source/_static/thumbnails/101_getting_started.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/doc/source/_static/thumbnails/101_getting_started.png -------------------------------------------------------------------------------- /doc/source/_static/thumbnails/add_design_material.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/doc/source/_static/thumbnails/add_design_material.png -------------------------------------------------------------------------------- /doc/source/_static/thumbnails/advanced_sketching_gears.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/doc/source/_static/thumbnails/advanced_sketching_gears.png -------------------------------------------------------------------------------- /doc/source/_static/thumbnails/ahmed_body.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/doc/source/_static/thumbnails/ahmed_body.png -------------------------------------------------------------------------------- /doc/source/_static/thumbnails/basic_usage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/doc/source/_static/thumbnails/basic_usage.png -------------------------------------------------------------------------------- /doc/source/_static/thumbnails/block_with_parameters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/doc/source/_static/thumbnails/block_with_parameters.png -------------------------------------------------------------------------------- /doc/source/_static/thumbnails/boolean_operations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/doc/source/_static/thumbnails/boolean_operations.png -------------------------------------------------------------------------------- /doc/source/_static/thumbnails/chamfer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/doc/source/_static/thumbnails/chamfer.png -------------------------------------------------------------------------------- /doc/source/_static/thumbnails/cut_operation_on_extrude.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/doc/source/_static/thumbnails/cut_operation_on_extrude.png -------------------------------------------------------------------------------- /doc/source/_static/thumbnails/design_organization.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/doc/source/_static/thumbnails/design_organization.png -------------------------------------------------------------------------------- /doc/source/_static/thumbnails/design_tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/doc/source/_static/thumbnails/design_tree.png -------------------------------------------------------------------------------- /doc/source/_static/thumbnails/dynamic_sketch_plane.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/doc/source/_static/thumbnails/dynamic_sketch_plane.png -------------------------------------------------------------------------------- /doc/source/_static/thumbnails/export_design.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/doc/source/_static/thumbnails/export_design.png -------------------------------------------------------------------------------- /doc/source/_static/thumbnails/naca_airfoils.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/doc/source/_static/thumbnails/naca_airfoils.png -------------------------------------------------------------------------------- /doc/source/_static/thumbnails/naca_fluent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/doc/source/_static/thumbnails/naca_fluent.png -------------------------------------------------------------------------------- /doc/source/_static/thumbnails/plate_with_hole.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/doc/source/_static/thumbnails/plate_with_hole.png -------------------------------------------------------------------------------- /doc/source/_static/thumbnails/quarter_sphere.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/doc/source/_static/thumbnails/quarter_sphere.png -------------------------------------------------------------------------------- /doc/source/_static/thumbnails/revolving.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/doc/source/_static/thumbnails/revolving.png -------------------------------------------------------------------------------- /doc/source/_static/thumbnails/scale_map_mirror_bodies.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/doc/source/_static/thumbnails/scale_map_mirror_bodies.png -------------------------------------------------------------------------------- /doc/source/_static/thumbnails/service_colors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/doc/source/_static/thumbnails/service_colors.png -------------------------------------------------------------------------------- /doc/source/_static/thumbnails/sweep_chain_profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/doc/source/_static/thumbnails/sweep_chain_profile.png -------------------------------------------------------------------------------- /doc/source/_static/thumbnails/tessellation_usage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/doc/source/_static/thumbnails/tessellation_usage.png -------------------------------------------------------------------------------- /doc/source/_templates/README.md: -------------------------------------------------------------------------------- 1 | ## Contains templates for the documentation build 2 | -------------------------------------------------------------------------------- /doc/source/cheatsheet/.gitignore: -------------------------------------------------------------------------------- 1 | /.quarto/ 2 | MyDesign.* 3 | _extensions 4 | -------------------------------------------------------------------------------- /doc/source/examples.rst: -------------------------------------------------------------------------------- 1 | Examples 2 | ######## 3 | 4 | These examples demonstrate the behavior and usage of PyAnsys Geometry. 5 | 6 | PyAnsys Geometry 101 examples 7 | ----------------------------- 8 | These examples demonstrate basic operations you can perform 9 | with PyAnsys Geometry. 10 | 11 | .. nbgallery:: 12 | :caption: 101 examples 13 | 14 | examples/01_getting_started/01_math.mystnb 15 | examples/01_getting_started/02_units.mystnb 16 | examples/01_getting_started/03_sketching.mystnb 17 | examples/01_getting_started/04_modeling.mystnb 18 | examples/01_getting_started/05_plotter_picker.mystnb 19 | 20 | Sketching examples 21 | ------------------ 22 | These examples demonstrate math operations on geometric objects 23 | and sketching capabilities, combined with server-based operations. 24 | 25 | .. nbgallery:: 26 | :caption: Sketching examples 27 | 28 | examples/02_sketching/basic_usage.mystnb 29 | examples/02_sketching/dynamic_sketch_plane.mystnb 30 | examples/02_sketching/advanced_sketching_gears.mystnb 31 | 32 | Modeling examples 33 | ----------------- 34 | These examples demonstrate service-based modeling operations. 35 | 36 | .. nbgallery:: 37 | :caption: Modeling examples 38 | 39 | examples/03_modeling/add_design_material.mystnb 40 | examples/03_modeling/plate_with_hole.mystnb 41 | examples/03_modeling/cut_operation_on_extrude.mystnb 42 | examples/03_modeling/tessellation_usage.mystnb 43 | examples/03_modeling/design_organization.mystnb 44 | examples/03_modeling/boolean_operations.mystnb 45 | examples/03_modeling/scale_map_mirror_bodies.mystnb 46 | examples/03_modeling/sweep_chain_profile.mystnb 47 | examples/03_modeling/revolving.mystnb 48 | examples/03_modeling/export_design.mystnb 49 | examples/03_modeling/design_tree.mystnb 50 | examples/03_modeling/service_colors.mystnb 51 | examples/03_modeling/surface_bodies.mystnb 52 | examples/03_modeling/design_parameters.mystnb 53 | examples/03_modeling/chamfer.mystnb 54 | 55 | Applied examples 56 | ---------------- 57 | 58 | These examples demonstrate the usage of PyAnsys Geometry for real-world 59 | applications. 60 | 61 | .. nbgallery:: 62 | :caption: Applied examples 63 | 64 | examples/04_applied/01_naca_airfoils.mystnb 65 | examples/04_applied/02_naca_fluent.mystnb 66 | examples/04_applied/03_ahmed_body_fluent.mystnb 67 | 68 | Miscellaneous examples 69 | ---------------------- 70 | 71 | .. nbgallery:: 72 | :caption: Miscellaneous examples 73 | 74 | examples/99_misc/template.mystnb 75 | -------------------------------------------------------------------------------- /doc/source/examples/03_modeling/.gitignore: -------------------------------------------------------------------------------- 1 | *.scdocx 2 | *.dsco -------------------------------------------------------------------------------- /doc/source/examples/03_modeling/chamfer.mystnb: -------------------------------------------------------------------------------- 1 | --- 2 | jupytext: 3 | text_representation: 4 | extension: .mystnb 5 | format_name: myst 6 | format_version: 0.13 7 | jupytext_version: 1.16.4 8 | kernelspec: 9 | display_name: Python 3 (ipykernel) 10 | language: python 11 | name: python3 12 | --- 13 | 14 | # Modeling: Chamfer edges and faces 15 | A chamfer is an angled cut on an edge. Chamfers can be created using the ``Modeler.geometry_commands`` module. 16 | 17 | +++ 18 | 19 | ## Create a block 20 | Launch the modeler and create a block. 21 | 22 | ```{code-cell} ipython3 23 | from ansys.geometry.core import launch_modeler, Modeler 24 | 25 | modeler = launch_modeler() 26 | print(modeler) 27 | ``` 28 | 29 | ```{code-cell} ipython3 30 | from ansys.geometry.core.sketch import Sketch 31 | from ansys.geometry.core.math import Point2D 32 | 33 | design = modeler.create_design("chamfer_block") 34 | body = design.extrude_sketch("block", Sketch().box(Point2D([0, 0]), 1, 1), 1) 35 | 36 | body.plot() 37 | ``` 38 | 39 | ## Chamfer edges 40 | Create a uniform chamfer on all edges of the block. 41 | 42 | ```{code-cell} ipython3 43 | modeler.geometry_commands.chamfer(body.edges, distance=0.1) 44 | 45 | body.plot() 46 | ``` 47 | 48 | ## Chamfer faces 49 | The chamfer of a face can also be modified. Create a chamfer on a single edge and then modify the chamfer distance value by providing the newly created face that represents the chamfer. 50 | 51 | ```{code-cell} ipython3 52 | body = design.extrude_sketch("box", Sketch().box(Point2D([0,0]), 1, 1), 1) 53 | 54 | modeler.geometry_commands.chamfer(body.edges[0], distance=0.1) 55 | 56 | body.plot() 57 | ``` 58 | 59 | ```{code-cell} ipython3 60 | modeler.geometry_commands.chamfer(body.faces[-1], distance=0.3) 61 | 62 | body.plot() 63 | ``` 64 | 65 | ## Close session 66 | 67 | When you finish interacting with your modeling service, you should close the active 68 | server session. This frees resources wherever the service is running. 69 | 70 | Close the server session. 71 | 72 | ```{code-cell} ipython3 73 | modeler.close() 74 | ``` 75 | -------------------------------------------------------------------------------- /doc/source/examples/03_modeling/surface_bodies.mystnb: -------------------------------------------------------------------------------- 1 | --- 2 | jupytext: 3 | text_representation: 4 | extension: .mystnb 5 | format_name: myst 6 | format_version: 0.13 7 | jupytext_version: 1.16.4 8 | kernelspec: 9 | display_name: Python 3 (ipykernel) 10 | language: python 11 | name: python3 12 | --- 13 | 14 | # Modeling: Surface bodies and trimmed surfaces 15 | 16 | This example shows how to trim different surfaces, and how to use those surfaces 17 | to create surface bodies. 18 | 19 | ## Create a surface 20 | 21 | Create a sphere surface. This can be done without launching the modeler. 22 | 23 | ```{code-cell} ipython3 24 | from ansys.geometry.core.shapes.surfaces import Sphere 25 | from ansys.geometry.core.math import Point3D 26 | 27 | surface = Sphere(origin=Point3D([0, 0, 0]), radius=1) 28 | ``` 29 | 30 | Now get information on how the surface is defined and parameterized. 31 | 32 | ```{code-cell} ipython3 33 | surface.parameterization() 34 | ``` 35 | 36 | ## Trim the surface 37 | 38 | For a sphere, its parametization is (`u: [0, 2*pi]`, `v:[-pi/2, pi/2]`), 39 | where u corresponds to longitude and v corresponds to latitude. You 40 | can **trim** a surface by providing new parameters. 41 | 42 | ```{code-cell} ipython3 43 | from ansys.geometry.core.shapes.box_uv import BoxUV 44 | from ansys.geometry.core.shapes.parameterization import Interval 45 | import math 46 | 47 | trimmed_surface = surface.trim(BoxUV(range_u=Interval(0, math.pi), range_v=Interval(0, math.pi/2))) 48 | ``` 49 | 50 | From a ``TrimmedSurface``, you can always refer back to the underlying ``Surface`` if needed. 51 | 52 | ```{code-cell} ipython3 53 | trimmed_surface.geometry 54 | ``` 55 | 56 | ## Create a surface body 57 | 58 | Now create a surface body by launching the modeler session and providing the trimmed surface. 59 | Then plot the body to see how you created a quarter of a sphere as a surface body. 60 | 61 | ```{code-cell} ipython3 62 | from ansys.geometry.core import launch_modeler 63 | 64 | modeler = launch_modeler() 65 | print(modeler) 66 | ``` 67 | 68 | ```{code-cell} ipython3 69 | design = modeler.create_design("SurfaceBodyExample") 70 | body = design.create_body_from_surface("trimmed_sphere", trimmed_surface) 71 | design.plot() 72 | ``` 73 | 74 | If the sphere was left untrimmed, it would create a solid body since the surface is fully 75 | closed. In this case, since the surface was open, it created a surface body. 76 | 77 | This same process can be used with other surfaces including: 78 | - ``Cone`` 79 | - ``Cylinder`` 80 | - ``Plane`` 81 | - ``Torus`` 82 | 83 | Each surface has its own unique parameterization, which must be understood before trying to trim it. 84 | 85 | +++ 86 | 87 | ## Close session 88 | 89 | When you finish interacting with your modeling service, you should close the active server 90 | session. This frees resources wherever the service is running. 91 | 92 | Close the server session. 93 | 94 | ```{code-cell} ipython3 95 | modeler.close() 96 | ``` 97 | -------------------------------------------------------------------------------- /doc/source/examples/04_applied/.gitignore: -------------------------------------------------------------------------------- 1 | *.fmd 2 | *.scdocx 3 | *.pmdb 4 | -------------------------------------------------------------------------------- /doc/source/examples/99_misc/template.mystnb: -------------------------------------------------------------------------------- 1 | --- 2 | jupytext: 3 | text_representation: 4 | extension: .mystnb 5 | format_name: myst 6 | format_version: 0.13 7 | jupytext_version: 1.14.1 8 | kernelspec: 9 | display_name: Python 3 (ipykernel) 10 | language: python 11 | name: python3 12 | --- 13 | 14 | # Miscellaneous: Example template 15 | 16 | This example serves as a template for creating new examples in the documentation. 17 | It shows developers how to structure their code and comments for clarity and consistency. 18 | It also provides a basic outline for importing necessary modules, initializing the modeler, 19 | performing operations, and closing the modeler. 20 | 21 | It is important to follow the conventions and formatting used in this example to ensure that 22 | the documentation is easy to read and understandable. 23 | 24 | ## Example imports 25 | 26 | Perform the required imports for this example. 27 | This section should include all necessary imports for the example to run correctly. 28 | 29 | ```{code-cell} ipython3 30 | # Imports 31 | from ansys.geometry.core import launch_modeler 32 | from ansys.geometry.core.math import Point2D 33 | from ansys.geometry.core.sketch import Sketch 34 | ``` 35 | 36 | ## Initialize the modeler 37 | 38 | ```{code-cell} ipython3 39 | # Initialize the modeler for this example notebook 40 | m = launch_modeler() 41 | print(m) 42 | ``` 43 | 44 | ## Body of your example 45 | 46 | Developers can add their code here to perform the desired operations. 47 | This section should include comments and explanations to explain what the code is doing. 48 | 49 | ### Example section: Initialize a design 50 | 51 | Create a design named ``example-design``. 52 | 53 | ```{code-cell} ipython3 54 | # Initialize the example design 55 | design = m.create_design("example-design") 56 | ``` 57 | 58 | ### Example section: Include images 59 | 60 | This section demonstrates how to include static images in the documentation. 61 | You should place these images in the ``doc/source/_static/`` directory. 62 | 63 | You can then reference images in the documentation using the following syntax: 64 | 65 | ![image](../../_static/thumbnails/101_getting_started.png){align=center} 66 | 67 | 68 | ### Example section: Create a sketch and plot it 69 | 70 | This section demonstrates how to create a sketch and plot it. 71 | 72 | ```{code-cell} ipython3 73 | sketch = Sketch() 74 | sketch.box(Point2D([0, 0]), 10, 10) 75 | sketch.plot() 76 | ``` 77 | 78 | ### Example section: Extrude the sketch and create a body 79 | This section demonstrates how to extrude the sketch and create a body. 80 | 81 | ```{code-cell} ipython3 82 | design.extrude_sketch(f"BoxBody", sketch, distance=10) 83 | design.plot() 84 | ``` 85 | 86 | ## Close the modeler 87 | 88 | ```{code-cell} ipython3 89 | # Close the modeler 90 | m.close() 91 | ``` 92 | -------------------------------------------------------------------------------- /doc/source/getting_started/compatibility.rst: -------------------------------------------------------------------------------- 1 | 2 | .. _ref_ansys_comp: 3 | 4 | Ansys version compatibility 5 | =========================== 6 | 7 | The following table summarizes the compatibility matrix between the PyAnsys Geometry service 8 | and the Ansys product versions. 9 | 10 | +---------------------------+------------------------+-------------------------------+-------------------------------+------------------------------+------------------------------+ 11 | | PyAnsys Geometry versions | Ansys Product versions | Geometry Service (dockerized) | Geometry Service (standalone) | Discovery | SpaceClaim | 12 | +===========================+========================+===============================+===============================+==============================+==============================+ 13 | | ``0.2.X`` | 23R2 | :octicon:`check-circle-fill` | :octicon:`check-circle-fill` | :octicon:`x-circle` | :octicon:`check-circle-fill` | 14 | +---------------------------+------------------------+-------------------------------+-------------------------------+------------------------------+------------------------------+ 15 | | ``0.3.X`` | 23R2 (partially) | :octicon:`check-circle-fill` | :octicon:`check-circle-fill` | :octicon:`x-circle` | :octicon:`check-circle-fill` | 16 | +---------------------------+------------------------+-------------------------------+-------------------------------+------------------------------+------------------------------+ 17 | | ``0.4.X`` | 24R1 onward | :octicon:`check-circle-fill` | :octicon:`check-circle-fill` | :octicon:`check-circle-fill` | :octicon:`check-circle-fill` | 18 | +---------------------------+------------------------+-------------------------------+-------------------------------+------------------------------+------------------------------+ 19 | | ``0.5.X`` | 24R1 onward | :octicon:`check-circle-fill` | :octicon:`check-circle-fill` | :octicon:`check-circle-fill` | :octicon:`check-circle-fill` | 20 | +---------------------------+------------------------+-------------------------------+-------------------------------+------------------------------+------------------------------+ 21 | 22 | .. tip:: Forth- and back-compatibility mechanism 23 | 24 | Starting on version ``0.5.X`` and onward, PyAnsys Geometry has implemented a forth- and back-compatibility mechanism to 25 | ensure that the Python library can be used with different versions of the Ansys products. 26 | 27 | Methods are now decorated with the ``@min_backend_version`` decorator to indicate the compatibility with the Ansys product versions. 28 | If an unsupported method is called, a ``GeometryRuntimeError`` is raised when attempting to use the method. Users are informed of the 29 | minimum Ansys product version required to use the method. 30 | 31 | 32 | Access to the documentation for the preceding versions is found at the `Versions `_ page. 33 | 34 | .. button-ref:: index 35 | :ref-type: doc 36 | :color: primary 37 | :shadow: 38 | :expand: 39 | 40 | Go to Getting started 41 | -------------------------------------------------------------------------------- /doc/source/getting_started/docker/index.rst: -------------------------------------------------------------------------------- 1 | .. _ref_docker: 2 | 3 | Docker containers 4 | ================= 5 | 6 | What is Docker? 7 | --------------- 8 | 9 | Docker is an open platform for developing, shipping, and running apps in a 10 | containerized way. 11 | 12 | Containers are standard units of software that package the code and all its dependencies 13 | so that the app runs quickly and reliably from one computing environment to another. 14 | 15 | Ensure that the machine where the Geometry service is to run has Docker installed. Otherwise, 16 | see `Install Docker Engine `_ in the Docker documentation. 17 | 18 | Select your Docker container 19 | ---------------------------- 20 | 21 | Currently, the Geometry service backend is mainly delivered as a **Windows** Docker container. 22 | However, these containers require a Windows machine to run them. 23 | 24 | .. A Linux version of the Geometry service is also available but with limited capabilities, 25 | .. meaning that certain operations are not available or fail. 26 | 27 | Select the kind of Docker container you want to build: 28 | 29 | .. grid:: 2 30 | :gutter: 3 3 4 4 31 | 32 | .. grid-item-card:: Windows Docker container 33 | :link: windows_container 34 | :link-type: doc 35 | 36 | Build a Windows Docker container for the Geometry service 37 | and use it from PyAnsys Geometry. Explore the full potential 38 | of the Geometry service. 39 | 40 | .. .. grid-item-card:: Linux Docker container 41 | .. :link: linux_container 42 | .. :link-type: doc 43 | 44 | .. Test out the Linux Docker container for the Geometry service, 45 | .. which has limited functionalities. 46 | 47 | .. button-ref:: ../index 48 | :ref-type: doc 49 | :color: primary 50 | :shadow: 51 | :expand: 52 | 53 | Go to Getting started 54 | 55 | .. toctree:: 56 | :hidden: 57 | :maxdepth: 2 58 | 59 | windows_container 60 | .. linux_container -------------------------------------------------------------------------------- /doc/source/getting_started/existing/index.rst: -------------------------------------------------------------------------------- 1 | .. _ref_existing_session: 2 | 3 | Use an existing session 4 | ======================= 5 | 6 | If a session of Discovery, SpaceClaim, or the Geometry service is already 7 | running, PyAnsys Geometry can be used to connect to it. 8 | 9 | .. warning:: 10 | 11 | Running a SpaceClaim or Discovery normal session does not suffice to be 12 | able to use it with PyAnsys Geometry. Both products need the ApiServer extension to be 13 | running. In this case, to ease the process, you should launch the products directly from the PyAnsys 14 | Geometry library as shown in :ref:`ref_creating_local_session`. 15 | 16 | Establish the connection 17 | ------------------------ 18 | 19 | From Python, establish a connection to the existing client session by creating a ``Modeler`` object: 20 | 21 | .. code:: python 22 | 23 | from ansys.geometry.core import Modeler 24 | 25 | modeler = Modeler(host="localhost", port=50051) 26 | 27 | If no error messages are received, your connection is established successfully. 28 | Note that your local port number might differ from the one shown in the preceding code. 29 | 30 | Verify the connection 31 | --------------------- 32 | If you want to verify that the connection is successful, request the status of the client 33 | connection inside your ``Modeler`` object: 34 | 35 | .. code:: pycon 36 | 37 | >>> modeler.client 38 | Ansys Geometry Modeler Client (...) 39 | Target: localhost:50051 40 | Connection: Healthy 41 | 42 | .. button-ref:: ../index 43 | :ref-type: doc 44 | :color: primary 45 | :shadow: 46 | :expand: 47 | 48 | Go to Getting started -------------------------------------------------------------------------------- /doc/source/getting_started/index.rst: -------------------------------------------------------------------------------- 1 | .. _ref_getting_started: 2 | 3 | Getting started 4 | ############### 5 | 6 | PyAnsys Geometry is a Python client library for the Ansys Geometry service. 7 | 8 | Installation 9 | ============ 10 | You can use `pip `_ to install PyAnsys Geometry. 11 | 12 | .. code:: bash 13 | 14 | pip install ansys-geometry-core 15 | 16 | Available modes 17 | =============== 18 | 19 | This client library works with a Geometry service backend. There are several ways of 20 | running this backend, although the preferred and high-performance mode is using Docker 21 | containers. Select the option that suits your needs best. 22 | 23 | .. grid:: 2 24 | :gutter: 3 3 4 4 25 | 26 | .. grid-item-card:: Docker containers 27 | :link: docker/index 28 | :link-type: doc 29 | 30 | Launch the Geometry service as a Docker container 31 | and connect to it from PyAnsys Geometry. 32 | 33 | .. grid-item-card:: Local service 34 | :link: local/index 35 | :link-type: doc 36 | 37 | Launch the Geometry service locally on your machine 38 | and connect to it from PyAnsys Geometry. 39 | 40 | .. grid-item-card:: Remote service 41 | :link: remote/index 42 | :link-type: doc 43 | 44 | Launch the Geometry service on a remote machine and 45 | connect to it using PIM (Product Instance Manager). 46 | 47 | .. grid-item-card:: Connect to an existing service 48 | :link: existing/index 49 | :link-type: doc 50 | 51 | Connect to an existing Geometry service locally or remotely. 52 | 53 | Compatibility with Ansys releases 54 | ================================= 55 | 56 | PyAnsys Geometry continues to evolve as the Ansys products move forward. For 57 | more information, see :ref:`Ansys product version compatibility `. 58 | 59 | Development installation 60 | ======================== 61 | 62 | In case you want to support the development of PyAnsys Geometry, install the repository 63 | in development mode. For more information, see 64 | :ref:`Install package in development mode `. 65 | 66 | Frequently asked questions 67 | ========================== 68 | 69 | Any questions? Refer to :ref:`Q&A ` before submitting an issue. 70 | 71 | .. toctree:: 72 | :hidden: 73 | :maxdepth: 2 74 | 75 | docker/index 76 | local/index 77 | remote/index 78 | existing/index 79 | compatibility 80 | installation 81 | faq 82 | -------------------------------------------------------------------------------- /doc/source/getting_started/local/index.rst: -------------------------------------------------------------------------------- 1 | .. _ref_creating_local_session: 2 | 3 | Launch a local session 4 | ====================== 5 | 6 | If Ansys 2024 R1 or later and PyAnsys Geometry are installed, you can create a local backend session using 7 | Discovery, SpaceClaim, or the Geometry service. Once the backend is running, PyAnsys Geometry can manage the connection. 8 | 9 | To launch and establish a connection to the service, open Python and use the following commands for 10 | either Discovery, SpaceClaim, or the Geometry service. 11 | 12 | .. tab-set:: 13 | 14 | .. tab-item:: Discovery 15 | 16 | .. code:: python 17 | 18 | from ansys.geometry.core import launch_modeler_with_discovery 19 | 20 | modeler = launch_modeler_with_discovery() 21 | 22 | .. tab-item:: SpaceClaim 23 | 24 | .. code:: python 25 | 26 | from ansys.geometry.core import launch_modeler_with_spaceclaim 27 | 28 | modeler = launch_modeler_with_spaceclaim() 29 | 30 | .. tab-item:: Geometry service 31 | 32 | .. code:: python 33 | 34 | from ansys.geometry.core import launch_modeler_with_geometry_service 35 | 36 | modeler = launch_modeler_with_geometry_service() 37 | 38 | When launching via Geometry Service, if you have a custom local install, you can define the path of this install 39 | in the ANSYS_GEOMETRY_SERVICE_ROOT environment variable. In that case, the launcher uses this location by default. 40 | 41 | .. tab-set:: 42 | 43 | .. tab-item:: Powershell 44 | 45 | .. code-block:: pwsh 46 | 47 | $env:ANSYS_GEOMETRY_SERVICE_ROOT="C:\Program Files\ANSYS Inc\v252\GeometryService" 48 | # or 49 | $env:ANSYS_GEOMETRY_SERVICE_ROOT="C:\myCustomPath\GeometryService" 50 | 51 | .. tab-item:: Windows CMD 52 | 53 | .. code-block:: bash 54 | 55 | SET ANSYS_GEOMETRY_SERVICE_ROOT="C:\Program Files\ANSYS Inc\v252\GeometryService" 56 | # or 57 | SET ANSYS_GEOMETRY_SERVICE_ROOT="C:\myCustomPath\GeometryService" 58 | 59 | .. tab-item:: Linux 60 | 61 | .. code-block:: bash 62 | 63 | export ANSYS_GEOMETRY_SERVICE_ROOT=/my_path/to/core_geometry_service 64 | 65 | 66 | For more information on the arguments accepted by the launcher methods, see 67 | their API documentation: 68 | 69 | * `launch_modeler_with_discovery <../../api/ansys/geometry/core/connection/launcher/index.html#launcher.launch_modeler_with_discovery>`_ 70 | * `launch_modeler_with_spaceclaim <../../api/ansys/geometry/core/connection/launcher/index.html#launcher.launch_modeler_with_spaceclaim>`_ 71 | * `launch_modeler_with_geometry_service <../../api/ansys/geometry/core/connection/launcher/index.html#launcher.launch_modeler_with_geometry_service>`_ 72 | 73 | .. note:: 74 | 75 | Because this is the first release of the Geometry service, you cannot yet define a product version 76 | or API version. 77 | 78 | .. button-ref:: ../index 79 | :ref-type: doc 80 | :color: primary 81 | :shadow: 82 | :expand: 83 | 84 | Go to Getting started -------------------------------------------------------------------------------- /doc/source/index.rst: -------------------------------------------------------------------------------- 1 | .. title:: PyAnsys Geometry 2 | 3 | .. figure:: _static/logo/logo.png 4 | :align: center 5 | :width: 640px 6 | 7 | PyAnsys Geometry is a Python client library for the Ansys Geometry service. You are looking at the documentation for version |version|. 8 | 9 | .. grid:: 1 2 3 3 10 | :gutter: 1 2 3 3 11 | :padding: 1 2 3 3 12 | 13 | .. grid-item-card:: Getting started :fa:`person-running` 14 | :link: getting_started/index 15 | :link-type: doc 16 | 17 | Learn how to run the Windows Docker container, install the 18 | PyAnsys Geometry image, and launch and connect to the Geometry 19 | service. 20 | 21 | .. grid-item-card:: User guide :fa:`book-open-reader` 22 | :link: user_guide/index 23 | :link-type: doc 24 | 25 | Understand key concepts and approaches for primitives, 26 | sketches, and model designs. 27 | 28 | .. jinja:: main_toctree 29 | 30 | {% if build_api %} 31 | .. grid-item-card:: API reference :fa:`book-bookmark` 32 | :link: api/index 33 | :link-type: doc 34 | 35 | Understand PyAnsys Geometry API endpoints, their capabilities, 36 | and how to interact with them programmatically. 37 | {% endif %} 38 | 39 | {% if build_examples %} 40 | .. grid-item-card:: Examples :fa:`scroll` 41 | :link: examples 42 | :link-type: doc 43 | 44 | Explore examples that show how to use PyAnsys Geometry to 45 | perform many different types of operations. 46 | {% endif %} 47 | 48 | .. grid-item-card:: Contribute :fa:`people-group` 49 | :link: contributing 50 | :link-type: doc 51 | 52 | Learn how to contribute to the PyAnsys Geometry codebase 53 | or documentation. 54 | 55 | .. grid-item-card:: Assets :fa:`download` 56 | :link: assets 57 | :link-type: doc 58 | 59 | Download different assets related to PyAnsys Geometry, 60 | such as documentation, package wheelhouse, and related files. 61 | 62 | .. jinja:: main_toctree 63 | 64 | .. toctree:: 65 | :hidden: 66 | :maxdepth: 3 67 | 68 | getting_started/index 69 | user_guide/index 70 | {% if build_api %} 71 | api/index 72 | {% endif %} 73 | {% if build_examples %} 74 | examples 75 | {% endif %} 76 | contributing 77 | assets 78 | changelog 79 | -------------------------------------------------------------------------------- /doc/source/user_guide/index.rst: -------------------------------------------------------------------------------- 1 | .. _ref_user_guide: 2 | 3 | ========== 4 | User guide 5 | ========== 6 | 7 | This section provides an overview of the PyAnsys Geometry library, 8 | explaining key concepts and approaches for primitives, 9 | sketches (2D basic shape elements), and model designs. 10 | 11 | .. toctree:: 12 | :maxdepth: 1 13 | :hidden: 14 | 15 | primitives 16 | shapes 17 | designer 18 | 19 | PyAnsys Geometry overview 20 | ========================= 21 | 22 | PyAnsys Geometry is a Python wrapper for the Ansys Geometry service. 23 | Here are some of the key features of PyAnsys Geometry: 24 | 25 | * Ability to use the library alongside other Python libraries 26 | * A *functional-style* API for a clean and easy coding experience 27 | * Built-in examples 28 | 29 | Simple interactive example 30 | ========================== 31 | This simple interactive example shows how to start an instance of 32 | the Geometry server and create a geometry model. 33 | 34 | Start Geometry server instance 35 | ------------------------------ 36 | 37 | The :class:`Modeler() ` class 38 | within the ``ansys-geometry-core`` library creates an instance of 39 | the Geometry service. By default, the ``Modeler`` instance connects to 40 | ``127.0.0.1`` (``"localhost"``) on port ``50051``. You can change this 41 | by modifying the ``host`` and ``port`` parameters of the ``Modeler`` object, 42 | but note that you must also modify your ``docker run`` command by changing 43 | the ``:50051`` argument. 44 | 45 | This code starts an instance of the Geometry service: 46 | 47 | .. code:: pycon 48 | 49 | >>> from ansys.geometry.core import Modeler 50 | >>> modeler = Modeler() 51 | 52 | Create geometry model 53 | --------------------- 54 | 55 | Once an instance has started, you can create a 56 | geometry model by initializing the :ref:`sketch ` subpackage and using the 57 | :ref:`shapes ` subpackage. 58 | 59 | .. code:: python 60 | 61 | from ansys.geometry.core.math import Plane, Point3D, Point2D 62 | from ansys.geometry.core.misc import UNITS 63 | from ansys.geometry.core.sketch import Sketch 64 | 65 | # Define our sketch 66 | origin = Point3D([0, 0, 10]) 67 | plane = Plane(origin, direction_x=[1, 0, 0], direction_y=[0, 1, 0]) 68 | 69 | # Create the sketch 70 | sketch = Sketch(plane) 71 | sketch.circle(Point2D([1, 1]), 30 * UNITS.m) 72 | sketch.plot() 73 | 74 | .. jupyter-execute:: 75 | :hide-code: 76 | 77 | from ansys.geometry.core.math import Plane, Point3D, Point2D 78 | from ansys.geometry.core.misc import UNITS 79 | from ansys.geometry.core.sketch import Sketch 80 | 81 | origin = Point3D([0, 0, 10]) 82 | plane = Plane(origin, direction_x=[1, 0, 0], direction_y=[0, 1, 0]) 83 | sketch = Sketch(plane) 84 | sketch.circle(Point2D([1, 1]), 30 * UNITS.m) 85 | sketch.plot() 86 | -------------------------------------------------------------------------------- /doc/source/user_guide/primitives.rst: -------------------------------------------------------------------------------- 1 | .. _ref_primitives: 2 | 3 | Primitives 4 | ********** 5 | 6 | The PyAnsys Geometry :class:`math ` subpackage consists 7 | of primitive representations of basic geometric objects, such as a point, vector, and 8 | matrix. To operate and manipulate physical quantities, this subpackage uses 9 | `Pint `_, a third-party open source software 10 | that other PyAnsys libraries also use. It also uses its :class:`shapes ` 11 | subpackage to evaluate and represent geometric shapes (both curves and surfaces), 12 | such as lines, circles, cones, spheres and torus. 13 | 14 | This table shows PyAnsys Geometry names and base values for the physical quantities: 15 | 16 | +----------------------------+---------+ 17 | | Name | value | 18 | +============================+=========+ 19 | | LENGTH_ACCURACY | 1e-8 | 20 | +----------------------------+---------+ 21 | | ANGLE_ACCURACY | 1e-6 | 22 | +----------------------------+---------+ 23 | | DEFAULT_UNITS.LENGTH | meter | 24 | +----------------------------+---------+ 25 | | DEFAULT_UNITS.ANGLE | radian | 26 | +----------------------------+---------+ 27 | 28 | To define accuracy and measurements, you use these PyAnsys Geometry classes: 29 | 30 | * :class:`Accuracy() ` 31 | * :class:`Measurements() ` 32 | 33 | Planes 34 | ------ 35 | 36 | The :class:`Plane() ` class provides primitive representation 37 | of a 2D plane in 3D space. It has an origin and a coordinate system. 38 | Sketched shapes are always defined relative to a plane. 39 | The default working plane is XY, which has ``(0,0)`` as its origin. 40 | 41 | If you create a 2D object in the plane, PyAnsys Geometry converts it to the global coordinate system so that 42 | the 2D feature executes as expected: 43 | 44 | .. code:: python 45 | 46 | from ansys.geometry.core.math import Plane, Point3D, UnitVector3D 47 | 48 | origin = Point3D([42, 99, 13]) 49 | plane = Plane(origin, UnitVector3D([1, 0, 0]), UnitVector3D([0, 1, 0])) 50 | -------------------------------------------------------------------------------- /doc/styles/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !config 3 | !config/vocabularies 4 | !config/vocabularies/ANSYS 5 | !config/vocabularies/ANSYS/** 6 | !.gitignore 7 | -------------------------------------------------------------------------------- /doc/styles/config/vocabularies/ANSYS/accept.txt: -------------------------------------------------------------------------------- 1 | (?i)ansys 2 | (?i)api 3 | (?i)check 4 | [Cc]onda 5 | (?i)dependabot 6 | Direct API 7 | Dockerfile 8 | (?i)docker 9 | dockerized 10 | Fluent API 11 | (?i)geometry 12 | Geometry service 13 | Geometry models 14 | (?i)github 15 | GitHub Container Registry 16 | namespace 17 | Polydata 18 | PROTO 19 | Protobuf 20 | (?i)pyansys 21 | (?i)pyansys-geometry 22 | PyPI 23 | PyVista 24 | pytest 25 | SciPy 26 | subpackage 27 | launch_modeler_with_.* -------------------------------------------------------------------------------- /doc/styles/config/vocabularies/ANSYS/reject.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/doc/styles/config/vocabularies/ANSYS/reject.txt -------------------------------------------------------------------------------- /docker/README.rst: -------------------------------------------------------------------------------- 1 | Create your own Geometry service Docker container 2 | ================================================= 3 | 4 | To learn how to build your own Geometry service Docker container, 5 | see these topics: 6 | 7 | .. * `Guide to building the Linux Docker container `_. 8 | * `Guide to building the Windows Docker container `_. 9 | 10 | If you have your own Ansys installation, you can build a Docker container 11 | that uses your installation. In order to do this, download the 12 | Python script `build_docker_windows.py `_ 13 | and run it from the command line: 14 | 15 | .. code-block:: bash 16 | 17 | python build_docker_windows.py 18 | 19 | If you have any problems, open a `GitHub Issue `_. -------------------------------------------------------------------------------- /docker/linux/coreservice/Dockerfile: -------------------------------------------------------------------------------- 1 | # Geometry service Linux-based Dockerfile 2 | # 3 | # Based on mcr.microsoft.com/dotnet/aspnet:8.0 4 | FROM mcr.microsoft.com/dotnet/aspnet:8.0 5 | 6 | # Define the working directory - /app 7 | WORKDIR /app 8 | 9 | # Install unzip 10 | RUN apt-get update && \ 11 | apt-get install -y --no-install-recommends unzip=6.* && \ 12 | apt-get install -y --no-install-recommends gcc=4:12.2.* && \ 13 | apt-get install -y --no-install-recommends mono-mcs=6.8.0.* && \ 14 | apt-get install -y --no-install-recommends libgfortran5=12.2.* && \ 15 | rm -rf /var/lib/apt/lists/* 16 | 17 | # Add the binary files from the latest release 18 | COPY linux-core-binaries.zip . 19 | RUN unzip -qq linux-core-binaries.zip -d . && \ 20 | rm linux-core-binaries.zip && \ 21 | chmod -R 0755 bin && \ 22 | mv bin/x64/Release_Core_Linux/net8.0/* . && \ 23 | rm -rf bin 24 | 25 | # Let the dynamic link loader where to search for shared libraries 26 | ENV LD_LIBRARY_PATH=/app:/app/CADIntegration/bin:/app/Native/Linux 27 | 28 | # Define env variables 29 | ENV ANS_DSCO_REMOTE_PORT=50051 30 | ENV ANS_DSCO_REMOTE_IP="0.0.0.0" 31 | ENV LOG_LEVEL=2 32 | ENV ANSYSLMD_LICENSE_FILE="" 33 | ENV ANSYS_CI_INSTALL=/app/CADIntegration 34 | ENV P_SCHEMA=/app/Schema/ 35 | ENV ANSYSCL252_DIR=/app/licensingclient/ 36 | ENV ANSYSCL261_DIR=/app/licensingclient/ 37 | 38 | # Add container labels 39 | LABEL org.opencontainers.image.authors="ANSYS Inc." 40 | LABEL org.opencontainers.image.vendor="ANSYS Inc." 41 | 42 | # Expose the Geometry service port 43 | EXPOSE 50051 44 | 45 | # Define the entrypoint for the Geometry service 46 | ENTRYPOINT ["dotnet", "/app/Presentation.ApiServerCoreService.dll"] 47 | -------------------------------------------------------------------------------- /docker/windows/coreservice/Dockerfile: -------------------------------------------------------------------------------- 1 | # hadolint shell = cmd.exe 2 | # 3 | # Geometry service Windows-based Dockerfile 4 | # 5 | # Based on mcr.microsoft.com/dotnet/framework/runtime:4.7.2-windowsservercore-ltsc2022 6 | FROM mcr.microsoft.com/dotnet/aspnet:8.0-preview-windowsservercore-ltsc2022 7 | 8 | # Define the working directory - /temp 9 | WORKDIR /temp 10 | 11 | # Download Microsoft Visual C++ Redistributable x64 12 | ADD https://aka.ms/vs/17/release/VC_redist.x64.exe VC_redist.x64.exe 13 | RUN VC_redist.x64.exe /install /quiet /norestart 14 | ADD https://download.visualstudio.microsoft.com/download/pr/f5f1c28d-7bc9-431e-98da-3e2c1bbd1228/864e152e374b5c9ca6d58ee953c5a6ed/dotnet-sdk-8.0.401-win-x64.exe dotnet-sdk-8.0.401-win-x64.exe 15 | RUN dotnet-sdk-8.0.401-win-x64.exe /install /quiet /norestart 16 | 17 | # Define the working directory - /app 18 | WORKDIR /app 19 | 20 | # Add the binary files from the latest release 21 | COPY windows-core-binaries.zip . 22 | RUN mkdir tmp_folder && \ 23 | tar -xf windows-core-binaries.zip -C tmp_folder && \ 24 | xcopy tmp_folder\bin\x64\Release_Core_Windows\net8.0\* . /e /i /h && \ 25 | xcopy tmp_folder\* . && \ 26 | del windows-core-binaries.zip && \ 27 | rmdir /s /q tmp_folder 28 | 29 | # Defining environment variables 30 | RUN setx Path "%Path%;C:\app;C:\app\Native\Windows;C:\app\CADIntegration\bin" 31 | ENV ANS_DSCO_REMOTE_PORT=50051 32 | ENV ANS_DSCO_REMOTE_IP="0.0.0.0" 33 | ENV LOG_LEVEL=2 34 | ENV ANSYSLMD_LICENSE_FILE="" 35 | ENV ANSYS_CI_INSTALL=C:/app/CADIntegration 36 | ENV P_SCHEMA=C:/app/Schema 37 | ENV ANSYSCL252_DIR=C:/app/licensingclient 38 | ENV ANSYSCL261_DIR=C:/app/licensingclient 39 | 40 | # Add container labels 41 | LABEL org.opencontainers.image.authors="ANSYS Inc." 42 | LABEL org.opencontainers.image.vendor="ANSYS Inc." 43 | 44 | # Expose the Geometry service port 45 | EXPOSE 50051 46 | 47 | # Define the entrypoint for the Geometry service 48 | # hadolint ignore=DL3025 49 | ENTRYPOINT dotnet C:\app\Presentation.ApiServerCoreService.dll 50 | -------------------------------------------------------------------------------- /docker/windows/dms/Dockerfile: -------------------------------------------------------------------------------- 1 | # hadolint shell = cmd.exe 2 | # 3 | # Geometry service Windows-based Dockerfile 4 | # 5 | # Based on mcr.microsoft.com/dotnet/framework/runtime:4.7.2-windowsservercore-ltsc2019 6 | FROM mcr.microsoft.com/dotnet/framework/runtime:4.7.2-windowsservercore-ltsc2019 7 | 8 | # Define the working directory - /temp 9 | WORKDIR /temp 10 | 11 | # Download Microsoft Visual C++ Redistributable x64 12 | ADD https://aka.ms/vs/17/release/VC_redist.x64.exe VC_redist.x64.exe 13 | RUN VC_redist.x64.exe /install /quiet /norestart 14 | 15 | # Define the working directory - /app 16 | WORKDIR /app 17 | 18 | # Add the binary files from the latest release 19 | COPY windows-dms-binaries.zip . 20 | RUN mkdir tmp_folder && \ 21 | tar -xf windows-dms-binaries.zip -C tmp_folder && \ 22 | xcopy tmp_folder\bin\x64\Release_Headless\net472\* . /e /i /h && \ 23 | xcopy tmp_folder\* . && \ 24 | del windows-dms-binaries.zip && \ 25 | rmdir /s /q tmp_folder 26 | 27 | # Defining environment variables 28 | ENV LICENSE_SERVER="" 29 | ENV SERVER_ENDPOINT="0.0.0.0:50051" 30 | ENV ENABLE_TRACE=0 31 | ENV LOG_LEVEL=2 32 | ENV AWP_ROOT252=C:/app/unified 33 | 34 | # Add container labels 35 | LABEL org.opencontainers.image.authors="ANSYS Inc." 36 | LABEL org.opencontainers.image.vendor="ANSYS Inc." 37 | 38 | # Expose the Geometry service port 39 | EXPOSE 50051 40 | 41 | # Define the entrypoint for the Geometry service 42 | ENTRYPOINT ["Presentation.ApiServerDMS.exe"] 43 | -------------------------------------------------------------------------------- /pytest-nographics.ini: -------------------------------------------------------------------------------- 1 | [pytest] 2 | minversion = 7.1 3 | addopts = -ra --cov=ansys.geometry --cov-report html:.cov/html --cov-report xml:.cov/xml --cov-report term -vv 4 | testpaths = ["tests"] 5 | -------------------------------------------------------------------------------- /src/ansys/geometry/core/_grpc/_services/base/admin.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | """Module containing the admin service implementation (abstraction layer).""" 23 | 24 | from abc import ABC, abstractmethod 25 | 26 | import grpc 27 | 28 | 29 | class GRPCAdminService(ABC): # pragma: no cover 30 | """Admin service for gRPC communication with the Geometry server. 31 | 32 | Parameters 33 | ---------- 34 | channel : grpc.Channel 35 | The gRPC channel to the server. 36 | """ 37 | 38 | def __init__(self, channel: grpc.Channel): 39 | """Initialize the GRPCAdminService class.""" 40 | pass 41 | 42 | @abstractmethod 43 | def get_backend(self, **kwargs) -> dict: 44 | """Get server information.""" 45 | pass 46 | 47 | @abstractmethod 48 | def get_logs(self, **kwargs) -> dict: 49 | """Get server logs.""" 50 | pass 51 | 52 | @abstractmethod 53 | def get_service_status(self, **kwargs) -> dict: 54 | """Get server status (i.e. healthy or not).""" 55 | pass 56 | -------------------------------------------------------------------------------- /src/ansys/geometry/core/_grpc/_services/base/coordinate_systems.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | """Module containing the coordinate systems service implementation (abstraction layer).""" 23 | 24 | from abc import ABC, abstractmethod 25 | 26 | import grpc 27 | 28 | 29 | class GRPCCoordinateSystemService(ABC): # pragma: no cover 30 | """Coordinate systems service for gRPC communication with the Geometry server. 31 | 32 | Parameters 33 | ---------- 34 | channel : grpc.Channel 35 | The gRPC channel to the server. 36 | """ 37 | 38 | def __init__(self, channel: grpc.Channel): 39 | """Initialize the GRPCCoordinateSystemService class.""" 40 | pass 41 | 42 | @abstractmethod 43 | def create(self, **kwargs) -> dict: 44 | """Create a coordinate system.""" 45 | pass 46 | -------------------------------------------------------------------------------- /src/ansys/geometry/core/_grpc/_services/base/dbuapplication.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | """Module containing the DBU Application service implementation (abstraction layer).""" 23 | 24 | from abc import ABC, abstractmethod 25 | 26 | import grpc 27 | 28 | 29 | class GRPCDbuApplicationService(ABC): # pragma: no cover 30 | """DBU Application service for gRPC communication with the Geometry server. 31 | 32 | Parameters 33 | ---------- 34 | channel : grpc.Channel 35 | The gRPC channel to the server. 36 | """ 37 | 38 | def __init__(self, channel: grpc.Channel): 39 | """Initialize the GRPCDbuApplicationService class.""" 40 | pass 41 | 42 | @abstractmethod 43 | def run_script(self, **kwargs) -> dict: 44 | """Run a Scripting API script.""" 45 | pass 46 | -------------------------------------------------------------------------------- /src/ansys/geometry/core/_grpc/_services/base/designs.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | """Module containing the designs service implementation (abstraction layer).""" 23 | 24 | from abc import ABC, abstractmethod 25 | 26 | import grpc 27 | 28 | 29 | class GRPCDesignsService(ABC): # pragma: no cover 30 | """Designs service for gRPC communication with the Geometry server. 31 | 32 | Parameters 33 | ---------- 34 | channel : grpc.Channel 35 | The gRPC channel to the server. 36 | """ 37 | 38 | def __init__(self, channel: grpc.Channel): 39 | """Initialize the GRPCDesignsService class.""" 40 | pass 41 | 42 | @abstractmethod 43 | def open(self, **kwargs) -> dict: 44 | """Open a design on the service.""" 45 | pass 46 | 47 | @abstractmethod 48 | def new(self, **kwargs) -> dict: 49 | """Create a new design.""" 50 | pass 51 | 52 | @abstractmethod 53 | def close(self, **kwargs) -> dict: 54 | """Close the currently open design.""" 55 | pass 56 | 57 | @abstractmethod 58 | def put_active(self, **kwargs) -> dict: 59 | """Activate an already opened design on the service.""" 60 | pass 61 | 62 | @abstractmethod 63 | def save_as(self, **kwargs) -> dict: 64 | """Create a new design.""" 65 | pass 66 | 67 | @abstractmethod 68 | def download_export(self, **kwargs) -> dict: 69 | """Download and export a design into a certain format.""" 70 | pass 71 | 72 | @abstractmethod 73 | def stream_download_export(self, **kwargs) -> dict: 74 | """Download and export a design into a certain format.""" 75 | pass 76 | 77 | @abstractmethod 78 | def insert(self, **kwargs) -> dict: 79 | """Insert a part/component/design into an existing design.""" 80 | pass 81 | 82 | @abstractmethod 83 | def get_active(self, **kwargs) -> dict: 84 | """Get the active design on the service.""" 85 | pass 86 | -------------------------------------------------------------------------------- /src/ansys/geometry/core/_grpc/_services/base/driving_dimensions.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | """Module containing the Driving Dimension service implementation (abstraction layer).""" 23 | 24 | from abc import ABC, abstractmethod 25 | 26 | import grpc 27 | 28 | 29 | class GRPCDrivingDimensionsService(ABC): # pragma: no cover 30 | """Driving Dimension service for gRPC communication with the Geometry server. 31 | 32 | Parameters 33 | ---------- 34 | channel : grpc.Channel 35 | The gRPC channel to the server. 36 | """ 37 | 38 | def __init__(self, channel: grpc.Channel): 39 | """Initialize the GRPCDrivingDimensionsService class.""" 40 | pass 41 | 42 | @abstractmethod 43 | def get_all_parameters(self, **kwargs) -> dict: 44 | """Get driving dimensions.""" 45 | pass 46 | 47 | @abstractmethod 48 | def set_parameter(self, **kwargs) -> dict: 49 | """Set driving dimensions.""" 50 | pass 51 | -------------------------------------------------------------------------------- /src/ansys/geometry/core/_grpc/_services/base/edges.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | """Module containing the edges service implementation (abstraction layer).""" 23 | 24 | from abc import ABC, abstractmethod 25 | 26 | import grpc 27 | 28 | 29 | class GRPCEdgesService(ABC): # pragma: no cover 30 | """Edges service for gRPC communication with the Geometry server. 31 | 32 | Parameters 33 | ---------- 34 | channel : grpc.Channel 35 | The gRPC channel to the server. 36 | """ 37 | 38 | def __init__(self, channel: grpc.Channel): 39 | """Initialize the GRPCEdgesService class.""" 40 | pass 41 | 42 | @abstractmethod 43 | def get_edge(self, **kwargs) -> dict: 44 | """Get edge.""" 45 | pass 46 | 47 | @abstractmethod 48 | def get_curve(self, **kwargs) -> dict: 49 | """Get curve information for the edge.""" 50 | pass 51 | 52 | @abstractmethod 53 | def get_start_and_end_points(self, **kwargs) -> dict: 54 | """Get start and end points for the edge.""" 55 | pass 56 | 57 | @abstractmethod 58 | def get_length(self, **kwargs) -> dict: 59 | """Get the length of the edge.""" 60 | pass 61 | 62 | @abstractmethod 63 | def get_interval(self, **kwargs) -> dict: 64 | """Get the interval of the edge.""" 65 | pass 66 | 67 | @abstractmethod 68 | def get_faces(self, **kwargs) -> dict: 69 | """Get the faces that are connected to the edge.""" 70 | pass 71 | 72 | @abstractmethod 73 | def get_bounding_box(self, **kwargs) -> dict: 74 | """Get the bounding box of the edge.""" 75 | pass 76 | -------------------------------------------------------------------------------- /src/ansys/geometry/core/_grpc/_services/base/materials.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | """Module containing the materials service implementation (abstraction layer).""" 23 | 24 | from abc import ABC, abstractmethod 25 | 26 | import grpc 27 | 28 | 29 | class GRPCMaterialsService(ABC): # pragma: no cover 30 | """Materials service for gRPC communication with the Geometry server. 31 | 32 | Parameters 33 | ---------- 34 | channel : grpc.Channel 35 | The gRPC channel to the server. 36 | """ 37 | 38 | def __init__(self, channel: grpc.Channel): 39 | """Initialize the GRPCMaterialsService class.""" 40 | pass 41 | 42 | @abstractmethod 43 | def add_material(self, **kwargs) -> dict: 44 | """Add material to the service design.""" 45 | pass 46 | -------------------------------------------------------------------------------- /src/ansys/geometry/core/_grpc/_services/base/measurement_tools.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | """Module containing the measurement tools service implementation (abstraction layer).""" 23 | 24 | from abc import ABC, abstractmethod 25 | 26 | import grpc 27 | 28 | 29 | class GRPCMeasurementToolsService(ABC): # pragma: no cover 30 | """Measurement tools service for gRPC communication with the Geometry server. 31 | 32 | Parameters 33 | ---------- 34 | channel : grpc.Channel 35 | The gRPC channel to the server. 36 | """ 37 | 38 | def __init__(self, channel: grpc.Channel): 39 | """Initialize the GRPCMeasurementToolsService class.""" 40 | pass 41 | 42 | @abstractmethod 43 | def min_distance_between_objects(self, **kwargs) -> dict: 44 | """Calculate the minimum distance between two objects.""" 45 | pass 46 | -------------------------------------------------------------------------------- /src/ansys/geometry/core/_grpc/_services/base/named_selection.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | """Module containing the Named Selection service implementation (abstraction layer).""" 23 | 24 | from abc import ABC, abstractmethod 25 | 26 | import grpc 27 | 28 | 29 | class GRPCNamedSelectionService(ABC): # pragma: no cover 30 | """Named Selection service for gRPC communication with the Geometry server. 31 | 32 | Parameters 33 | ---------- 34 | channel : grpc.Channel 35 | The gRPC channel to the server. 36 | """ 37 | 38 | def __init__(self, channel: grpc.Channel): 39 | """Initialize the GRPCNamedSelectionService class.""" 40 | pass 41 | 42 | @abstractmethod 43 | def get_named_selection(self, **kwargs) -> dict: 44 | """Get the named selection by its id.""" 45 | pass 46 | 47 | @abstractmethod 48 | def create_named_selection(self, **kwargs) -> dict: 49 | """Create a named selection.""" 50 | pass 51 | 52 | @abstractmethod 53 | def delete_named_selection(self, **kwargs) -> dict: 54 | """Delete a named selection by id.""" 55 | pass 56 | -------------------------------------------------------------------------------- /src/ansys/geometry/core/_grpc/_services/base/parts.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | """Module containing the parts service implementation (abstraction layer).""" 23 | 24 | from abc import ABC, abstractmethod 25 | 26 | import grpc 27 | 28 | 29 | class GRPCPartsService(ABC): # pragma: no cover 30 | """Parts service for gRPC communication with the Geometry server. 31 | 32 | Parameters 33 | ---------- 34 | channel : grpc.Channel 35 | The gRPC channel to the server. 36 | """ 37 | 38 | def __init__(self, channel: grpc.Channel): 39 | """Initialize the GRPCPartsService class.""" 40 | pass 41 | 42 | @abstractmethod 43 | def export(self, **kwargs) -> dict: 44 | """Export a part to a file.""" 45 | pass 46 | -------------------------------------------------------------------------------- /src/ansys/geometry/core/_grpc/_services/base/prepare_tools.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | """Module containing the prepare tools service implementation (abstraction layer).""" 23 | 24 | from abc import ABC, abstractmethod 25 | 26 | import grpc 27 | 28 | 29 | class GRPCPrepareToolsService(ABC): # pragma: no cover 30 | """Prepare tools service for gRPC communication with the Geometry server. 31 | 32 | Parameters 33 | ---------- 34 | channel : grpc.Channel 35 | The gRPC channel to the server. 36 | """ 37 | 38 | def __init__(self, channel: grpc.Channel): 39 | """Initialize the GRPCPrepareToolsService class.""" 40 | pass 41 | 42 | @abstractmethod 43 | def extract_volume_from_faces(self, **kwargs) -> dict: 44 | """Extract a volume from input faces.""" 45 | pass 46 | 47 | @abstractmethod 48 | def extract_volume_from_edge_loops(self, **kwargs) -> dict: 49 | """Extract a volume from input edge loop.""" 50 | pass 51 | 52 | @abstractmethod 53 | def remove_rounds(self, **kwargs) -> dict: 54 | """Remove rounds from geometry.""" 55 | pass 56 | 57 | @abstractmethod 58 | def share_topology(self, **kwargs) -> dict: 59 | """Share topology between the given bodies.""" 60 | pass 61 | 62 | @abstractmethod 63 | def enhanced_share_topology(self, **kwargs) -> dict: 64 | """Share topology between the given bodies.""" 65 | pass 66 | 67 | @abstractmethod 68 | def find_logos(self, **kwargs) -> dict: 69 | """Detect logos in geometry.""" 70 | pass 71 | 72 | @abstractmethod 73 | def find_and_remove_logos(self, **kwargs) -> dict: 74 | """Detect and remove logos in geometry.""" 75 | pass 76 | 77 | @abstractmethod 78 | def remove_logo(self, **kwargs) -> dict: 79 | """Remove logos in geometry.""" 80 | pass 81 | -------------------------------------------------------------------------------- /src/ansys/geometry/core/_grpc/_services/v0/coordinate_systems.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | """Module containing the coordinate systems service implementation for v0.""" 23 | 24 | import grpc 25 | 26 | from ansys.geometry.core.errors import protect_grpc 27 | 28 | from ..base.coordinate_systems import GRPCCoordinateSystemService 29 | from .conversions import from_frame_to_grpc_frame, from_grpc_frame_to_frame 30 | 31 | 32 | class GRPCCoordinateSystemServiceV0(GRPCCoordinateSystemService): 33 | """Coordinate systems service for gRPC communication with the Geometry server. 34 | 35 | This class provides methods to interact with the Geometry server's 36 | coordinate systems service. It is specifically designed for the v0 version of the 37 | Geometry API. 38 | 39 | Parameters 40 | ---------- 41 | channel : grpc.Channel 42 | The gRPC channel to the server. 43 | """ 44 | 45 | @protect_grpc 46 | def __init__(self, channel: grpc.Channel): # noqa: D102 47 | from ansys.api.geometry.v0.coordinatesystems_pb2_grpc import CoordinateSystemsStub 48 | 49 | self.stub = CoordinateSystemsStub(channel) 50 | 51 | @protect_grpc 52 | def create(self, **kwargs) -> dict: # noqa: D102 53 | from ansys.api.geometry.v0.coordinatesystems_pb2 import CreateRequest 54 | 55 | # Create the request - assumes all inputs are valid and of the proper type 56 | request = CreateRequest( 57 | parent=kwargs["parent_id"], 58 | name=kwargs["name"], 59 | frame=from_frame_to_grpc_frame(kwargs["frame"]), 60 | ) 61 | 62 | # Call the gRPC service 63 | response = self.stub.Create(request=request) 64 | 65 | # Return the response - formatted as a dictionary 66 | return { 67 | "id": response.id, 68 | "name": response.name, 69 | "frame": from_grpc_frame_to_frame(response.frame), 70 | } 71 | -------------------------------------------------------------------------------- /src/ansys/geometry/core/_grpc/_services/v0/dbuapplication.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | """Module containing the DBU Application service implementation for v0.""" 23 | 24 | import grpc 25 | 26 | from ansys.geometry.core.errors import protect_grpc 27 | 28 | from ..base.dbuapplication import GRPCDbuApplicationService 29 | 30 | 31 | class GRPCDbuApplicationServiceV0(GRPCDbuApplicationService): 32 | """DBU Application service for gRPC communication with the Geometry server. 33 | 34 | This class provides methods to interact with the Geometry server's 35 | DBU Application service. It is specifically designed for the v0 version 36 | of the Geometry API. 37 | 38 | Parameters 39 | ---------- 40 | channel : grpc.Channel 41 | The gRPC channel to the server. 42 | """ 43 | 44 | @protect_grpc 45 | def __init__(self, channel: grpc.Channel): # noqa: D102 46 | from ansys.api.dbu.v0.dbuapplication_pb2_grpc import DbuApplicationStub 47 | 48 | self.stub = DbuApplicationStub(channel) 49 | 50 | @protect_grpc 51 | def run_script(self, **kwargs) -> dict: # noqa: D102 52 | from ansys.api.dbu.v0.dbuapplication_pb2 import RunScriptFileRequest 53 | 54 | # Create the request - assumes all inputs are valid and of the proper type 55 | request = RunScriptFileRequest( 56 | script_path=kwargs["script_path"], 57 | script_args=kwargs["script_args"], 58 | api_version=kwargs["api_version"], 59 | ) 60 | 61 | # Call the gRPC service 62 | response = self.stub.RunScriptFile(request) 63 | 64 | # Return the response - formatted as a dictionary 65 | return { 66 | "success": response.success, 67 | "message": response.message, 68 | "values": None if not response.values else dict(response.values), 69 | } 70 | -------------------------------------------------------------------------------- /src/ansys/geometry/core/_grpc/_services/v0/materials.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | """Module containing the materials service implementation for v0.""" 23 | 24 | import grpc 25 | 26 | from ansys.geometry.core.errors import protect_grpc 27 | 28 | from ..base.materials import GRPCMaterialsService 29 | from .conversions import from_material_to_grpc_material 30 | 31 | 32 | class GRPCMaterialsServiceV0(GRPCMaterialsService): 33 | """Materials service for gRPC communication with the Geometry server. 34 | 35 | This class provides methods to interact with the Geometry server's 36 | materials service. It is specifically designed for the v0 version of the 37 | Geometry API. 38 | 39 | Parameters 40 | ---------- 41 | channel : grpc.Channel 42 | The gRPC channel to the server. 43 | """ 44 | 45 | @protect_grpc 46 | def __init__(self, channel: grpc.Channel): # noqa: D102 47 | from ansys.api.geometry.v0.materials_pb2_grpc import MaterialsStub 48 | 49 | self.stub = MaterialsStub(channel) 50 | 51 | @protect_grpc 52 | def add_material(self, **kwargs) -> dict: # noqa: D102 53 | from ansys.api.geometry.v0.materials_pb2 import AddToDocumentRequest 54 | 55 | # Create the request - assumes all inputs are valid and of the proper type 56 | request = AddToDocumentRequest( 57 | material=from_material_to_grpc_material(kwargs["material"]), 58 | ) 59 | 60 | # Call the gRPC service 61 | _ = self.stub.AddToDocument(request=request) 62 | 63 | # Convert the response to a dictionary 64 | return {} 65 | -------------------------------------------------------------------------------- /src/ansys/geometry/core/_grpc/_services/v0/parts.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | """Module containing the parts service implementation for v0.""" 23 | 24 | import grpc 25 | 26 | from ansys.geometry.core.errors import protect_grpc 27 | 28 | from ..base.parts import GRPCPartsService 29 | from .conversions import from_design_file_format_to_grpc_part_export_format 30 | 31 | 32 | class GRPCPartsServiceV0(GRPCPartsService): 33 | """Parts service for gRPC communication with the Geometry server. 34 | 35 | This class provides methods to interact with the Geometry server's 36 | parts service. It is specifically designed for the v0 version of the 37 | Geometry API. 38 | 39 | Parameters 40 | ---------- 41 | channel : grpc.Channel 42 | The gRPC channel to the server. 43 | """ 44 | 45 | @protect_grpc 46 | def __init__(self, channel: grpc.Channel): # noqa: D102 47 | from ansys.api.geometry.v0.parts_pb2_grpc import PartsStub 48 | 49 | self.stub = PartsStub(channel) 50 | 51 | @protect_grpc 52 | def export(self, **kwargs) -> dict: # noqa: D102 53 | from ansys.api.geometry.v0.parts_pb2 import ExportRequest 54 | 55 | # Create the request - assumes all inputs are valid and of the proper type 56 | request = ExportRequest( 57 | format=from_design_file_format_to_grpc_part_export_format(kwargs["format"]) 58 | ) 59 | 60 | # Call the gRPC service 61 | response = self.stub.Export(request) 62 | 63 | # Return the response 64 | data = bytes() 65 | data += response.data 66 | return { 67 | "data": data, 68 | } 69 | -------------------------------------------------------------------------------- /src/ansys/geometry/core/_grpc/_services/v1/admin.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | """Module containing the admin service implementation for v1.""" 23 | 24 | import grpc 25 | 26 | from ansys.geometry.core.errors import protect_grpc 27 | 28 | from ..base.admin import GRPCAdminService 29 | 30 | 31 | class GRPCAdminServiceV1(GRPCAdminService): # pragma: no cover 32 | """Admin service for gRPC communication with the Geometry server. 33 | 34 | This class provides methods to interact with the Geometry server's 35 | admin service. It is specifically designed for the v1 version of the 36 | Geometry API. 37 | 38 | Parameters 39 | ---------- 40 | channel : grpc.Channel 41 | The gRPC channel to the server. 42 | """ 43 | 44 | @protect_grpc 45 | def __init__(self, channel: grpc.Channel): # noqa: D102 46 | from ansys.api.dbu.v1.admin_pb2_grpc import AdminStub 47 | 48 | self.stub = AdminStub(channel) 49 | 50 | @protect_grpc 51 | def get_backend(self, **kwargs) -> dict: # noqa: D102 52 | raise NotImplementedError 53 | 54 | @protect_grpc 55 | def get_logs(self, **kwargs) -> dict: # noqa: D102 56 | raise NotImplementedError 57 | 58 | @protect_grpc 59 | def get_service_status(self, **kwargs) -> dict: # noqa: D102 60 | raise NotImplementedError 61 | -------------------------------------------------------------------------------- /src/ansys/geometry/core/_grpc/_services/v1/coordinate_systems.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | """Module containing the coordinate systems service implementation for v1.""" 23 | 24 | import grpc 25 | 26 | from ansys.geometry.core.errors import protect_grpc 27 | 28 | from ..base.coordinate_systems import GRPCCoordinateSystemService 29 | 30 | 31 | class GRPCCoordinateSystemServiceV1(GRPCCoordinateSystemService): # pragma: no cover 32 | """Coordinate systems service for gRPC communication with the Geometry server. 33 | 34 | This class provides methods to interact with the Geometry server's 35 | coordinate systems service. It is specifically designed for the v1 version of the 36 | Geometry API. 37 | 38 | Parameters 39 | ---------- 40 | channel : grpc.Channel 41 | The gRPC channel to the server. 42 | """ 43 | 44 | @protect_grpc 45 | def __init__(self, channel: grpc.Channel): # noqa: D102 46 | from ansys.api.geometry.v1.coordinatesystems_pb2_grpc import CoordinateSystemsStub 47 | 48 | self.stub = CoordinateSystemsStub(channel) 49 | 50 | @protect_grpc 51 | def create(self, **kwargs) -> dict: # noqa: D102 52 | raise NotImplementedError 53 | -------------------------------------------------------------------------------- /src/ansys/geometry/core/_grpc/_services/v1/dbuapplication.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | """Module containing the DBU Application service implementation for v1.""" 23 | 24 | import grpc 25 | 26 | from ansys.geometry.core.errors import protect_grpc 27 | 28 | from ..base.dbuapplication import GRPCDbuApplicationService 29 | 30 | 31 | class GRPCDbuApplicationServiceV1(GRPCDbuApplicationService): # pragma: no cover 32 | """DBU Application service for gRPC communication with the Geometry server. 33 | 34 | This class provides methods to interact with the Geometry server's 35 | DBU Application service. It is specifically designed for the v1 version 36 | of the Geometry API. 37 | 38 | Parameters 39 | ---------- 40 | channel : grpc.Channel 41 | The gRPC channel to the server. 42 | """ 43 | 44 | @protect_grpc 45 | def __init__(self, channel: grpc.Channel): # noqa: D102 46 | from ansys.api.dbu.v1.dbuapplication_pb2_grpc import DbuApplicationStub 47 | 48 | self.stub = DbuApplicationStub(channel) 49 | 50 | @protect_grpc 51 | def run_script(self, **kwargs) -> dict: # noqa: D102 52 | raise NotImplementedError 53 | -------------------------------------------------------------------------------- /src/ansys/geometry/core/_grpc/_services/v1/driving_dimensions.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | """Module containing the Driving Dimension service implementation for v1.""" 23 | 24 | import grpc 25 | 26 | from ansys.geometry.core.errors import protect_grpc 27 | 28 | from ..base.driving_dimensions import GRPCDrivingDimensionsService 29 | 30 | 31 | class GRPCDrivingDimensionsServiceV1(GRPCDrivingDimensionsService): # pragma: no cover 32 | """Driving Dimensions service for gRPC communication with the Geometry server. 33 | 34 | This class provides methods to interact with the Geometry server's 35 | Driving Dimensions service. It is specifically designed for the v1 version 36 | of the Geometry API. 37 | 38 | Parameters 39 | ---------- 40 | channel : grpc.Channel 41 | The gRPC channel to the server. 42 | """ 43 | 44 | @protect_grpc 45 | def __init__(self, channel: grpc.Channel): # noqa: D102 46 | from ansys.api.geometry.v1.drivingdimensions_pb2_grpc import DrivingDimensionsStub 47 | 48 | self.stub = DrivingDimensionsStub(channel) 49 | 50 | @protect_grpc 51 | def get_all_parameters(self, **kwargs) -> dict: # noqa: D102 52 | raise NotImplementedError 53 | 54 | @protect_grpc 55 | def set_parameter(self, **kwargs) -> dict: # noqa: D102 56 | raise NotImplementedError 57 | -------------------------------------------------------------------------------- /src/ansys/geometry/core/_grpc/_services/v1/edges.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | """Module containing the edges service implementation for v1.""" 23 | 24 | import grpc 25 | 26 | from ansys.geometry.core.errors import protect_grpc 27 | 28 | from ..base.edges import GRPCEdgesService 29 | 30 | 31 | class GRPCEdgesServiceV1(GRPCEdgesService): # pragma: no cover 32 | """Edges service for gRPC communication with the Geometry server. 33 | 34 | This class provides methods to interact with the Geometry server's 35 | edges service. It is specifically designed for the v1 version of the 36 | Geometry API. 37 | 38 | Parameters 39 | ---------- 40 | channel : grpc.Channel 41 | The gRPC channel to the server. 42 | """ 43 | 44 | @protect_grpc 45 | def __init__(self, channel: grpc.Channel): # noqa: D102 46 | from ansys.api.geometry.v1.edges_pb2_grpc import EdgesStub 47 | 48 | self.stub = EdgesStub(channel) 49 | 50 | @protect_grpc 51 | def get_edge(self, **kwargs) -> dict: # noqa: D102 52 | return NotImplementedError 53 | 54 | @protect_grpc 55 | def get_curve(self, **kwargs) -> dict: # noqa: D102 56 | return NotImplementedError 57 | 58 | @protect_grpc 59 | def get_start_and_end_points(self, **kwargs) -> dict: # noqa: D102 60 | return NotImplementedError 61 | 62 | @protect_grpc 63 | def get_length(self, **kwargs) -> dict: # noqa: D102 64 | return NotImplementedError 65 | 66 | @protect_grpc 67 | def get_interval(self, **kwargs) -> dict: # noqa: D102 68 | return NotImplementedError 69 | 70 | @protect_grpc 71 | def get_faces(self, **kwargs) -> dict: # noqa: D102 72 | return NotImplementedError 73 | 74 | @protect_grpc 75 | def get_bounding_box(self, **kwargs) -> dict: # noqa: D102 76 | return NotImplementedError 77 | -------------------------------------------------------------------------------- /src/ansys/geometry/core/_grpc/_services/v1/materials.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | """Module containing the materials service implementation for v1.""" 23 | 24 | import grpc 25 | 26 | from ansys.geometry.core.errors import protect_grpc 27 | 28 | from ..base.materials import GRPCMaterialsService 29 | 30 | 31 | class GRPCMaterialsServiceV1(GRPCMaterialsService): # pragma: no cover 32 | """Materials service for gRPC communication with the Geometry server. 33 | 34 | This class provides methods to interact with the Geometry server's 35 | materials service. It is specifically designed for the v1 version of the 36 | Geometry API. 37 | 38 | Parameters 39 | ---------- 40 | channel : grpc.Channel 41 | The gRPC channel to the server. 42 | """ 43 | 44 | @protect_grpc 45 | def __init__(self, channel: grpc.Channel): # noqa: D102 46 | from ansys.api.geometry.v1.materials_pb2_grpc import MaterialsStub 47 | 48 | self.stub = MaterialsStub(channel) 49 | 50 | @protect_grpc 51 | def add_material(self, **kwargs) -> dict: # noqa: D102 52 | raise NotImplementedError 53 | -------------------------------------------------------------------------------- /src/ansys/geometry/core/_grpc/_services/v1/measurement_tools.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | """Module containing the measurement tools service implementation for v0.""" 23 | 24 | import grpc 25 | 26 | from ansys.geometry.core.errors import protect_grpc 27 | 28 | from ..base.measurement_tools import GRPCMeasurementToolsService 29 | 30 | 31 | class GRPCMeasurementToolsServiceV1(GRPCMeasurementToolsService): # pragma: no cover 32 | """Measurement tools service for gRPC communication with the Geometry server. 33 | 34 | This class provides methods to interact with the Geometry server's 35 | measurement tools service. It is specifically designed for the v0 version of the 36 | Geometry API. 37 | 38 | Parameters 39 | ---------- 40 | channel : grpc.Channel 41 | The gRPC channel to the server. 42 | """ 43 | 44 | @protect_grpc 45 | def __init__(self, channel: grpc.Channel): # noqa: D102 46 | from ansys.api.geometry.v1.measuretools_pb2_grpc import MeasureToolsStub 47 | 48 | self.stub = MeasureToolsStub(channel) 49 | 50 | @protect_grpc 51 | def min_distance_between_objects(self, **kwargs) -> dict: # noqa: D102 52 | raise NotImplementedError 53 | -------------------------------------------------------------------------------- /src/ansys/geometry/core/_grpc/_services/v1/named_selection.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | """Module containing the Named Selection service implementation for v1.""" 23 | 24 | import grpc 25 | 26 | from ansys.geometry.core.errors import protect_grpc 27 | 28 | from ..base.named_selection import GRPCNamedSelectionService 29 | 30 | 31 | class GRPCNamedSelectionServiceV1(GRPCNamedSelectionService): # pragma: no cover 32 | """Named Selection service for gRPC communication with the Geometry server. 33 | 34 | This class provides methods to interact with the Geometry server's 35 | Named Selection service. It is specifically designed for the v1 version 36 | of the Geometry API. 37 | 38 | Parameters 39 | ---------- 40 | channel : grpc.Channel 41 | The gRPC channel to the server. 42 | """ 43 | 44 | @protect_grpc 45 | def __init__(self, channel: grpc.Channel): # noqa: D102 46 | from ansys.api.geometry.v1.namedselections_pb2_grpc import NamedSelectionsStub 47 | 48 | self.stub = NamedSelectionsStub(channel) 49 | 50 | @protect_grpc 51 | def get_named_selection(self, **kwargs): # noqa: D102 52 | raise NotImplementedError 53 | 54 | @protect_grpc 55 | def create_named_selection(self, **kwargs): # noqa: D102 56 | raise NotImplementedError 57 | 58 | @protect_grpc 59 | def delete_named_selection(self, **kwargs): # noqa: D102 60 | raise NotImplementedError 61 | -------------------------------------------------------------------------------- /src/ansys/geometry/core/_grpc/_services/v1/parts.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | """Module containing the parts service implementation for v1.""" 23 | 24 | import grpc 25 | 26 | from ansys.geometry.core.errors import protect_grpc 27 | 28 | from ..base.parts import GRPCPartsService 29 | 30 | 31 | class GRPCPartsServiceV1(GRPCPartsService): # pragma: no cover 32 | """Parts service for gRPC communication with the Geometry server. 33 | 34 | This class provides methods to interact with the Geometry server's 35 | parts service. It is specifically designed for the v1 version of the 36 | Geometry API. 37 | 38 | Parameters 39 | ---------- 40 | channel : grpc.Channel 41 | The gRPC channel to the server. 42 | """ 43 | 44 | @protect_grpc 45 | def __init__(self, channel: grpc.Channel): # noqa: D102 46 | from ansys.api.geometry.v1.parts_pb2_grpc import PartsStub 47 | 48 | self.stub = PartsStub(channel) 49 | 50 | @protect_grpc 51 | def export(self, **kwargs) -> dict: # noqa: D102 52 | raise NotImplementedError 53 | -------------------------------------------------------------------------------- /src/ansys/geometry/core/connection/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | """PyAnsys Geometry connection subpackage.""" 23 | 24 | from ansys.geometry.core.connection.backend import ApiVersions, BackendType 25 | from ansys.geometry.core.connection.client import GrpcClient 26 | from ansys.geometry.core.connection.conversions import ( 27 | curve_to_grpc_curve, 28 | frame_to_grpc_frame, 29 | grpc_curve_to_curve, 30 | grpc_frame_to_frame, 31 | grpc_matrix_to_matrix, 32 | grpc_surface_to_surface, 33 | line_to_grpc_line, 34 | plane_to_grpc_plane, 35 | point3d_to_grpc_point, 36 | sketch_shapes_to_grpc_geometries, 37 | trimmed_curve_to_grpc_trimmed_curve, 38 | unit_vector_to_grpc_direction, 39 | ) 40 | import ansys.geometry.core.connection.defaults as defaults 41 | from ansys.geometry.core.connection.docker_instance import ( 42 | GeometryContainers, 43 | LocalDockerInstance, 44 | get_geometry_container_type, 45 | ) 46 | from ansys.geometry.core.connection.launcher import ( 47 | launch_docker_modeler, 48 | launch_modeler, 49 | launch_modeler_with_core_service, 50 | launch_modeler_with_discovery, 51 | launch_modeler_with_discovery_and_pimlight, 52 | launch_modeler_with_geometry_service, 53 | launch_modeler_with_geometry_service_and_pimlight, 54 | launch_modeler_with_spaceclaim, 55 | launch_modeler_with_spaceclaim_and_pimlight, 56 | launch_remote_modeler, 57 | ) 58 | from ansys.geometry.core.connection.product_instance import ProductInstance 59 | -------------------------------------------------------------------------------- /src/ansys/geometry/core/connection/defaults.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | """Module providing default connection parameters.""" 23 | 24 | import os 25 | from pathlib import Path 26 | 27 | DEFAULT_HOST = os.environ.get("ANSRV_GEO_HOST", "127.0.0.1") 28 | """Default for the HOST name. 29 | 30 | By default, PyAnsys Geometry searches for the environment variable ``ANSRV_GEO_HOST``, 31 | and if this variable does not exist, PyAnsys Geometry uses ``127.0.0.1`` as the host. 32 | """ 33 | 34 | DEFAULT_PORT: int = int(os.environ.get("ANSRV_GEO_PORT", 50051)) 35 | """Default for the HOST port. 36 | 37 | By default, PyAnsys Geometry searches for the environment variable ``ANSRV_GEO_PORT``, 38 | and if this variable does not exist, PyAnsys Geometry uses ``50051`` as the port. 39 | """ 40 | 41 | MAX_MESSAGE_LENGTH = int(os.environ.get("PYGEOMETRY_MAX_MESSAGE_LENGTH", 256 * 1024**2)) 42 | """Default for the gRPC maximum message length. 43 | 44 | By default, PyAnsys Geometry searches for the environment variable 45 | ``PYGEOMETRY_MAX_MESSAGE_LENGTH``, and if this variable does not exist, 46 | it uses ``256Mb`` as the maximum message length. 47 | """ 48 | 49 | GEOMETRY_SERVICE_DOCKER_IMAGE = "ghcr.io/ansys/geometry" 50 | """Default for the Geometry service Docker image location. 51 | 52 | Tag is dependent on what OS service is requested. 53 | """ 54 | 55 | DEFAULT_PIM_CONFIG = Path(__file__).parent / "pim_configuration.json" 56 | """Default for the PIM configuration when running PIM Light. 57 | 58 | This parameter is only to be used when PIM Light is being run. 59 | """ 60 | -------------------------------------------------------------------------------- /src/ansys/geometry/core/connection/pim_configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "pim": { 4 | "uri": "dns:localhost:5000", 5 | "headers": { 6 | "metadata-info": "value" 7 | }, 8 | "tls": false 9 | } 10 | } -------------------------------------------------------------------------------- /src/ansys/geometry/core/connection/validate.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | """Module to perform a connection validation check. 23 | 24 | The method in this module is only used for testing the default Docker service on 25 | GitHub and can safely be skipped within testing. 26 | 27 | This command shows how this method is typically used: 28 | 29 | .. code:: bash 30 | 31 | python -c "from ansys.geometry.core.connection import validate; validate()" 32 | """ 33 | 34 | from ansys.geometry.core.connection.client import GrpcClient 35 | 36 | 37 | def validate(*args, **kwargs): # pragma: no cover 38 | """Create a client using the default settings and validate it.""" 39 | print(GrpcClient(*args, **kwargs)) 40 | # TODO: consider adding additional server stat reporting 41 | # https://github.com/ansys/pyansys-geometry/issues/1319 42 | -------------------------------------------------------------------------------- /src/ansys/geometry/core/designer/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | """PyAnsys Geometry designer subpackage.""" 23 | 24 | from ansys.geometry.core.designer.body import Body, MasterBody, MidSurfaceOffsetType 25 | from ansys.geometry.core.designer.component import Component, ExtrusionDirection, SharedTopologyType 26 | from ansys.geometry.core.designer.design import Design, DesignFileFormat 27 | from ansys.geometry.core.designer.designpoint import DesignPoint 28 | from ansys.geometry.core.designer.edge import CurveType, Edge 29 | from ansys.geometry.core.designer.face import Face, SurfaceType 30 | from ansys.geometry.core.designer.geometry_commands import ExtrudeType, OffsetMode 31 | from ansys.geometry.core.designer.part import MasterComponent, Part 32 | from ansys.geometry.core.designer.selection import NamedSelection 33 | -------------------------------------------------------------------------------- /src/ansys/geometry/core/materials/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | """PyAnsys Geometry materials subpackage.""" 23 | 24 | from ansys.geometry.core.materials.material import Material 25 | from ansys.geometry.core.materials.property import MaterialProperty, MaterialPropertyType 26 | -------------------------------------------------------------------------------- /src/ansys/geometry/core/math/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | """PyAnsys Geometry math subpackage.""" 23 | 24 | from ansys.geometry.core.math.bbox import BoundingBox, BoundingBox2D 25 | from ansys.geometry.core.math.constants import ( 26 | DEFAULT_POINT2D, 27 | DEFAULT_POINT3D, 28 | IDENTITY_MATRIX33, 29 | IDENTITY_MATRIX44, 30 | UNITVECTOR2D_X, 31 | UNITVECTOR2D_Y, 32 | UNITVECTOR3D_X, 33 | UNITVECTOR3D_Y, 34 | UNITVECTOR3D_Z, 35 | ZERO_POINT2D, 36 | ZERO_POINT3D, 37 | ZERO_VECTOR2D, 38 | ZERO_VECTOR3D, 39 | ) 40 | from ansys.geometry.core.math.frame import Frame 41 | from ansys.geometry.core.math.matrix import Matrix, Matrix33, Matrix44 42 | from ansys.geometry.core.math.misc import get_two_circle_intersections 43 | from ansys.geometry.core.math.plane import Plane 44 | from ansys.geometry.core.math.point import Point2D, Point3D 45 | from ansys.geometry.core.math.vector import UnitVector2D, UnitVector3D, Vector2D, Vector3D 46 | -------------------------------------------------------------------------------- /src/ansys/geometry/core/misc/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | """Provides the PyAnsys Geometry miscellaneous subpackage.""" 23 | 24 | from ansys.geometry.core.misc.accuracy import ANGLE_ACCURACY, LENGTH_ACCURACY, Accuracy 25 | from ansys.geometry.core.misc.auxiliary import ( 26 | DEFAULT_COLOR, 27 | get_bodies_from_ids, 28 | get_design_from_body, 29 | get_design_from_component, 30 | get_design_from_edge, 31 | get_design_from_face, 32 | get_edges_from_ids, 33 | get_faces_from_ids, 34 | ) 35 | from ansys.geometry.core.misc.checks import ( 36 | check_is_float_int, 37 | check_ndarray_is_all_nan, 38 | check_ndarray_is_float_int, 39 | check_ndarray_is_non_zero, 40 | check_ndarray_is_not_none, 41 | check_pint_unit_compatibility, 42 | check_type, 43 | check_type_all_elements_in_iterable, 44 | check_type_equivalence, 45 | deprecated_argument, 46 | deprecated_method, 47 | graphics_required, 48 | min_backend_version, 49 | run_if_graphics_required, 50 | ) 51 | from ansys.geometry.core.misc.measurements import DEFAULT_UNITS, Angle, Distance 52 | from ansys.geometry.core.misc.options import ImportOptions, TessellationOptions 53 | from ansys.geometry.core.misc.units import UNITS, PhysicalQuantity 54 | -------------------------------------------------------------------------------- /src/ansys/geometry/core/parameters/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | """PyAnsys Geometry parameters subpackage.""" 23 | 24 | from ansys.geometry.core.parameters.parameter import Parameter, ParameterType 25 | -------------------------------------------------------------------------------- /src/ansys/geometry/core/plotting/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | """Provides the PyAnsys Geometry plotting subpackage.""" 23 | 24 | from ansys.geometry.core.plotting.plotter import GeometryPlotter 25 | -------------------------------------------------------------------------------- /src/ansys/geometry/core/plotting/widgets/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | """Submodule providing widgets for the PyAnsys Geometry plotter.""" 23 | 24 | from ansys.geometry.core.plotting.widgets.show_design_point import ShowDesignPoints 25 | -------------------------------------------------------------------------------- /src/ansys/geometry/core/plotting/widgets/_images/+xy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/src/ansys/geometry/core/plotting/widgets/_images/+xy.png -------------------------------------------------------------------------------- /src/ansys/geometry/core/plotting/widgets/_images/+xz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/src/ansys/geometry/core/plotting/widgets/_images/+xz.png -------------------------------------------------------------------------------- /src/ansys/geometry/core/plotting/widgets/_images/+yz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/src/ansys/geometry/core/plotting/widgets/_images/+yz.png -------------------------------------------------------------------------------- /src/ansys/geometry/core/plotting/widgets/_images/-xy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/src/ansys/geometry/core/plotting/widgets/_images/-xy.png -------------------------------------------------------------------------------- /src/ansys/geometry/core/plotting/widgets/_images/-xz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/src/ansys/geometry/core/plotting/widgets/_images/-xz.png -------------------------------------------------------------------------------- /src/ansys/geometry/core/plotting/widgets/_images/-yz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/src/ansys/geometry/core/plotting/widgets/_images/-yz.png -------------------------------------------------------------------------------- /src/ansys/geometry/core/plotting/widgets/_images/designpoint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/src/ansys/geometry/core/plotting/widgets/_images/designpoint.png -------------------------------------------------------------------------------- /src/ansys/geometry/core/plotting/widgets/_images/downarrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/src/ansys/geometry/core/plotting/widgets/_images/downarrow.png -------------------------------------------------------------------------------- /src/ansys/geometry/core/plotting/widgets/_images/isometric.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/src/ansys/geometry/core/plotting/widgets/_images/isometric.png -------------------------------------------------------------------------------- /src/ansys/geometry/core/plotting/widgets/_images/measurement.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/src/ansys/geometry/core/plotting/widgets/_images/measurement.png -------------------------------------------------------------------------------- /src/ansys/geometry/core/plotting/widgets/_images/ruler.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/src/ansys/geometry/core/plotting/widgets/_images/ruler.png -------------------------------------------------------------------------------- /src/ansys/geometry/core/plotting/widgets/_images/upxarrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/src/ansys/geometry/core/plotting/widgets/_images/upxarrow.png -------------------------------------------------------------------------------- /src/ansys/geometry/core/plotting/widgets/_images/upyarrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/src/ansys/geometry/core/plotting/widgets/_images/upyarrow.png -------------------------------------------------------------------------------- /src/ansys/geometry/core/plotting/widgets/_images/upzarrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/src/ansys/geometry/core/plotting/widgets/_images/upzarrow.png -------------------------------------------------------------------------------- /src/ansys/geometry/core/shapes/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | """Provides the PyAnsys Geometry ``geometry`` subpackage.""" 23 | 24 | from ansys.geometry.core.shapes.curves.circle import Circle, CircleEvaluation 25 | from ansys.geometry.core.shapes.curves.curve import Curve 26 | from ansys.geometry.core.shapes.curves.ellipse import Ellipse, EllipseEvaluation 27 | from ansys.geometry.core.shapes.curves.line import Line, LineEvaluation 28 | from ansys.geometry.core.shapes.curves.nurbs import NURBSCurve, NURBSCurveEvaluation 29 | from ansys.geometry.core.shapes.parameterization import ( 30 | Interval, 31 | Parameterization, 32 | ParamForm, 33 | ParamType, 34 | ParamUV, 35 | ) 36 | from ansys.geometry.core.shapes.surfaces.cone import Cone, ConeEvaluation 37 | from ansys.geometry.core.shapes.surfaces.cylinder import Cylinder, CylinderEvaluation 38 | from ansys.geometry.core.shapes.surfaces.plane import PlaneEvaluation, PlaneSurface 39 | from ansys.geometry.core.shapes.surfaces.sphere import Sphere, SphereEvaluation 40 | from ansys.geometry.core.shapes.surfaces.surface import Surface 41 | from ansys.geometry.core.shapes.surfaces.surface_evaluation import SurfaceEvaluation 42 | from ansys.geometry.core.shapes.surfaces.torus import Torus 43 | from ansys.geometry.core.shapes.surfaces.trimmed_surface import TrimmedSurface 44 | -------------------------------------------------------------------------------- /src/ansys/geometry/core/shapes/curves/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | """Provides the PyAnsys Geometry ``curves`` subpackage.""" 23 | 24 | from ansys.geometry.core.shapes.curves.circle import Circle, CircleEvaluation 25 | from ansys.geometry.core.shapes.curves.curve import Curve 26 | from ansys.geometry.core.shapes.curves.curve_evaluation import CurveEvaluation 27 | from ansys.geometry.core.shapes.curves.ellipse import Ellipse, EllipseEvaluation 28 | from ansys.geometry.core.shapes.curves.line import Line, LineEvaluation 29 | from ansys.geometry.core.shapes.curves.nurbs import NURBSCurve, NURBSCurveEvaluation 30 | -------------------------------------------------------------------------------- /src/ansys/geometry/core/shapes/curves/curve_evaluation.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | """Provides for creating and managing a curve.""" 23 | 24 | from functools import cached_property 25 | 26 | from ansys.geometry.core.math.point import Point3D 27 | from ansys.geometry.core.math.vector import Vector3D 28 | from ansys.geometry.core.typing import Real 29 | 30 | 31 | class CurveEvaluation: 32 | """Provides for evaluating a curve.""" 33 | 34 | def __init__(self, parameter: Real = None) -> None: 35 | """Initialize the ``CurveEvaluation`` class.""" 36 | self._parameter = parameter 37 | 38 | def is_set(self) -> bool: 39 | """Determine if the parameter for the evaluation has been set.""" 40 | return self._parameter is not None 41 | 42 | @property 43 | def parameter(self) -> Real: 44 | """Parameter that the evaluation is based upon.""" 45 | raise NotImplementedError("Each evaluation must provide the parameter definition.") 46 | 47 | @cached_property 48 | def position(self) -> Point3D: 49 | """Position of the evaluation.""" 50 | raise NotImplementedError("Each evaluation must provide the position definition.") 51 | 52 | @cached_property 53 | def first_derivative(self) -> Vector3D: 54 | """First derivative of the evaluation.""" 55 | raise NotImplementedError("Each evaluation must provide the first_derivative definition.") 56 | 57 | @cached_property 58 | def second_derivative(self) -> Vector3D: 59 | """Second derivative of the evaluation.""" 60 | raise NotImplementedError("Each evaluation must provide the second_derivative definition.") 61 | 62 | @cached_property 63 | def curvature(self) -> Real: 64 | """Curvature of the evaluation.""" 65 | raise NotImplementedError("Each evaluation must provide the curvature definition.") 66 | -------------------------------------------------------------------------------- /src/ansys/geometry/core/shapes/surfaces/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | """Provides the PyAnsys Geometry ``surface`` subpackage.""" 23 | 24 | from ansys.geometry.core.shapes.surfaces.cone import Cone, ConeEvaluation 25 | from ansys.geometry.core.shapes.surfaces.cylinder import Cylinder, CylinderEvaluation 26 | from ansys.geometry.core.shapes.surfaces.plane import PlaneEvaluation, PlaneSurface 27 | from ansys.geometry.core.shapes.surfaces.sphere import Sphere, SphereEvaluation 28 | from ansys.geometry.core.shapes.surfaces.surface import Surface 29 | from ansys.geometry.core.shapes.surfaces.surface_evaluation import SurfaceEvaluation 30 | from ansys.geometry.core.shapes.surfaces.torus import Torus 31 | from ansys.geometry.core.shapes.surfaces.trimmed_surface import TrimmedSurface 32 | -------------------------------------------------------------------------------- /src/ansys/geometry/core/sketch/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | """PyAnsys Geometry sketch subpackage.""" 23 | 24 | from ansys.geometry.core.sketch.arc import Arc 25 | from ansys.geometry.core.sketch.box import Box 26 | from ansys.geometry.core.sketch.circle import SketchCircle 27 | from ansys.geometry.core.sketch.edge import SketchEdge 28 | from ansys.geometry.core.sketch.ellipse import SketchEllipse 29 | from ansys.geometry.core.sketch.face import SketchFace 30 | from ansys.geometry.core.sketch.gears import DummyGear 31 | from ansys.geometry.core.sketch.polygon import Polygon 32 | from ansys.geometry.core.sketch.segment import SketchSegment 33 | from ansys.geometry.core.sketch.sketch import Sketch 34 | from ansys.geometry.core.sketch.slot import Slot 35 | from ansys.geometry.core.sketch.trapezoid import Trapezoid 36 | from ansys.geometry.core.sketch.triangle import Triangle 37 | -------------------------------------------------------------------------------- /src/ansys/geometry/core/tools/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | """PyAnsys Geometry tools subpackage.""" 23 | 24 | from ansys.geometry.core.tools.measurement_tools import MeasurementTools 25 | from ansys.geometry.core.tools.prepare_tools import PrepareTools 26 | from ansys.geometry.core.tools.problem_areas import ( 27 | DuplicateFaceProblemAreas, 28 | ExtraEdgeProblemAreas, 29 | InexactEdgeProblemAreas, 30 | ) 31 | from ansys.geometry.core.tools.repair_tool_message import RepairToolMessage 32 | from ansys.geometry.core.tools.repair_tools import RepairTools 33 | from ansys.geometry.core.tools.unsupported import PersistentIdType, UnsupportedCommands 34 | -------------------------------------------------------------------------------- /src/ansys/geometry/core/typing.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | """Provides typing of values for PyAnsys Geometry.""" 23 | 24 | from collections.abc import Sequence 25 | 26 | import numpy as np 27 | 28 | Real = int | float | np.integer | np.floating 29 | """Type used to refer to both integers and floats as possible values.""" 30 | 31 | RealSequence = np.ndarray | Sequence[Real] 32 | """Type used to refer to ``Real`` types as a ``Sequence`` type. 33 | 34 | Notes 35 | ----- 36 | :class:`numpy.ndarrays ` are also accepted because they are 37 | the overlaying data structure behind most PyAnsys Geometry objects. 38 | """ 39 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | -------------------------------------------------------------------------------- /tests/integration/README.md: -------------------------------------------------------------------------------- 1 | ### Integration tests 2 | 3 | These tests verify client/server interaction. 4 | -------------------------------------------------------------------------------- /tests/integration/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | -------------------------------------------------------------------------------- /tests/integration/files/BoxWithRound.scdocx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/BoxWithRound.scdocx -------------------------------------------------------------------------------- /tests/integration/files/DuplicateFaces.scdocx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/DuplicateFaces.scdocx -------------------------------------------------------------------------------- /tests/integration/files/DuplicateFacesDesignBefore.scdocx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/DuplicateFacesDesignBefore.scdocx -------------------------------------------------------------------------------- /tests/integration/files/Edge_Slice_Test.dsco: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/Edge_Slice_Test.dsco -------------------------------------------------------------------------------- /tests/integration/files/ExtraEdges.scdocx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/ExtraEdges.scdocx -------------------------------------------------------------------------------- /tests/integration/files/ExtraEdgesDesignBefore.scdocx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/ExtraEdgesDesignBefore.scdocx -------------------------------------------------------------------------------- /tests/integration/files/ExtraEdges_NoComponents.scdocx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/ExtraEdges_NoComponents.scdocx -------------------------------------------------------------------------------- /tests/integration/files/Fan_OneBlade_CircularPatter.scdocx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/Fan_OneBlade_CircularPatter.scdocx -------------------------------------------------------------------------------- /tests/integration/files/FillPattern.scdocx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/FillPattern.scdocx -------------------------------------------------------------------------------- /tests/integration/files/FillPatternUpdate.scdocx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/FillPatternUpdate.scdocx -------------------------------------------------------------------------------- /tests/integration/files/InExactEdgesBefore.scdocx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/InExactEdgesBefore.scdocx -------------------------------------------------------------------------------- /tests/integration/files/InspectAndRepair01.scdocx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/InspectAndRepair01.scdocx -------------------------------------------------------------------------------- /tests/integration/files/LinearPatterns.scdocx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/LinearPatterns.scdocx -------------------------------------------------------------------------------- /tests/integration/files/LinearPatternsModify.scdocx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/LinearPatternsModify.scdocx -------------------------------------------------------------------------------- /tests/integration/files/MissingFaces.scdocx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/MissingFaces.scdocx -------------------------------------------------------------------------------- /tests/integration/files/MissingFacesDesignBefore.scdocx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/MissingFacesDesignBefore.scdocx -------------------------------------------------------------------------------- /tests/integration/files/MixingTank.scdocx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/MixingTank.scdocx -------------------------------------------------------------------------------- /tests/integration/files/NamedSelectionImport.scdocx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/NamedSelectionImport.scdocx -------------------------------------------------------------------------------- /tests/integration/files/SOBracket2.scdocx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/SOBracket2.scdocx -------------------------------------------------------------------------------- /tests/integration/files/SOBracket2_HalfModel.scdocx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/SOBracket2_HalfModel.scdocx -------------------------------------------------------------------------------- /tests/integration/files/ShortEdges.scdocx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/ShortEdges.scdocx -------------------------------------------------------------------------------- /tests/integration/files/ShortEdgesBefore.scdocx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/ShortEdgesBefore.scdocx -------------------------------------------------------------------------------- /tests/integration/files/SimpleInterference.scdocx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/SimpleInterference.scdocx -------------------------------------------------------------------------------- /tests/integration/files/SmallFaces.scdocx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/SmallFaces.scdocx -------------------------------------------------------------------------------- /tests/integration/files/SmallFacesBefore.scdocx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/SmallFacesBefore.scdocx -------------------------------------------------------------------------------- /tests/integration/files/SplitEdgeDesignTest.scdocx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/SplitEdgeDesignTest.scdocx -------------------------------------------------------------------------------- /tests/integration/files/Stitch_And_MissingFaces.scdocx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/Stitch_And_MissingFaces.scdocx -------------------------------------------------------------------------------- /tests/integration/files/blockswithparameters.dsco: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/blockswithparameters.dsco -------------------------------------------------------------------------------- /tests/integration/files/bracket-with-split-edges.scdocx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/bracket-with-split-edges.scdocx -------------------------------------------------------------------------------- /tests/integration/files/disco_scripts/failing_script.py: -------------------------------------------------------------------------------- 1 | # Python Discovery Script 2 | doc = Document.Create() 3 | 4 | sphere = Sphere.Create(Frame.Create(Point.Create(0,0,0), Direction.Create(1,0,0), Direction.Create(0,1,0)), 1) 5 | u_range = Interval.Create(0, 2*math.pi) 6 | v_range = Interval.Create(-math.pi/2, math.pi/2) 7 | box = BoxUV.Create(u_range, v_range) 8 | import numpy as np 9 | b = Body.CreateSurfaceBody(sphere, box) 10 | db = DesignBody.Create(doc.MainPart, "sphere", b) 11 | 12 | result = {"design": doc, "design_body": db} 13 | -------------------------------------------------------------------------------- /tests/integration/files/disco_scripts/integrated_script.py: -------------------------------------------------------------------------------- 1 | doc = GetActiveDocument() 2 | radius = MM(int(argsDict["radius"])) 3 | 4 | sphere = Sphere.Create(Frame.World, radius) 5 | u_range = Interval.Create(0, 2 * math.pi) 6 | v_range = Interval.Create(-math.pi / 2, math.pi / 2) 7 | box = BoxUV.Create(u_range, v_range) 8 | b = Body.CreateSurfaceBody(sphere, box) 9 | db = DesignBody.Create(doc.MainPart, "sphere", b) 10 | 11 | numBodies = doc.MainPart.Bodies.Count 12 | 13 | result = {"numBodies": numBodies} -------------------------------------------------------------------------------- /tests/integration/files/disco_scripts/simple_script.dscript: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/disco_scripts/simple_script.dscript -------------------------------------------------------------------------------- /tests/integration/files/disco_scripts/simple_script.py: -------------------------------------------------------------------------------- 1 | # Python Discovery Script 2 | import math 3 | 4 | doc = Document.Create() 5 | 6 | sphere = Sphere.Create( 7 | Frame.Create(Point.Create(0, 0, 0), Direction.Create(1, 0, 0), Direction.Create(0, 1, 0)), 1 8 | ) 9 | u_range = Interval.Create(0, 2 * math.pi) 10 | v_range = Interval.Create(-math.pi / 2, math.pi / 2) 11 | box = BoxUV.Create(u_range, v_range) 12 | b = Body.CreateSurfaceBody(sphere, box) 13 | db = DesignBody.Create(doc.MainPart, "sphere", b) 14 | 15 | result = {"design": doc, "design_body": db} 16 | -------------------------------------------------------------------------------- /tests/integration/files/disco_scripts/simple_script.scscript: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/disco_scripts/simple_script.scscript -------------------------------------------------------------------------------- /tests/integration/files/gear.scdocx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/gear.scdocx -------------------------------------------------------------------------------- /tests/integration/files/hollowCylinder.scdocx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/hollowCylinder.scdocx -------------------------------------------------------------------------------- /tests/integration/files/import/ACAD/CylinderBox_2024.dwg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/import/ACAD/CylinderBox_2024.dwg -------------------------------------------------------------------------------- /tests/integration/files/import/CAT5/Bracket_Hole_2024.CATPart: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/import/CAT5/Bracket_Hole_2024.CATPart -------------------------------------------------------------------------------- /tests/integration/files/import/CAT6/Skateboard A.1_2023x.3dxml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/import/CAT6/Skateboard A.1_2023x.3dxml -------------------------------------------------------------------------------- /tests/integration/files/import/Creo/rearwheel_creo11.prt.2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/import/Creo/rearwheel_creo11.prt.2 -------------------------------------------------------------------------------- /tests/integration/files/import/Inventor/ai_param_dsdm_part1_2026.ipt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/import/Inventor/ai_param_dsdm_part1_2026.ipt -------------------------------------------------------------------------------- /tests/integration/files/import/JT/assly_sub-assly_asso.jt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/import/JT/assly_sub-assly_asso.jt -------------------------------------------------------------------------------- /tests/integration/files/import/NX/base_plate_2412.prt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/import/NX/base_plate_2412.prt -------------------------------------------------------------------------------- /tests/integration/files/import/Rhino/box.3dm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/import/Rhino/box.3dm -------------------------------------------------------------------------------- /tests/integration/files/import/SOLIDWORKS/Base_Plate.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/import/SOLIDWORKS/Base_Plate.SLDPRT -------------------------------------------------------------------------------- /tests/integration/files/import/SolidEdge/L_Solid_2025.par: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/import/SolidEdge/L_Solid_2025.par -------------------------------------------------------------------------------- /tests/integration/files/import/Tank_Bottom.par: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/import/Tank_Bottom.par -------------------------------------------------------------------------------- /tests/integration/files/import/box.3dm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/import/box.3dm -------------------------------------------------------------------------------- /tests/integration/files/import/catia_car/A.CATPart: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/import/catia_car/A.CATPart -------------------------------------------------------------------------------- /tests/integration/files/import/catia_car/B.CATProduct: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/import/catia_car/B.CATProduct -------------------------------------------------------------------------------- /tests/integration/files/import/catia_car/Base.CATPart: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/import/catia_car/Base.CATPart -------------------------------------------------------------------------------- /tests/integration/files/import/catia_car/Car1.CATProduct: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/import/catia_car/Car1.CATProduct -------------------------------------------------------------------------------- /tests/integration/files/import/catia_car/Wheel1.CATPart: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/import/catia_car/Wheel1.CATPart -------------------------------------------------------------------------------- /tests/integration/files/import/catia_car/car.CATProduct: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/import/catia_car/car.CATProduct -------------------------------------------------------------------------------- /tests/integration/files/import/disk1.prt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/import/disk1.prt -------------------------------------------------------------------------------- /tests/integration/files/import/partColor.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/import/partColor.SLDPRT -------------------------------------------------------------------------------- /tests/integration/files/import/sample_box.project: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/import/sample_box.project -------------------------------------------------------------------------------- /tests/integration/files/import/twoCars.stride: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/import/twoCars.stride -------------------------------------------------------------------------------- /tests/integration/files/partWithLogos.scdocx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/partWithLogos.scdocx -------------------------------------------------------------------------------- /tests/integration/files/stitch_before.scdocx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansys/pyansys-geometry/bb8011be9df93a2718a41aa747e07edabc0cf616/tests/integration/files/stitch_before.scdocx -------------------------------------------------------------------------------- /tests/integration/image_cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | !results/ 4 | -------------------------------------------------------------------------------- /tests/integration/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /tests/integration/test_edges.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | """Test edges.""" 23 | 24 | from ansys.geometry.core import Modeler 25 | from ansys.geometry.core.math import Point2D, Vector3D 26 | from ansys.geometry.core.misc.units import UNITS, Quantity 27 | from ansys.geometry.core.sketch import Sketch 28 | 29 | 30 | def test_edges_startend_prism(modeler: Modeler): 31 | # init modeler 32 | design = modeler.create_design("Prism") 33 | 34 | # define body 35 | body_sketch = Sketch() 36 | body_sketch.box(Point2D([10, 10], UNITS.m), Quantity(5, UNITS.m), Quantity(3, UNITS.m)) 37 | prism_body = design.extrude_sketch("JustAPrism", body_sketch, Quantity(13, UNITS.m)) 38 | for edge in prism_body.edges: 39 | vec = Vector3D.from_points(edge.shape.start, edge.shape.end) 40 | assert vec.magnitude == edge.length.magnitude 41 | 42 | 43 | def test_edges_startend_cylinder(modeler: Modeler): 44 | # init modeler 45 | design = modeler.create_design("cylinder") 46 | 47 | # define body 48 | cylinder = Sketch() 49 | cylinder.circle(Point2D([10, 10], UNITS.m), 1.0) 50 | cylinder_body = design.extrude_sketch("JustACyl", cylinder, Quantity(10, UNITS.m)) 51 | for edge in cylinder_body.edges: 52 | assert edge.shape.start == edge.shape.end 53 | -------------------------------------------------------------------------------- /tests/test_metadata.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. 2 | # SPDX-License-Identifier: MIT 3 | # 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | 23 | from ansys.geometry.core import __version__ 24 | 25 | 26 | def test_pkg_version(): 27 | try: 28 | import importlib.metadata as importlib_metadata 29 | except ModuleNotFoundError: # pragma: no cover 30 | import importlib_metadata 31 | 32 | # Read from the pyproject.toml 33 | # major, minor, patch 34 | read_version = importlib_metadata.version("ansys-geometry-core") 35 | 36 | assert __version__ == read_version 37 | -------------------------------------------------------------------------------- /tox.ini: -------------------------------------------------------------------------------- 1 | [tox] 2 | description = Default tox environments list 3 | envlist = 4 | style,{tests310,tests311,tests312,tests313}{,-coverage},doc 5 | skip_missing_interpreters = true 6 | isolated_build = true 7 | isolated_build_env = build 8 | 9 | [testenv] 10 | description = Checks for project unit tests and coverage (if desired) 11 | basepython = 12 | tests310: python3.10 13 | tests311: python3.11 14 | tests312: python3.12 15 | tests313: python3.13 16 | {style,tests,doc}: python3 17 | setenv = 18 | PYTHONUNBUFFERED = yes 19 | coverage: PYTEST_EXTRA_ARGS = --cov=ansys.geometry --cov-report=term --cov-report=xml:.cov/xml --cov-report=html:.cov/html 20 | extras = tests 21 | commands = 22 | pytest {env:PYTEST_MARKERS:} {env:PYTEST_EXTRA_ARGS:} {posargs:-vv} 23 | 24 | [testenv:style] 25 | description = Checks project code style 26 | deps = 27 | pre-commit 28 | commands = 29 | pre-commit install 30 | pre-commit run --all-files --show-diff-on-failure 31 | 32 | [testenv:doc] 33 | description = Check if documentation generates properly 34 | extras = doc 35 | commands = 36 | sphinx-build -d "{toxworkdir}/doc_doctree" doc/source "{toxinidir}/doc/_build/html" --color -vW -bhtml 37 | --------------------------------------------------------------------------------