diff --git a/doc/source/api/tree_objects.rst b/doc/source/api/tree_objects.rst index a4408442c1..582e8e05d6 100644 --- a/doc/source/api/tree_objects.rst +++ b/doc/source/api/tree_objects.rst @@ -12,6 +12,9 @@ ACP objects Stackup ElementSet EdgeSet + CADGeometry + CADComponent + VirtualGeometry Rosette LookUpTable1D LookUpTable1DColumn @@ -21,6 +24,8 @@ ACP objects CylindricalSelectionRule SphericalSelectionRule TubeSelectionRule + CutoffSelectionRule + GeometricalSelectionRule VariableOffsetSelectionRule BooleanSelectionRule OrientedSelectionSet diff --git a/poetry.lock b/poetry.lock index f73d620b08..071e908e5a 100644 --- a/poetry.lock +++ b/poetry.lock @@ -137,13 +137,13 @@ files = [ [[package]] name = "ansys-api-acp" -version = "0.1.0.dev2" +version = "0.1.0.dev3" description = "Autogenerated Python package for the Ansys Composite PrepPost (ACP) gRPC API." optional = false python-versions = ">=3.7" files = [ - {file = "ansys-api-acp-0.1.0.dev2.tar.gz", hash = "sha256:4fb4c73c3b9bdec6c3e4cc1a4de2d84501821ac8650948f279a68515fc0577bb"}, - {file = "ansys_api_acp-0.1.0.dev2-py3-none-any.whl", hash = "sha256:229496451d91514b20217d79cb862b797a46f6a7f8358d81868eeca4455ef2b6"}, + {file = "ansys-api-acp-0.1.0.dev3.tar.gz", hash = "sha256:fe93f1a3c960920bb5a8b0f8be928b618be14618a36733c43590a27849d44794"}, + {file = "ansys_api_acp-0.1.0.dev3-py3-none-any.whl", hash = "sha256:d58524ce83533f8ff92620cbd69a584c8627966d53191e7b0b6b83462ea58565"}, ] [package.dependencies] @@ -369,18 +369,18 @@ tests = ["ansys-mapdl-core (==0.65.2)", "pyansys-tools-report (==0.6.0)", "pytes [[package]] name = "ansys-mechanical-core" -version = "0.10.5" +version = "0.10.6" description = "A python wrapper for Ansys Mechanical" optional = false python-versions = ">=3.9,<4.0" files = [ - {file = "ansys_mechanical_core-0.10.5-py3-none-any.whl", hash = "sha256:d102a9b47c70dac34a4512df9f4adfac157c2712b7ad9051c4ed48d3075c7a60"}, - {file = "ansys_mechanical_core-0.10.5.tar.gz", hash = "sha256:a07185818985275229b9955b9113cc35acafa9506bd3a517b01badcc7eb1a41e"}, + {file = "ansys_mechanical_core-0.10.6-py3-none-any.whl", hash = "sha256:32e2635049c337e47cdf5e8661b850c29affa8ced0e3707cf97d295a50975e70"}, + {file = "ansys_mechanical_core-0.10.6.tar.gz", hash = "sha256:c3568044e1f97285cb75f008d3468489e1e93f50b2e5be66d113cb78c86cba73"}, ] [package.dependencies] ansys_api_mechanical = "0.1.1" -ansys-mechanical-env = ">=0.1.0" +ansys-mechanical-env = "0.1.2" ansys-platform-instancemanagement = ">=1.0.1" ansys-pythonnet = ">=3.1.0rc2" ansys-tools-path = ">=0.3.1" @@ -392,18 +392,18 @@ protobuf = ">=3.12.2" tqdm = ">=4.45.0" [package.extras] -doc = ["Sphinx (==7.2.6)", "ansys-sphinx-theme (==0.12.5)", "grpcio (==1.60.0)", "imageio (==2.33.1)", "imageio-ffmpeg (==0.4.9)", "jupyter_sphinx (==0.4.0)", "jupyterlab (>=3.2.8)", "matplotlib (==3.8.2)", "numpy (==1.26.2)", "numpydoc (==1.6.0)", "pandas (==2.1.4)", "panel (==1.3.4)", "plotly (==5.18.0)", "pypandoc (==1.12)", "pytest-sphinx (==0.5.0)", "pythreejs (==2.4.2)", "pyvista (==0.43.0)", "sphinx-autobuild (==2021.3.14)", "sphinx-autodoc-typehints (==1.25.2)", "sphinx-copybutton (==0.5.2)", "sphinx-gallery (==0.15.0)", "sphinx-notfound-page (==1.0.0)", "sphinx_design (==0.5.0)", "sphinxcontrib-websupport (==1.2.6)", "sphinxemoji (==0.2.0)"] -tests = ["pytest (==7.4.3)", "pytest-cov (==4.1.0)", "pytest-print (==1.0.0)"] +doc = ["Sphinx (==7.2.6)", "ansys-sphinx-theme (==0.13.0)", "grpcio (==1.60.0)", "imageio (==2.33.1)", "imageio-ffmpeg (==0.4.9)", "jupyter_sphinx (==0.5.3)", "jupyterlab (>=3.2.8)", "matplotlib (==3.8.2)", "numpy (==1.26.3)", "numpydoc (==1.6.0)", "pandas (==2.1.4)", "panel (==1.3.6)", "plotly (==5.18.0)", "pypandoc (==1.12)", "pytest-sphinx (==0.5.0)", "pythreejs (==2.4.2)", "pyvista (==0.43.1)", "sphinx-autobuild (==2021.3.14)", "sphinx-autodoc-typehints (==1.25.2)", "sphinx-copybutton (==0.5.2)", "sphinx-gallery (==0.15.0)", "sphinx-notfound-page (==1.0.0)", "sphinx_design (==0.5.0)", "sphinxcontrib-websupport (==1.2.6)", "sphinxemoji (==0.2.0)"] +tests = ["pytest (==7.4.4)", "pytest-cov (==4.1.0)", "pytest-print (==1.0.0)"] [[package]] name = "ansys-mechanical-env" -version = "0.1.0" +version = "0.1.2" description = "A python wrapper for loading environment variables when using PyMechanical embedded instances in Linux." optional = false python-versions = ">3.8,<4" files = [ - {file = "ansys-mechanical-env-0.1.0.tar.gz", hash = "sha256:75c6b9cee393d55c26da55ee280935aabbb375c5934904f870c2f597d6507fdf"}, - {file = "ansys_mechanical_env-0.1.0-py3-none-any.whl", hash = "sha256:6a73952de91696d2ee5c2c4e9fd5f4b5c78a110ea976b64ba54491d783ce5b02"}, + {file = "ansys-mechanical-env-0.1.2.tar.gz", hash = "sha256:4d5ddd3715439d73621d707d6d999eb48163641a35d01d5a46b5196c2c55fa36"}, + {file = "ansys_mechanical_env-0.1.2-py3-none-any.whl", hash = "sha256:d31c696155fde265cc79c6e4710d9f05a009acb308819e196d54e2e20f58ad2e"}, ] [package.dependencies] @@ -446,19 +446,19 @@ clr-loader = ">=0.2.6,<0.3.0" [[package]] name = "ansys-sphinx-theme" -version = "0.13.0" +version = "0.13.1" description = "A theme devised by ANSYS, Inc. for Sphinx documentation." optional = false python-versions = ">=3.9,<4" files = [ - {file = "ansys_sphinx_theme-0.13.0-py3-none-any.whl", hash = "sha256:b62368ff2fc2066951980c260ce8307bf06331ef26517b4c5a0632712c180aaa"}, - {file = "ansys_sphinx_theme-0.13.0.tar.gz", hash = "sha256:93921a4db74eb7091445b44b1c6c6b39b791580b63869f8ee58be7726d95a83f"}, + {file = "ansys_sphinx_theme-0.13.1-py3-none-any.whl", hash = "sha256:d82c266cecc46cf535e929ce4354d6392a731fe623d05977d88b408b032dd867"}, + {file = "ansys_sphinx_theme-0.13.1.tar.gz", hash = "sha256:863574c46ed51eb12b55472d085df04c48cd0a84db84d5e95594683aedfbf4a3"}, ] [package.dependencies] importlib-metadata = ">=4.0" Jinja2 = ">=3.1.2" -pydata-sphinx-theme = ">=0.14.0" +pydata-sphinx-theme = ">=0.14,<0.15" Sphinx = ">=4.2.0" [package.extras] @@ -1376,53 +1376,53 @@ typing = ["typing-extensions (>=4.8)"] [[package]] name = "fonttools" -version = "4.47.0" +version = "4.47.2" description = "Tools to manipulate font files" optional = false python-versions = ">=3.8" files = [ - {file = "fonttools-4.47.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:2d2404107626f97a221dc1a65b05396d2bb2ce38e435f64f26ed2369f68675d9"}, - {file = "fonttools-4.47.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c01f409be619a9a0f5590389e37ccb58b47264939f0e8d58bfa1f3ba07d22671"}, - {file = "fonttools-4.47.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d986b66ff722ef675b7ee22fbe5947a41f60a61a4da15579d5e276d897fbc7fa"}, - {file = "fonttools-4.47.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e8acf6dd0434b211b3bd30d572d9e019831aae17a54016629fa8224783b22df8"}, - {file = "fonttools-4.47.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:495369c660e0c27233e3c572269cbe520f7f4978be675f990f4005937337d391"}, - {file = "fonttools-4.47.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:c59227d7ba5b232281c26ae04fac2c73a79ad0e236bca5c44aae904a18f14faf"}, - {file = "fonttools-4.47.0-cp310-cp310-win32.whl", hash = "sha256:59a6c8b71a245800e923cb684a2dc0eac19c56493e2f896218fcf2571ed28984"}, - {file = "fonttools-4.47.0-cp310-cp310-win_amd64.whl", hash = "sha256:52c82df66201f3a90db438d9d7b337c7c98139de598d0728fb99dab9fd0495ca"}, - {file = "fonttools-4.47.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:854421e328d47d70aa5abceacbe8eef231961b162c71cbe7ff3f47e235e2e5c5"}, - {file = "fonttools-4.47.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:511482df31cfea9f697930f61520f6541185fa5eeba2fa760fe72e8eee5af88b"}, - {file = "fonttools-4.47.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ce0e2c88c8c985b7b9a7efcd06511fb0a1fe3ddd9a6cd2895ef1dbf9059719d7"}, - {file = "fonttools-4.47.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e7a0a8848726956e9d9fb18c977a279013daadf0cbb6725d2015a6dd57527992"}, - {file = "fonttools-4.47.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e869da810ae35afb3019baa0d0306cdbab4760a54909c89ad8904fa629991812"}, - {file = "fonttools-4.47.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:dd23848f877c3754f53a4903fb7a593ed100924f9b4bff7d5a4e2e8a7001ae11"}, - {file = "fonttools-4.47.0-cp311-cp311-win32.whl", hash = "sha256:bf1810635c00f7c45d93085611c995fc130009cec5abdc35b327156aa191f982"}, - {file = "fonttools-4.47.0-cp311-cp311-win_amd64.whl", hash = "sha256:61df4dee5d38ab65b26da8efd62d859a1eef7a34dcbc331299a28e24d04c59a7"}, - {file = "fonttools-4.47.0-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:e3f4d61f3a8195eac784f1d0c16c0a3105382c1b9a74d99ac4ba421da39a8826"}, - {file = "fonttools-4.47.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:174995f7b057e799355b393e97f4f93ef1f2197cbfa945e988d49b2a09ecbce8"}, - {file = "fonttools-4.47.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ea592e6a09b71cb7a7661dd93ac0b877a6228e2d677ebacbad0a4d118494c86d"}, - {file = "fonttools-4.47.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:40bdbe90b33897d9cc4a39f8e415b0fcdeae4c40a99374b8a4982f127ff5c767"}, - {file = "fonttools-4.47.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:843509ae9b93db5aaf1a6302085e30bddc1111d31e11d724584818f5b698f500"}, - {file = "fonttools-4.47.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:9acfa1cdc479e0dde528b61423855913d949a7f7fe09e276228298fef4589540"}, - {file = "fonttools-4.47.0-cp312-cp312-win32.whl", hash = "sha256:66c92ec7f95fd9732550ebedefcd190a8d81beaa97e89d523a0d17198a8bda4d"}, - {file = "fonttools-4.47.0-cp312-cp312-win_amd64.whl", hash = "sha256:e8fa20748de55d0021f83754b371432dca0439e02847962fc4c42a0e444c2d78"}, - {file = "fonttools-4.47.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:c75e19971209fbbce891ebfd1b10c37320a5a28e8d438861c21d35305aedb81c"}, - {file = "fonttools-4.47.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:e79f1a3970d25f692bbb8c8c2637e621a66c0d60c109ab48d4a160f50856deff"}, - {file = "fonttools-4.47.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:562681188c62c024fe2c611b32e08b8de2afa00c0c4e72bed47c47c318e16d5c"}, - {file = "fonttools-4.47.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a77a60315c33393b2bd29d538d1ef026060a63d3a49a9233b779261bad9c3f71"}, - {file = "fonttools-4.47.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:b4fabb8cc9422efae1a925160083fdcbab8fdc96a8483441eb7457235df625bd"}, - {file = "fonttools-4.47.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:2a78dba8c2a1e9d53a0fb5382979f024200dc86adc46a56cbb668a2249862fda"}, - {file = "fonttools-4.47.0-cp38-cp38-win32.whl", hash = "sha256:e6b968543fde4119231c12c2a953dcf83349590ca631ba8216a8edf9cd4d36a9"}, - {file = "fonttools-4.47.0-cp38-cp38-win_amd64.whl", hash = "sha256:4a9a51745c0439516d947480d4d884fa18bd1458e05b829e482b9269afa655bc"}, - {file = "fonttools-4.47.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:62d8ddb058b8e87018e5dc26f3258e2c30daad4c87262dfeb0e2617dd84750e6"}, - {file = "fonttools-4.47.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:5dde0eab40faaa5476133123f6a622a1cc3ac9b7af45d65690870620323308b4"}, - {file = "fonttools-4.47.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f4da089f6dfdb822293bde576916492cd708c37c2501c3651adde39804630538"}, - {file = "fonttools-4.47.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:253bb46bab970e8aae254cebf2ae3db98a4ef6bd034707aa68a239027d2b198d"}, - {file = "fonttools-4.47.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:1193fb090061efa2f9e2d8d743ae9850c77b66746a3b32792324cdce65784154"}, - {file = "fonttools-4.47.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:084511482dd265bce6dca24c509894062f0117e4e6869384d853f46c0e6d43be"}, - {file = "fonttools-4.47.0-cp39-cp39-win32.whl", hash = "sha256:97620c4af36e4c849e52661492e31dc36916df12571cb900d16960ab8e92a980"}, - {file = "fonttools-4.47.0-cp39-cp39-win_amd64.whl", hash = "sha256:e77bdf52185bdaf63d39f3e1ac3212e6cfa3ab07d509b94557a8902ce9c13c82"}, - {file = "fonttools-4.47.0-py3-none-any.whl", hash = "sha256:d6477ba902dd2d7adda7f0fd3bfaeb92885d45993c9e1928c9f28fc3961415f7"}, - {file = "fonttools-4.47.0.tar.gz", hash = "sha256:ec13a10715eef0e031858c1c23bfaee6cba02b97558e4a7bfa089dba4a8c2ebf"}, + {file = "fonttools-4.47.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:3b629108351d25512d4ea1a8393a2dba325b7b7d7308116b605ea3f8e1be88df"}, + {file = "fonttools-4.47.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c19044256c44fe299d9a73456aabee4b4d06c6b930287be93b533b4737d70aa1"}, + {file = "fonttools-4.47.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b8be28c036b9f186e8c7eaf8a11b42373e7e4949f9e9f370202b9da4c4c3f56c"}, + {file = "fonttools-4.47.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f83a4daef6d2a202acb9bf572958f91cfde5b10c8ee7fb1d09a4c81e5d851fd8"}, + {file = "fonttools-4.47.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:4a5a5318ba5365d992666ac4fe35365f93004109d18858a3e18ae46f67907670"}, + {file = "fonttools-4.47.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:8f57ecd742545362a0f7186774b2d1c53423ed9ece67689c93a1055b236f638c"}, + {file = "fonttools-4.47.2-cp310-cp310-win32.whl", hash = "sha256:a1c154bb85dc9a4cf145250c88d112d88eb414bad81d4cb524d06258dea1bdc0"}, + {file = "fonttools-4.47.2-cp310-cp310-win_amd64.whl", hash = "sha256:3e2b95dce2ead58fb12524d0ca7d63a63459dd489e7e5838c3cd53557f8933e1"}, + {file = "fonttools-4.47.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:29495d6d109cdbabe73cfb6f419ce67080c3ef9ea1e08d5750240fd4b0c4763b"}, + {file = "fonttools-4.47.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:0a1d313a415eaaba2b35d6cd33536560deeebd2ed758b9bfb89ab5d97dc5deac"}, + {file = "fonttools-4.47.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:90f898cdd67f52f18049250a6474185ef6544c91f27a7bee70d87d77a8daf89c"}, + {file = "fonttools-4.47.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3480eeb52770ff75140fe7d9a2ec33fb67b07efea0ab5129c7e0c6a639c40c70"}, + {file = "fonttools-4.47.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:0255dbc128fee75fb9be364806b940ed450dd6838672a150d501ee86523ac61e"}, + {file = "fonttools-4.47.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:f791446ff297fd5f1e2247c188de53c1bfb9dd7f0549eba55b73a3c2087a2703"}, + {file = "fonttools-4.47.2-cp311-cp311-win32.whl", hash = "sha256:740947906590a878a4bde7dd748e85fefa4d470a268b964748403b3ab2aeed6c"}, + {file = "fonttools-4.47.2-cp311-cp311-win_amd64.whl", hash = "sha256:63fbed184979f09a65aa9c88b395ca539c94287ba3a364517698462e13e457c9"}, + {file = "fonttools-4.47.2-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:4ec558c543609e71b2275c4894e93493f65d2f41c15fe1d089080c1d0bb4d635"}, + {file = "fonttools-4.47.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:e040f905d542362e07e72e03612a6270c33d38281fd573160e1003e43718d68d"}, + {file = "fonttools-4.47.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6dd58cc03016b281bd2c74c84cdaa6bd3ce54c5a7f47478b7657b930ac3ed8eb"}, + {file = "fonttools-4.47.2-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:32ab2e9702dff0dd4510c7bb958f265a8d3dd5c0e2547e7b5f7a3df4979abb07"}, + {file = "fonttools-4.47.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:3a808f3c1d1df1f5bf39be869b6e0c263570cdafb5bdb2df66087733f566ea71"}, + {file = "fonttools-4.47.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:ac71e2e201df041a2891067dc36256755b1229ae167edbdc419b16da78732c2f"}, + {file = "fonttools-4.47.2-cp312-cp312-win32.whl", hash = "sha256:69731e8bea0578b3c28fdb43dbf95b9386e2d49a399e9a4ad736b8e479b08085"}, + {file = "fonttools-4.47.2-cp312-cp312-win_amd64.whl", hash = "sha256:b3e1304e5f19ca861d86a72218ecce68f391646d85c851742d265787f55457a4"}, + {file = "fonttools-4.47.2-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:254d9a6f7be00212bf0c3159e0a420eb19c63793b2c05e049eb337f3023c5ecc"}, + {file = "fonttools-4.47.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:eabae77a07c41ae0b35184894202305c3ad211a93b2eb53837c2a1143c8bc952"}, + {file = "fonttools-4.47.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a86a5ab2873ed2575d0fcdf1828143cfc6b977ac448e3dc616bb1e3d20efbafa"}, + {file = "fonttools-4.47.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:13819db8445a0cec8c3ff5f243af6418ab19175072a9a92f6cc8ca7d1452754b"}, + {file = "fonttools-4.47.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:4e743935139aa485fe3253fc33fe467eab6ea42583fa681223ea3f1a93dd01e6"}, + {file = "fonttools-4.47.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:d49ce3ea7b7173faebc5664872243b40cf88814ca3eb135c4a3cdff66af71946"}, + {file = "fonttools-4.47.2-cp38-cp38-win32.whl", hash = "sha256:94208ea750e3f96e267f394d5588579bb64cc628e321dbb1d4243ffbc291b18b"}, + {file = "fonttools-4.47.2-cp38-cp38-win_amd64.whl", hash = "sha256:0f750037e02beb8b3569fbff701a572e62a685d2a0e840d75816592280e5feae"}, + {file = "fonttools-4.47.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:3d71606c9321f6701642bd4746f99b6089e53d7e9817fc6b964e90d9c5f0ecc6"}, + {file = "fonttools-4.47.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:86e0427864c6c91cf77f16d1fb9bf1bbf7453e824589e8fb8461b6ee1144f506"}, + {file = "fonttools-4.47.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0a00bd0e68e88987dcc047ea31c26d40a3c61185153b03457956a87e39d43c37"}, + {file = "fonttools-4.47.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a5d77479fb885ef38a16a253a2f4096bc3d14e63a56d6246bfdb56365a12b20c"}, + {file = "fonttools-4.47.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:5465df494f20a7d01712b072ae3ee9ad2887004701b95cb2cc6dcb9c2c97a899"}, + {file = "fonttools-4.47.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:4c811d3c73b6abac275babb8aa439206288f56fdb2c6f8835e3d7b70de8937a7"}, + {file = "fonttools-4.47.2-cp39-cp39-win32.whl", hash = "sha256:5b60e3afa9635e3dfd3ace2757039593e3bd3cf128be0ddb7a1ff4ac45fa5a50"}, + {file = "fonttools-4.47.2-cp39-cp39-win_amd64.whl", hash = "sha256:7ee48bd9d6b7e8f66866c9090807e3a4a56cf43ffad48962725a190e0dd774c8"}, + {file = "fonttools-4.47.2-py3-none-any.whl", hash = "sha256:7eb7ad665258fba68fd22228a09f347469d95a97fb88198e133595947a20a184"}, + {file = "fonttools-4.47.2.tar.gz", hash = "sha256:7df26dd3650e98ca45f1e29883c96a0b9f5bb6af8d632a6a108bc744fa0bd9b3"}, ] [package.extras] @@ -1589,13 +1589,13 @@ uritemplate = ">=3.0.1,<5" [[package]] name = "google-auth" -version = "2.26.1" +version = "2.26.2" description = "Google Authentication Library" optional = false python-versions = ">=3.7" files = [ - {file = "google-auth-2.26.1.tar.gz", hash = "sha256:54385acca5c0fbdda510cd8585ba6f3fcb06eeecf8a6ecca39d3ee148b092590"}, - {file = "google_auth-2.26.1-py2.py3-none-any.whl", hash = "sha256:2c8b55e3e564f298122a02ab7b97458ccfcc5617840beb5d0ac757ada92c9780"}, + {file = "google-auth-2.26.2.tar.gz", hash = "sha256:97327dbbf58cccb58fc5a1712bba403ae76668e64814eb30f7316f7e27126b81"}, + {file = "google_auth-2.26.2-py2.py3-none-any.whl", hash = "sha256:3f445c8ce9b61ed6459aad86d8ccdba4a9afed841b2d1451a11ef4db08957424"}, ] [package.dependencies] @@ -1739,13 +1739,13 @@ pyparsing = {version = ">=2.4.2,<3.0.0 || >3.0.0,<3.0.1 || >3.0.1,<3.0.2 || >3.0 [[package]] name = "hypothesis" -version = "6.92.6" +version = "6.92.9" description = "A library for property-based testing" optional = false python-versions = ">=3.8" files = [ - {file = "hypothesis-6.92.6-py3-none-any.whl", hash = "sha256:f8af0545a5a504abce9cb1ec1dbf6d737c356f22f002036ffee0421a2119b7e5"}, - {file = "hypothesis-6.92.6.tar.gz", hash = "sha256:fbb69c8e704427eadfd91fa81da8a82f6938dfcc9b4364027e476590bb7d7d8c"}, + {file = "hypothesis-6.92.9-py3-none-any.whl", hash = "sha256:8c1ab9f3c883fe63a712bb6c8c1b5be4185cad52775cd7703c040fc0d0111572"}, + {file = "hypothesis-6.92.9.tar.gz", hash = "sha256:629f31788243559d35d3101ef8e94caf736cf8efaad3f0dd66ec7dbb31b8ef19"}, ] [package.dependencies] @@ -1979,13 +1979,13 @@ testing = ["Django", "attrs", "colorama", "docopt", "pytest (<7.0.0)"] [[package]] name = "jinja2" -version = "3.1.2" +version = "3.1.3" description = "A very fast and expressive template engine." optional = false python-versions = ">=3.7" files = [ - {file = "Jinja2-3.1.2-py3-none-any.whl", hash = "sha256:6088930bfe239f0e6710546ab9c19c9ef35e29792895fed6e6e31a023a182a61"}, - {file = "Jinja2-3.1.2.tar.gz", hash = "sha256:31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852"}, + {file = "Jinja2-3.1.3-py3-none-any.whl", hash = "sha256:7d6d50dd97d52cbc355597bd845fabfbac3f551e1f99619e39a35ce8c370b5fa"}, + {file = "Jinja2-3.1.3.tar.gz", hash = "sha256:ac8bd6544d4bb2c9792bf3a159e80bba8fda7f07e81bc3aed565432d5925ba90"}, ] [package.dependencies] @@ -2118,13 +2118,13 @@ test = ["click", "pre-commit", "pytest (>=7.0)", "pytest-asyncio (>=0.19.0)", "p [[package]] name = "jupyter-server" -version = "2.12.3" +version = "2.12.4" description = "The backend—i.e. core services, APIs, and REST endpoints—to Jupyter web applications." optional = false python-versions = ">=3.8" files = [ - {file = "jupyter_server-2.12.3-py3-none-any.whl", hash = "sha256:6f85310ea5e6068568a521f079fba99d8d17e4884dd1d602ab0f43b3115204a8"}, - {file = "jupyter_server-2.12.3.tar.gz", hash = "sha256:a1d2d51e497b1a6256c48b6940b0dd49b2553981baf1690077c37792f1fa23a1"}, + {file = "jupyter_server-2.12.4-py3-none-any.whl", hash = "sha256:a125ae18a60de568f78f55c84dd58759901a18ef279abf0418ac220653ca1320"}, + {file = "jupyter_server-2.12.4.tar.gz", hash = "sha256:41f4a1e6b912cc24a7c6c694851b37d3d8412b180f43d72315fe422cb2b85cc2"}, ] [package.dependencies] @@ -2659,13 +2659,13 @@ test = ["flaky", "ipykernel (>=6.19.3)", "ipython", "ipywidgets", "nbconvert (>= [[package]] name = "nbconvert" -version = "7.14.0" +version = "7.14.1" description = "Converting Jupyter Notebooks" optional = false python-versions = ">=3.8" files = [ - {file = "nbconvert-7.14.0-py3-none-any.whl", hash = "sha256:483dde47facdaa4875903d651305ad53cd76e2255ae3c61efe412a95f2d22a24"}, - {file = "nbconvert-7.14.0.tar.gz", hash = "sha256:92b9a44b63e5a7fb4f6fa0ef41261e35c16925046ccd1c04a5c8099bf100476e"}, + {file = "nbconvert-7.14.1-py3-none-any.whl", hash = "sha256:aa83e3dd27ea38d0c1d908e3ce9518d15fa908dd30521b6d5040bd23f33fffb0"}, + {file = "nbconvert-7.14.1.tar.gz", hash = "sha256:20cba10e0448dc76b3bebfe1adf923663e3b98338daf77b97b42511ef5a88618"}, ] [package.dependencies] @@ -3211,13 +3211,13 @@ files = [ [[package]] name = "pydata-sphinx-theme" -version = "0.15.1" +version = "0.14.4" description = "Bootstrap-based Sphinx theme from the PyData community" optional = false -python-versions = ">=3.9" +python-versions = ">=3.8" files = [ - {file = "pydata_sphinx_theme-0.15.1-py3-none-any.whl", hash = "sha256:064efbe96137bd0acab80413759f1db38a42b51e2429b159af75c43a7590320b"}, - {file = "pydata_sphinx_theme-0.15.1.tar.gz", hash = "sha256:4606f7d59765ae06ff7cb5e07dead4286ea2ff2164deeee63922481eddf1083c"}, + {file = "pydata_sphinx_theme-0.14.4-py3-none-any.whl", hash = "sha256:ac15201f4c2e2e7042b0cad8b30251433c1f92be762ddcefdb4ae68811d918d9"}, + {file = "pydata_sphinx_theme-0.14.4.tar.gz", hash = "sha256:f5d7a2cb7a98e35b9b49d3b02cec373ad28958c2ed5c9b1ffe6aff6c56e9de5b"}, ] [package.dependencies] @@ -3340,13 +3340,13 @@ histogram = ["pygal", "pygaljs"] [[package]] name = "pytest-cases" -version = "3.8.1" +version = "3.8.2" description = "Separate test code from test cases in pytest." optional = false python-versions = "*" files = [ - {file = "pytest-cases-3.8.1.tar.gz", hash = "sha256:49d7f6f8ad534e5a6e73fb8f5fd38986606f17b46ee55f7ebee07a55c677ca01"}, - {file = "pytest_cases-3.8.1-py2.py3-none-any.whl", hash = "sha256:595553f5a522ad6525778a35e0fcb4a46f8eb069e0abe108de02e1d4fb136b85"}, + {file = "pytest-cases-3.8.2.tar.gz", hash = "sha256:24cec0128c822f51b5f402face09e7049954d9675db2ca675fce1ef7f8f749e8"}, + {file = "pytest_cases-3.8.2-py2.py3-none-any.whl", hash = "sha256:1ad5ee85e580433caff42f59398d2812d9b8de470f593393c02e4249ddff3996"}, ] [package.dependencies] @@ -4325,13 +4325,13 @@ test = ["argcomplete (>=3.0.3)", "mypy (>=1.7.0)", "pre-commit", "pytest (>=7.0, [[package]] name = "trame" -version = "3.5.0" +version = "3.5.1" description = "Trame, a framework to build applications in plain Python" optional = false python-versions = "*" files = [ - {file = "trame-3.5.0-py3-none-any.whl", hash = "sha256:7788e967b98e2aec5fa0b685ac5cd13d3b1e5721c229ac864f99089dadb3212f"}, - {file = "trame-3.5.0.tar.gz", hash = "sha256:706a112bf4164ab8d024301ae0d174bae8df40f2fb82f0ec7b017f53a33bb03f"}, + {file = "trame-3.5.1-py3-none-any.whl", hash = "sha256:ccf7945c98939d58c6c75fc5651980b8778f252b63ceb09d07601dfe59fb0f78"}, + {file = "trame-3.5.1.tar.gz", hash = "sha256:10585fb44815da99d038e450208063e3cc7eb38dfbbc2399af7eaa9ead9d17a8"}, ] [package.dependencies] diff --git a/src/ansys/acp/core/__init__.py b/src/ansys/acp/core/__init__.py index b5980cdfcb..155901438f 100644 --- a/src/ansys/acp/core/__init__.py +++ b/src/ansys/acp/core/__init__.py @@ -5,6 +5,9 @@ from ._tree_objects import ( AnalysisPly, BooleanSelectionRule, + CADComponent, + CADGeometry, + CutoffSelectionRule, CylindricalSelectionRule, EdgeSet, EdgeSetType, @@ -12,6 +15,7 @@ ElementSet, Fabric, FabricWithAngle, + GeometricalSelectionRule, Lamina, LinkedSelectionRule, LookUpTable1D, @@ -34,6 +38,7 @@ TubeSelectionRule, UnitSystemType, VariableOffsetSelectionRule, + VirtualGeometry, ) __version__ = importlib.metadata.version(__name__.replace(".", "-")) @@ -50,9 +55,13 @@ "Material", "Fabric", "SubLaminate", + "Lamina", "ElementSet", "EdgeSet", "EdgeSetType", + "CADGeometry", + "CADComponent", + "VirtualGeometry", "Rosette", "LookUpTable1D", "LookUpTable1DColumn", @@ -62,6 +71,8 @@ "CylindricalSelectionRule", "SphericalSelectionRule", "TubeSelectionRule", + "CutoffSelectionRule", + "GeometricalSelectionRule", "VariableOffsetSelectionRule", "BooleanSelectionRule", "LinkedSelectionRule", @@ -72,6 +83,7 @@ "AnalysisPly", "UnitSystemType", "Stackup", + "Sensor", "FabricWithAngle", "ElementalDataType", "NodalDataType", diff --git a/src/ansys/acp/core/_tree_objects/__init__.py b/src/ansys/acp/core/_tree_objects/__init__.py index ec3aaee5af..b749a5fe66 100644 --- a/src/ansys/acp/core/_tree_objects/__init__.py +++ b/src/ansys/acp/core/_tree_objects/__init__.py @@ -1,10 +1,14 @@ from .analysis_ply import AnalysisPly from .boolean_selection_rule import BooleanSelectionRule +from .cad_component import CADComponent +from .cad_geometry import CADGeometry +from .cutoff_selection_rule import CutoffSelectionRule from .cylindrical_selection_rule import CylindricalSelectionRule from .edge_set import EdgeSet from .element_set import ElementSet from .enums import EdgeSetType, ElementalDataType, NodalDataType, UnitSystemType from .fabric import Fabric +from .geometrical_selection_rule import GeometricalSelectionRule from .linked_selection_rule import LinkedSelectionRule from .lookup_table_1d import LookUpTable1D from .lookup_table_1d_column import LookUpTable1DColumn @@ -24,6 +28,7 @@ from .sublaminate import Lamina, SubLaminate from .tube_selection_rule import TubeSelectionRule from .variable_offset_selection_rule import VariableOffsetSelectionRule +from .virtual_geometry import VirtualGeometry __all__ = [ "Model", @@ -35,6 +40,9 @@ "Lamina", "ElementSet", "EdgeSet", + "CADGeometry", + "CADComponent", + "VirtualGeometry", "Rosette", "LookUpTable1D", "LookUpTable1DColumn", @@ -45,6 +53,8 @@ "CylindricalSelectionRule", "SphericalSelectionRule", "TubeSelectionRule", + "CutoffSelectionRule", + "GeometricalSelectionRule", "VariableOffsetSelectionRule", "BooleanSelectionRule", "LinkedSelectionRule", diff --git a/src/ansys/acp/core/_tree_objects/cutoff_selection_rule.py b/src/ansys/acp/core/_tree_objects/cutoff_selection_rule.py new file mode 100644 index 0000000000..00bdac4eca --- /dev/null +++ b/src/ansys/acp/core/_tree_objects/cutoff_selection_rule.py @@ -0,0 +1,129 @@ +from __future__ import annotations + +from collections.abc import Iterable +import dataclasses + +import numpy as np +import numpy.typing as npt + +from ansys.api.acp.v0 import cutoff_selection_rule_pb2, cutoff_selection_rule_pb2_grpc + +from ._grpc_helpers.property_helper import ( + grpc_data_property, + grpc_data_property_read_only, + grpc_link_property, + mark_grpc_properties, +) +from ._mesh_data import ElementalData, NodalData, elemental_data_property, nodal_data_property +from .base import CreatableTreeObject, IdTreeObject +from .edge_set import EdgeSet +from .enums import ( + CutoffRuleType, + PlyCutoffType, + cutoff_rule_type_from_pb, + cutoff_rule_type_to_pb, + ply_cutoff_type_from_pb, + ply_cutoff_type_to_pb, + status_type_from_pb, +) +from .object_registry import register +from .virtual_geometry import VirtualGeometry + +__all__ = [ + "CutoffSelectionRule", + "CutoffSelectionRuleElementalData", + "CutoffSelectionRuleNodalData", +] + + +@dataclasses.dataclass +class CutoffSelectionRuleElementalData(ElementalData): + """Represents elemental data for a Cutoff Selection Rule.""" + + normal: npt.NDArray[np.float64] + + +@dataclasses.dataclass +class CutoffSelectionRuleNodalData(NodalData): + """Represents nodal data for a Cutoff Selection Rule.""" + + +@mark_grpc_properties +@register +class CutoffSelectionRule(CreatableTreeObject, IdTreeObject): + """Instantiate a Cutoff Selection Rule. + + Parameters + ---------- + name : + Name of the Cutoff Selection Rule. + cutoff_rule_type : + Determines if the cut-off is defined by a geometry or by a tapering edge. + cutoff_geometry : + Geometry used to define the cut-off. Only applies if + ``cutoff_rule_type`` is GEOMETRY. + taper_edge_set : + Edge used to define the cut-off. Only applies if + ``cutoff_rule_type`` is :attr:`.CutoffRuleType.TAPER`. + offset : + Moves the cutting plane along the out-of-plane direction. Always measured + from the reference surface. + angle : + Defines the angle between the cutting plane and the reference surface. + ply_cutoff_type : + Either the complete production ply is cut-off + (:attr:`PlyCutoffType.PRODUCTION_PLY_CUTOFF`) or individual analysis plies + (:attr:`PlyCutoffType.ANALYSIS_PLY_CUTOFF`). + ply_tapering : + Whether the tapering of analysis plies is enabled. + """ + + __slots__: Iterable[str] = tuple() + + _COLLECTION_LABEL = "cutoff_selection_rules" + OBJECT_INFO_TYPE = cutoff_selection_rule_pb2.ObjectInfo + CREATE_REQUEST_TYPE = cutoff_selection_rule_pb2.CreateRequest + + def __init__( + self, + name: str = "CutoffSelectionrule", + cutoff_rule_type: CutoffRuleType = CutoffRuleType.GEOMETRY, + cutoff_geometry: VirtualGeometry | None = None, + taper_edge_set: EdgeSet | None = None, + offset: float = 0.0, + angle: float = 0.0, + ply_cutoff_type: PlyCutoffType = PlyCutoffType.PRODUCTION_PLY_CUTOFF, + ply_tapering: bool = False, + ): + super().__init__(name=name) + self.cutoff_rule_type = cutoff_rule_type + self.cutoff_geometry = cutoff_geometry + self.taper_edge_set = taper_edge_set + self.offset = offset + self.angle = angle + self.ply_cutoff_type = ply_cutoff_type + self.ply_tapering = ply_tapering + + def _create_stub(self) -> cutoff_selection_rule_pb2_grpc.ObjectServiceStub: + return cutoff_selection_rule_pb2_grpc.ObjectServiceStub(self._channel) + + status = grpc_data_property_read_only("properties.status", from_protobuf=status_type_from_pb) + + cutoff_rule_type = grpc_data_property( + "properties.cutoff_rule_type", + from_protobuf=cutoff_rule_type_from_pb, + to_protobuf=cutoff_rule_type_to_pb, + ) + cutoff_geometry = grpc_link_property("properties.cutoff_geometry") + taper_edge_set = grpc_link_property("properties.taper_edge_set") + offset = grpc_data_property("properties.offset") + angle = grpc_data_property("properties.angle") + ply_cutoff_type = grpc_data_property( + "properties.ply_cutoff_type", + from_protobuf=ply_cutoff_type_from_pb, + to_protobuf=ply_cutoff_type_to_pb, + ) + ply_tapering = grpc_data_property("properties.ply_tapering") + + elemental_data = elemental_data_property(CutoffSelectionRuleElementalData) + nodal_data = nodal_data_property(CutoffSelectionRuleNodalData) diff --git a/src/ansys/acp/core/_tree_objects/enums.py b/src/ansys/acp/core/_tree_objects/enums.py index f33e52e66e..b6060c5599 100644 --- a/src/ansys/acp/core/_tree_objects/enums.py +++ b/src/ansys/acp/core/_tree_objects/enums.py @@ -1,8 +1,10 @@ from ansys.api.acp.v0 import ( cut_off_material_pb2, + cutoff_selection_rule_pb2, drop_off_material_pb2, edge_set_pb2, enum_types_pb2, + geometrical_selection_rule_pb2, lookup_table_3d_pb2, lookup_table_column_type_pb2, mesh_query_pb2, @@ -169,3 +171,23 @@ virtual_geometry_dimension_to_pb, virtual_geometry_dimension_from_pb, ) = wrap_to_string_enum("VirtualGeometryDimension", virtual_geometry_pb2.Dimension, module=__name__) + +( + CutoffRuleType, + cutoff_rule_type_to_pb, + cutoff_rule_type_from_pb, +) = wrap_to_string_enum("CutoffRuleType", cutoff_selection_rule_pb2.CutoffRuleType, module=__name__) + +( + PlyCutoffType, + ply_cutoff_type_to_pb, + ply_cutoff_type_from_pb, +) = wrap_to_string_enum("PlyCutoffType", cutoff_selection_rule_pb2.PlyCutoffType, module=__name__) + +( + GeometricalRuleType, + geometrical_rule_type_to_pb, + geometrical_rule_type_from_pb, +) = wrap_to_string_enum( + "GeometricalRuleType", geometrical_selection_rule_pb2.GeometricalRuleType, module=__name__ +) diff --git a/src/ansys/acp/core/_tree_objects/geometrical_selection_rule.py b/src/ansys/acp/core/_tree_objects/geometrical_selection_rule.py new file mode 100644 index 0000000000..8e8730f4bc --- /dev/null +++ b/src/ansys/acp/core/_tree_objects/geometrical_selection_rule.py @@ -0,0 +1,125 @@ +from __future__ import annotations + +from collections.abc import Iterable +import dataclasses + +import numpy as np +import numpy.typing as npt + +from ansys.api.acp.v0 import geometrical_selection_rule_pb2, geometrical_selection_rule_pb2_grpc + +from ._grpc_helpers.linked_object_list import define_linked_object_list +from ._grpc_helpers.property_helper import ( + grpc_data_property, + grpc_data_property_read_only, + grpc_link_property, + mark_grpc_properties, +) +from ._mesh_data import ElementalData, NodalData, elemental_data_property, nodal_data_property +from .base import CreatableTreeObject, IdTreeObject +from .element_set import ElementSet +from .enums import ( + GeometricalRuleType, + geometrical_rule_type_from_pb, + geometrical_rule_type_to_pb, + status_type_from_pb, +) +from .object_registry import register +from .virtual_geometry import VirtualGeometry + +__all__ = [ + "GeometricalSelectionRule", + "GeometricalSelectionRuleElementalData", + "GeometricalSelectionRuleNodalData", +] + + +@dataclasses.dataclass +class GeometricalSelectionRuleElementalData(ElementalData): + """Represents elemental data for a Geometrical Selection Rule.""" + + normal: npt.NDArray[np.float64] + + +@dataclasses.dataclass +class GeometricalSelectionRuleNodalData(NodalData): + """Represents nodal data for a Geometrical Selection Rule.""" + + +@mark_grpc_properties +@register +class GeometricalSelectionRule(CreatableTreeObject, IdTreeObject): + """Instantiate a Geometrical Selection Rule. + + Parameters + ---------- + name : + Name of the Geometrical Selection Rule. + geometrical_rule_type : + Rule type. Can be either :attr:`.GeometricalRuleType.GEOMETRY` or + :attr:`.GeometricalRuleType.ELEMENT_SETS`. + geometry : + Virtual geometry to use for the rule. + element_sets : + Element sets to use for the rule. + include_rule_type : + Include or exclude area in rule. Setting this to ``False`` + inverts the selection. + use_default_tolerances : + Whether to use default tolerances. + in_plane_capture_tolerance : + In-plane capture tolerance around the outline. + negative_capture_tolerance : + Capture tolerance along the surface or projection normal. + positive_capture_tolerance : + Capture tolerance along the opposite surface or projection normal. + """ + + __slots__: Iterable[str] = tuple() + + _COLLECTION_LABEL = "geometrical_selection_rules" + OBJECT_INFO_TYPE = geometrical_selection_rule_pb2.ObjectInfo + CREATE_REQUEST_TYPE = geometrical_selection_rule_pb2.CreateRequest + + def __init__( + self, + name: str = "GeometricalSelectionrule", + geometrical_rule_type: GeometricalRuleType = GeometricalRuleType.GEOMETRY, + geometry: VirtualGeometry | None = None, + element_sets: Iterable[ElementSet] = (), + include_rule_type: bool = True, + use_default_tolerances: bool = True, + in_plane_capture_tolerance: float = 0.0, + negative_capture_tolerance: float = 0.0, + positive_capture_tolerance: float = 0.0, + ): + super().__init__(name=name) + self.geometrical_rule_type = geometrical_rule_type + self.geometry = geometry + self.element_sets = element_sets + self.include_rule_type = include_rule_type + self.use_default_tolerances = use_default_tolerances + self.in_plane_capture_tolerance = in_plane_capture_tolerance + self.negative_capture_tolerance = negative_capture_tolerance + self.positive_capture_tolerance = positive_capture_tolerance + + def _create_stub(self) -> geometrical_selection_rule_pb2_grpc.ObjectServiceStub: + return geometrical_selection_rule_pb2_grpc.ObjectServiceStub(self._channel) + + status = grpc_data_property_read_only("properties.status", from_protobuf=status_type_from_pb) + + geometrical_rule_type = grpc_data_property( + "properties.geometrical_rule_type", + from_protobuf=geometrical_rule_type_from_pb, + to_protobuf=geometrical_rule_type_to_pb, + ) + geometry = grpc_link_property("properties.geometry") + element_sets = define_linked_object_list("properties.element_sets", object_class=ElementSet) + include_rule_type = grpc_data_property("properties.include_rule_type") + use_default_tolerances = grpc_data_property("properties.use_default_tolerances") + in_plane_capture_tolerance = grpc_data_property("properties.in_plane_capture_tolerance") + negative_capture_tolerance = grpc_data_property("properties.negative_capture_tolerance") + positive_capture_tolerance = grpc_data_property("properties.positive_capture_tolerance") + + elemental_data = elemental_data_property(GeometricalSelectionRuleElementalData) + nodal_data = nodal_data_property(GeometricalSelectionRuleNodalData) diff --git a/src/ansys/acp/core/_tree_objects/linked_selection_rule.py b/src/ansys/acp/core/_tree_objects/linked_selection_rule.py index dff2b87e84..c7921c1ade 100644 --- a/src/ansys/acp/core/_tree_objects/linked_selection_rule.py +++ b/src/ansys/acp/core/_tree_objects/linked_selection_rule.py @@ -16,6 +16,7 @@ boolean_operation_type_from_pb, boolean_operation_type_to_pb, ) +from .geometrical_selection_rule import GeometricalSelectionRule from .parallel_selection_rule import ParallelSelectionRule from .spherical_selection_rule import SphericalSelectionRule from .tube_selection_rule import TubeSelectionRule @@ -31,6 +32,7 @@ CylindricalSelectionRule, SphericalSelectionRule, TubeSelectionRule, + GeometricalSelectionRule, VariableOffsetSelectionRule, BooleanSelectionRule, ] @@ -67,11 +69,12 @@ class LinkedSelectionRule(GenericEdgePropertyType): :class:`.CylindricalSelectionRule` ``radius`` \- :class:`.SphericalSelectionRule` ``radius`` \- :class:`.TubeSelectionRule` ``outer_radius`` ``inner_radius`` - (TODO: CutOffSelectionRule) \- \- - (TODO: GeometricalSelectionRule) (TODO: in-plane capture tolerance) \- + :class:`.GeometricalSelectionRule` ``in_plane_capture_tolerance`` \- :class:`.VariableOffsetSelectionRule` \- \- :class:`.BooleanSelectionRule` \- \- ====================================== ================================== =================== + + Note that ``CutoffSelectionRule`` and ``BooleanSelectionRule`` objects cannot be linked. """ def __init__( @@ -156,6 +159,7 @@ def _from_pb_object( CylindricalSelectionRule, SphericalSelectionRule, TubeSelectionRule, + GeometricalSelectionRule, VariableOffsetSelectionRule, BooleanSelectionRule, ] diff --git a/src/ansys/acp/core/_tree_objects/model.py b/src/ansys/acp/core/_tree_objects/model.py index 240b2d3faa..2f066a0110 100644 --- a/src/ansys/acp/core/_tree_objects/model.py +++ b/src/ansys/acp/core/_tree_objects/model.py @@ -13,10 +13,12 @@ base_pb2, boolean_selection_rule_pb2_grpc, cad_geometry_pb2_grpc, + cutoff_selection_rule_pb2_grpc, cylindrical_selection_rule_pb2_grpc, edge_set_pb2_grpc, element_set_pb2_grpc, fabric_pb2_grpc, + geometrical_selection_rule_pb2_grpc, lookup_table_1d_pb2_grpc, lookup_table_3d_pb2_grpc, material_pb2, @@ -54,11 +56,13 @@ from .base import TreeObject from .boolean_selection_rule import BooleanSelectionRule from .cad_geometry import CADGeometry +from .cutoff_selection_rule import CutoffSelectionRule from .cylindrical_selection_rule import CylindricalSelectionRule from .edge_set import EdgeSet from .element_set import ElementSet from .enums import UnitSystemType, unit_system_type_from_pb, unit_system_type_to_pb from .fabric import Fabric +from .geometrical_selection_rule import GeometricalSelectionRule from .lookup_table_1d import LookUpTable1D from .lookup_table_3d import LookUpTable3D from .material import Material @@ -339,6 +343,12 @@ def export_materials(self, path: _PATH) -> None: create_tube_selection_rule, tube_selection_rules = define_mutable_mapping( TubeSelectionRule, tube_selection_rule_pb2_grpc.ObjectServiceStub ) + create_cutoff_selection_rule, cutoff_selection_rules = define_mutable_mapping( + CutoffSelectionRule, cutoff_selection_rule_pb2_grpc.ObjectServiceStub + ) + create_geometrical_selection_rule, geometrical_selection_rules = define_mutable_mapping( + GeometricalSelectionRule, geometrical_selection_rule_pb2_grpc.ObjectServiceStub + ) create_variable_offset_selection_rule, variable_offset_selection_rules = define_mutable_mapping( VariableOffsetSelectionRule, variable_offset_selection_rule_pb2_grpc.ObjectServiceStub ) diff --git a/src/ansys/acp/core/_tree_objects/virtual_geometry.py b/src/ansys/acp/core/_tree_objects/virtual_geometry.py index f84bf242d5..acb9f67842 100644 --- a/src/ansys/acp/core/_tree_objects/virtual_geometry.py +++ b/src/ansys/acp/core/_tree_objects/virtual_geometry.py @@ -129,7 +129,7 @@ def _create_stub(self) -> virtual_geometry_pb2_grpc.ObjectServiceStub: ) def set_cad_components(self, cad_components: Iterable[CADComponent]) -> None: - """Set the sub-shapes to match the given CADComponents + """Set the sub-shapes to match the given CADComponents. Parameters ---------- diff --git a/tests/unittests/test_boolean_selection_rule.py b/tests/unittests/test_boolean_selection_rule.py index 5d13e82bb8..16ee703da7 100644 --- a/tests/unittests/test_boolean_selection_rule.py +++ b/tests/unittests/test_boolean_selection_rule.py @@ -70,6 +70,13 @@ def object_properties(parent_object): parameter_1=1.3, parameter_2=2.9, ), + LinkedSelectionRule( + selection_rule=model.create_geometrical_selection_rule(), + operation_type=BooleanOperationType.REMOVE, + template_rule=False, + parameter_1=1.5, + parameter_2=2.5, + ), LinkedSelectionRule( selection_rule=model.create_variable_offset_selection_rule(), operation_type=BooleanOperationType.ADD, diff --git a/tests/unittests/test_cutoff_selection_rule.py b/tests/unittests/test_cutoff_selection_rule.py new file mode 100644 index 0000000000..4f4af36509 --- /dev/null +++ b/tests/unittests/test_cutoff_selection_rule.py @@ -0,0 +1,65 @@ +import pytest + +from ansys.acp.core._tree_objects.cutoff_selection_rule import ( + CutoffSelectionRuleElementalData, + CutoffSelectionRuleNodalData, +) +from ansys.acp.core._tree_objects.enums import CutoffRuleType, PlyCutoffType + +from .common.tree_object_tester import NoLockedMixin, ObjectPropertiesToTest, TreeObjectTester + + +@pytest.fixture +def parent_object(load_model_from_tempfile): + with load_model_from_tempfile() as model: + yield model + + +@pytest.fixture +def tree_object(parent_object): + return parent_object.create_cutoff_selection_rule() + + +class TestCutoffSelectionRule(NoLockedMixin, TreeObjectTester): + COLLECTION_NAME = "cutoff_selection_rules" + DEFAULT_PROPERTIES = { + "status": "NOTUPTODATE", + "cutoff_rule_type": CutoffRuleType.GEOMETRY, + "cutoff_geometry": None, + "taper_edge_set": None, + "offset": 0.0, + "angle": 0.0, + "ply_cutoff_type": PlyCutoffType.PRODUCTION_PLY_CUTOFF, + "ply_tapering": False, + } + + CREATE_METHOD_NAME = "create_cutoff_selection_rule" + + @staticmethod + @pytest.fixture + def object_properties(parent_object): + model = parent_object + geometry = model.create_virtual_geometry() + edge_set = model.create_edge_set() + return ObjectPropertiesToTest( + read_write=[ + ("name", "Cutoff Selection Rule name"), + ("cutoff_rule_type", CutoffRuleType.TAPER), + ("cutoff_geometry", geometry), + ("taper_edge_set", edge_set), + ("offset", 1.2), + ("angle", 2.3), + ("ply_cutoff_type", PlyCutoffType.ANALYSIS_PLY_CUTOFF), + ("ply_tapering", True), + ], + read_only=[ + ("id", "some_id"), + ("status", "UPTODATE"), + ], + ) + + +def test_mesh_data(parent_object): + rule = parent_object.create_cutoff_selection_rule() + assert isinstance(rule.elemental_data, CutoffSelectionRuleElementalData) + assert isinstance(rule.nodal_data, CutoffSelectionRuleNodalData) diff --git a/tests/unittests/test_geometrical_selection_rule.py b/tests/unittests/test_geometrical_selection_rule.py new file mode 100644 index 0000000000..62b1dd4d8c --- /dev/null +++ b/tests/unittests/test_geometrical_selection_rule.py @@ -0,0 +1,67 @@ +import pytest + +from ansys.acp.core._tree_objects.enums import GeometricalRuleType +from ansys.acp.core._tree_objects.geometrical_selection_rule import ( + GeometricalSelectionRuleElementalData, + GeometricalSelectionRuleNodalData, +) + +from .common.tree_object_tester import NoLockedMixin, ObjectPropertiesToTest, TreeObjectTester + + +@pytest.fixture +def parent_object(load_model_from_tempfile): + with load_model_from_tempfile() as model: + yield model + + +@pytest.fixture +def tree_object(parent_object): + return parent_object.create_geometrical_selection_rule() + + +class TestGeometricalSelectionRule(NoLockedMixin, TreeObjectTester): + COLLECTION_NAME = "geometrical_selection_rules" + DEFAULT_PROPERTIES = { + "status": "NOTUPTODATE", + "geometrical_rule_type": GeometricalRuleType.GEOMETRY, + "geometry": None, + "element_sets": [], + "include_rule_type": True, + "use_default_tolerances": True, + "in_plane_capture_tolerance": 0.0, + "negative_capture_tolerance": 0.0, + "positive_capture_tolerance": 0.0, + } + + CREATE_METHOD_NAME = "create_geometrical_selection_rule" + + @staticmethod + @pytest.fixture + def object_properties(parent_object): + model = parent_object + geometry = model.create_virtual_geometry() + element_sets = [model.create_element_set() for _ in range(3)] + return ObjectPropertiesToTest( + read_write=[ + ("name", "Geometrical Selection Rule name"), + ("geometrical_rule_type", GeometricalRuleType.ELEMENT_SETS), + ("geometry", geometry), + ("element_sets", element_sets), + ("include_rule_type", False), + ("use_default_tolerances", False), + ("in_plane_capture_tolerance", 1.2), + ("negative_capture_tolerance", 2.3), + ("positive_capture_tolerance", 3.4), + ], + read_only=[ + ("id", "some_id"), + ("status", "UPTODATE"), + ], + ) + + +def test_mesh_data(parent_object): + rule = parent_object.create_geometrical_selection_rule() + assert isinstance(rule.elemental_data, GeometricalSelectionRuleElementalData) + assert isinstance(rule.nodal_data, GeometricalSelectionRuleNodalData)