From e6e14a390fa5e33ea3599ee197f1092d02e6fa90 Mon Sep 17 00:00:00 2001 From: Dominik Gresch Date: Wed, 23 Oct 2024 16:50:58 +0200 Subject: [PATCH 1/5] Add section cut --- doc/source/api/enum_types.rst | 3 + doc/source/api/tree_objects.rst | 1 + src/ansys/acp/core/_tree_objects/__init__.py | 8 + src/ansys/acp/core/_tree_objects/enums.py | 25 +++ .../acp/core/_tree_objects/section_cut.py | 208 ++++++++++++++++++ 5 files changed, 245 insertions(+) create mode 100644 src/ansys/acp/core/_tree_objects/section_cut.py diff --git a/doc/source/api/enum_types.rst b/doc/source/api/enum_types.rst index 1ba5f80310..3762cbec43 100644 --- a/doc/source/api/enum_types.rst +++ b/doc/source/api/enum_types.rst @@ -18,9 +18,11 @@ Enumeration data types EdgeSetType EdgeSetType ElementalDataType + ExtrusionType FeFormat GeometricalRuleType IgnorableEntity + IntersectionType LinkedObjectHandling LookUpTable3DInterpolationAlgorithm LookUpTableColumnValueType @@ -31,6 +33,7 @@ Enumeration data types PlyType RosetteSelectionMethod RosetteType + SectionCutType SensorType StatusType SymmetryType diff --git a/doc/source/api/tree_objects.rst b/doc/source/api/tree_objects.rst index d95ad469ac..bb0435530a 100644 --- a/doc/source/api/tree_objects.rst +++ b/doc/source/api/tree_objects.rst @@ -30,6 +30,7 @@ ACP objects ParallelSelectionRule ProductionPly Rosette + SectionCut Sensor SphericalSelectionRule Stackup diff --git a/src/ansys/acp/core/_tree_objects/__init__.py b/src/ansys/acp/core/_tree_objects/__init__.py index 0b86c423bb..0ffbecaad4 100644 --- a/src/ansys/acp/core/_tree_objects/__init__.py +++ b/src/ansys/acp/core/_tree_objects/__init__.py @@ -53,7 +53,9 @@ DropoffMaterialType, EdgeSetType, ElementalDataType, + ExtrusionType, GeometricalRuleType, + IntersectionType, LookUpTable3DInterpolationAlgorithm, LookUpTableColumnValueType, NodalDataType, @@ -63,6 +65,7 @@ PlyType, RosetteSelectionMethod, RosetteType, + SectionCutType, SensorType, StatusType, SymmetryType, @@ -99,6 +102,7 @@ ) from .production_ply import ProductionPly, ProductionPlyElementalData, ProductionPlyNodalData from .rosette import Rosette +from .section_cut import SectionCut from .sensor import Sensor from .spherical_selection_rule import ( SphericalSelectionRule, @@ -149,6 +153,7 @@ "ElementSet", "ElementSetElementalData", "ElementSetNodalData", + "ExtrusionType", "Fabric", "FabricWithAngle", "FeFormat", @@ -160,6 +165,7 @@ "IgnorableEntity", "InterfaceLayer", "InterpolationOptions", + "IntersectionType", "Lamina", "LinkedSelectionRule", "LookUpTable1D", @@ -197,6 +203,8 @@ "RosetteSelectionMethod", "RosetteType", "ScalarData", + "SectionCut", + "SectionCutType", "Sensor", "SensorType", "SphericalSelectionRule", diff --git a/src/ansys/acp/core/_tree_objects/enums.py b/src/ansys/acp/core/_tree_objects/enums.py index 9b7963fb36..fd9a089140 100644 --- a/src/ansys/acp/core/_tree_objects/enums.py +++ b/src/ansys/acp/core/_tree_objects/enums.py @@ -33,6 +33,7 @@ modeling_ply_pb2, ply_material_pb2, rosette_pb2, + section_cut_pb2, sensor_pb2, unit_system_pb2, virtual_geometry_pb2, @@ -51,7 +52,9 @@ "DropoffMaterialType", "EdgeSetType", "ElementalDataType", + "ExtrusionType", "GeometricalRuleType", + "IntersectionType", "LookUpTable3DInterpolationAlgorithm", "LookUpTableColumnValueType", "NodalDataType", @@ -61,6 +64,7 @@ "PlyType", "RosetteSelectionMethod", "RosetteType", + "SectionCutType", "SensorType", "StatusType", "SymmetryType", @@ -368,3 +372,24 @@ enum_types_pb2.FileFormat.STL, ), ) + +(ExtrusionType, extrusion_type_to_pb, extrusion_type_from_pb) = wrap_to_string_enum( + "ExtrusionType", + section_cut_pb2.ExtrusionType, + module=__name__, + doc="Extrusion method used in a section cut.", +) + +(SectionCutType, section_cut_type_to_pb, section_cut_type_from_pb) = wrap_to_string_enum( + "SectionCutType", + section_cut_pb2.SectionCutType, + module=__name__, + doc="Determines whether the section cut is extruded by modeling ply, production ply, or analysis ply.", +) + +(IntersectionType, intersection_type_to_pb, intersection_type_from_pb) = wrap_to_string_enum( + "IntersectionType", + section_cut_pb2.IntersectionType, + module=__name__, + doc="Determines how the intersection is computed for wireframe section cuts.", +) diff --git a/src/ansys/acp/core/_tree_objects/section_cut.py b/src/ansys/acp/core/_tree_objects/section_cut.py new file mode 100644 index 0000000000..07c99d9829 --- /dev/null +++ b/src/ansys/acp/core/_tree_objects/section_cut.py @@ -0,0 +1,208 @@ +# Copyright (C) 2022 - 2024 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +from __future__ import annotations + +from collections.abc import Sequence + +from ansys.api.acp.v0 import section_cut_pb2, section_cut_pb2_grpc + +from .._utils.array_conversions import to_1D_double_array, to_tuple_from_1D_array +from .._utils.property_protocols import ReadOnlyProperty, ReadWriteProperty +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, + mark_grpc_properties, +) +from .base import CreatableTreeObject, IdTreeObject +from .element_set import ElementSet +from .enums import ( + ExtrusionType, + IntersectionType, + SectionCutType, + extrusion_type_from_pb, + extrusion_type_to_pb, + intersection_type_from_pb, + intersection_type_to_pb, + section_cut_type_from_pb, + section_cut_type_to_pb, + status_type_from_pb, +) +from .object_registry import register + +__all__ = ["SectionCut"] + + +@mark_grpc_properties +@register +class SectionCut(CreatableTreeObject, IdTreeObject): + """Instantiate a Section Cut. + + Parameters + ---------- + name : + Name of the section cut. + active : + TODO + origin : + TODO + normal : + TODO + in_plane_reference_direction1 : + TODO + scope_entire_model : + TODO + scope_element_sets : + TODO + extrusion_type : + TODO + scale_factor : + TODO + core_scale_factor : + TODO + section_cut_type : + TODO + intersection_type : + TODO + use_default_tolerance : + TODO + tolerance : + TODO + use_default_interpolation_settings : + TODO + search_radius : + TODO + number_of_interpolation_points : + TODO + + """ + + __slots__ = () + + _COLLECTION_LABEL = "section_cuts" + _OBJECT_INFO_TYPE = section_cut_pb2.ObjectInfo + _CREATE_REQUEST_TYPE = section_cut_pb2.CreateRequest + _SUPPORTED_SINCE = "25.1" + + def __init__( + self, + *, + name: str = "SectionCut", + active: bool = True, + origin: tuple[float, float, float] = (0.0, 0.0, 0.0), + normal: tuple[float, float, float] = (0.0, 0.0, 1.0), + in_plane_reference_direction1: tuple[float, float, float] = (1.0, 0.0, 0.0), + scope_entire_model: bool = True, + scope_element_sets: Sequence[ElementSet] = tuple(), + extrusion_type: ExtrusionType = ExtrusionType.WIRE_FRAME, + scale_factor: float = 1.0, + core_scale_factor: float = 1.0, + section_cut_type: SectionCutType = SectionCutType.MODELING_PLY_WISE, + intersection_type: IntersectionType = IntersectionType.NORMAL_TO_SURFACE, + use_default_tolerance: bool = True, + tolerance: float = 0.0, + use_default_interpolation_settings: bool = True, + search_radius: float = 0.0, + number_of_interpolation_points: int = 1, + ) -> None: + super().__init__(name=name) + self.active = active + self.origin = origin + self.normal = normal + self.in_plane_reference_direction1 = in_plane_reference_direction1 + self.scope_entire_model = scope_entire_model + self.scope_element_sets = scope_element_sets + self.extrusion_type = extrusion_type + self.scale_factor = scale_factor + self.core_scale_factor = core_scale_factor + self.section_cut_type = section_cut_type + self.intersection_type = intersection_type + self.use_default_tolerance = use_default_tolerance + self.tolerance = tolerance + self.use_default_interpolation_settings = use_default_interpolation_settings + self.search_radius = search_radius + self.number_of_interpolation_points = number_of_interpolation_points + + def _create_stub(self) -> section_cut_pb2_grpc.ObjectServiceStub: + return section_cut_pb2_grpc.ObjectServiceStub(self._channel) + + # general properties + status = grpc_data_property_read_only("properties.status", from_protobuf=status_type_from_pb) + locked: ReadOnlyProperty[bool] = grpc_data_property_read_only("properties.locked") + active: ReadWriteProperty[bool, bool] = grpc_data_property("properties.active") + + # position properties + origin = grpc_data_property( + "properties.origin", from_protobuf=to_tuple_from_1D_array, to_protobuf=to_1D_double_array + ) + normal = grpc_data_property( + "properties.normal", from_protobuf=to_tuple_from_1D_array, to_protobuf=to_1D_double_array + ) + in_plane_reference_direction1 = grpc_data_property( + "properties.in_plane_reference_direction1", + from_protobuf=to_tuple_from_1D_array, + to_protobuf=to_1D_double_array, + ) + + # scoping properties + scope_entire_model: ReadWriteProperty[bool, bool] = grpc_data_property( + "properties.scope_entire_model" + ) + scope_element_sets = define_linked_object_list("properties.scope_element_sets", ElementSet) + + # extrusion properties + extrusion_type = grpc_data_property( + "properties.extrusion_type", + from_protobuf=extrusion_type_from_pb, + to_protobuf=extrusion_type_to_pb, + ) + scale_factor: ReadWriteProperty[float, float] = grpc_data_property("properties.scale_factor") + core_scale_factor: ReadWriteProperty[float, float] = grpc_data_property( + "properties.core_scale_factor" + ) + section_cut_type = grpc_data_property( + "properties.section_cut_type", + from_protobuf=section_cut_type_from_pb, + to_protobuf=section_cut_type_to_pb, + ) + + # wireframe properties + intersection_type = grpc_data_property( + "properties.intersection_type", + from_protobuf=intersection_type_from_pb, + to_protobuf=intersection_type_to_pb, + ) + + # surface properties - general + use_default_tolerance: ReadWriteProperty[bool, bool] = grpc_data_property( + "properties.use_default_tolerance" + ) + tolerance: ReadWriteProperty[float, float] = grpc_data_property("properties.tolerance") + # surface properties - sweep-based + use_default_interpolation_settings: ReadWriteProperty[bool, bool] = grpc_data_property( + "properties.use_default_interpolation_settings" + ) + search_radius: ReadWriteProperty[float, float] = grpc_data_property("properties.search_radius") + number_of_interpolation_points: ReadWriteProperty[int, int] = grpc_data_property( + "properties.number_of_interpolation_points" + ) From 021d7181883268c329e7b627cd6f7ead90c30f81 Mon Sep 17 00:00:00 2001 From: Dominik Gresch Date: Wed, 23 Oct 2024 17:20:35 +0200 Subject: [PATCH 2/5] Finish docstring --- src/ansys/acp/core/__init__.py | 8 +++ src/ansys/acp/core/_tree_objects/model.py | 10 ++++ .../acp/core/_tree_objects/section_cut.py | 53 +++++++++++++------ 3 files changed, 54 insertions(+), 17 deletions(-) diff --git a/src/ansys/acp/core/__init__.py b/src/ansys/acp/core/__init__.py index 2401fe59b6..e760e364cc 100644 --- a/src/ansys/acp/core/__init__.py +++ b/src/ansys/acp/core/__init__.py @@ -69,6 +69,7 @@ ElementSet, ElementSetElementalData, ElementSetNodalData, + ExtrusionType, Fabric, FabricWithAngle, FeFormat, @@ -78,6 +79,7 @@ GeometricalSelectionRuleNodalData, IgnorableEntity, InterfaceLayer, + IntersectionType, Lamina, LinkedSelectionRule, LookUpTable1D, @@ -114,6 +116,8 @@ RosetteSelectionMethod, RosetteType, ScalarData, + SectionCut, + SectionCutType, Sensor, SensorType, SphericalSelectionRule, @@ -181,6 +185,7 @@ "ElementSetElementalData", "ElementSetNodalData", "example_helpers", + "ExtrusionType", "Fabric", "FabricWithAngle", "FeFormat", @@ -194,6 +199,7 @@ "get_model_tree", "IgnorableEntity", "InterfaceLayer", + "IntersectionType", "Lamina", "launch_acp", "LaunchMode", @@ -236,6 +242,8 @@ "RosetteSelectionMethod", "RosetteType", "ScalarData", + "SectionCut", + "SectionCutType", "Sensor", "SensorType", "SphericalSelectionRule", diff --git a/src/ansys/acp/core/_tree_objects/model.py b/src/ansys/acp/core/_tree_objects/model.py index b083ecdf68..d4ba2aaa8f 100644 --- a/src/ansys/acp/core/_tree_objects/model.py +++ b/src/ansys/acp/core/_tree_objects/model.py @@ -55,6 +55,7 @@ parallel_selection_rule_pb2_grpc, ply_geometry_export_pb2, rosette_pb2_grpc, + section_cut_pb2_grpc, sensor_pb2_grpc, spherical_selection_rule_pb2_grpc, stackup_pb2_grpc, @@ -120,6 +121,7 @@ from .oriented_selection_set import OrientedSelectionSet from .parallel_selection_rule import ParallelSelectionRule from .rosette import Rosette +from .section_cut import SectionCut from .sensor import Sensor from .spherical_selection_rule import SphericalSelectionRule from .stackup import Stackup @@ -708,6 +710,14 @@ def export_modeling_ply_geometries( ModelingGroup, modeling_group_pb2_grpc.ObjectServiceStub ) + create_section_cut = define_create_method( + SectionCut, + func_name="create_section_cut", + parent_class_name="Model", + module_name=__module__, + ) + section_cuts = define_mutable_mapping(SectionCut, section_cut_pb2_grpc.ObjectServiceStub) + create_sensor = define_create_method( Sensor, func_name="create_sensor", parent_class_name="Model", module_name=__module__ ) diff --git a/src/ansys/acp/core/_tree_objects/section_cut.py b/src/ansys/acp/core/_tree_objects/section_cut.py index 07c99d9829..254c2903b2 100644 --- a/src/ansys/acp/core/_tree_objects/section_cut.py +++ b/src/ansys/acp/core/_tree_objects/section_cut.py @@ -56,44 +56,63 @@ @mark_grpc_properties @register class SectionCut(CreatableTreeObject, IdTreeObject): - """Instantiate a Section Cut. + r"""Instantiate a Section Cut. Parameters ---------- name : Name of the section cut. active : - TODO + Inactive section cuts are not evaluated. origin : - TODO + Defines the origin of the section cut plane. normal : - TODO + Defines the normal vector of the section cut plane. in_plane_reference_direction1 : - TODO + Defines the in-plane transverse direction of the beam. Used for the surface + section cut and section cut measures. scope_entire_model : - TODO + If True, the section cut is applied to the entire model. Otherwise, the + section cut is applied only to the element sets specified in + ``scope_element_sets``. scope_element_sets : - TODO + The element sets to which the section cut is applied. Used only if + ``scope_entire_model`` is False. extrusion_type : - TODO + Determines the extrusion method used to create the section cut. scale_factor : - TODO + Scale factor applied to the ply thicknesses. core_scale_factor : - TODO + Scale factor applied to the core thicknesses. section_cut_type : - TODO + Determines whether the section cut is extruded by modeling ply, production + ply, or analysis ply. intersection_type : - TODO + Determines the method used to compute a wire frame section cut. Used only + if ``extrusion_type`` is ``ExtrusionType.WIRE_FRAME``. use_default_tolerance : - TODO + If True, the segment tolerance is computed as 0.1\% of the averaged element size. + Otherwise, the ``tolerance`` value is used. + Used only if ``extrusion_type`` is ``ExtrusionType.SURFACE_NORMAL`` or + ``ExtrusionType.SURFACE_SWEEP_BASED``. tolerance : - TODO + Defines the minimum length of the segments. Segments shorter than this value + are merged. + Used only if ``extrusion_type`` is ``ExtrusionType.SURFACE_NORMAL`` or + ``ExtrusionType.SURFACE_SWEEP_BASED``, and ``use_default_tolerance`` is + False. use_default_interpolation_settings : - TODO + If True, default interpolation settings are used by the sweep-based extrusion. + Used only if ``extrusion_type`` is ``ExtrusionType.SURFACE_SWEEP_BASED``. search_radius : - TODO + Search radius of the interpolation algorithm used in the sweep-based extrusion. + Used only if ``extrusion_type`` is ``ExtrusionType.SURFACE_SWEEP_BASED`` and + ``use_default_interpolation_settings`` is False. number_of_interpolation_points : - TODO + Number of interpolation points of the interpolation algorithm used in the + sweep-based extrusion. + Used only if ``extrusion_type`` is ``ExtrusionType.SURFACE_SWEEP_BASED`` and + ``use_default_interpolation_settings`` is False. """ From 1dc4d600d291a8ab433bdfc623ec9fd239ed87ee Mon Sep 17 00:00:00 2001 From: Dominik Gresch Date: Wed, 23 Oct 2024 17:35:13 +0200 Subject: [PATCH 3/5] Add tests for section cut --- tests/unittests/test_section_cut.py | 104 ++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 tests/unittests/test_section_cut.py diff --git a/tests/unittests/test_section_cut.py b/tests/unittests/test_section_cut.py new file mode 100644 index 0000000000..c8e97b107a --- /dev/null +++ b/tests/unittests/test_section_cut.py @@ -0,0 +1,104 @@ +# Copyright (C) 2022 - 2024 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +import math + +import pytest + +from ansys.acp.core import ExtrusionType, IntersectionType, SectionCutType + +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_section_cut() + + +class TestSectionCut(NoLockedMixin, TreeObjectTester): + COLLECTION_NAME = "section_cuts" + CREATE_METHOD_NAME = "create_section_cut" + + @staticmethod + @pytest.fixture + def default_properties(): + return { + "status": "NOTUPTODATE", + "locked": False, + "active": True, + "origin": (0, 0, 0), + "normal": (0, 0, 1), + "in_plane_reference_direction1": (1, 0, 0), + "scope_entire_model": True, + "scope_element_sets": [], + "extrusion_type": ExtrusionType.WIRE_FRAME, + "scale_factor": 1.0, + "core_scale_factor": 1.0, + "section_cut_type": SectionCutType.MODELING_PLY_WISE, + "intersection_type": IntersectionType.NORMAL_TO_SURFACE, + "use_default_tolerance": True, + "tolerance": 0.0, + "use_default_interpolation_settings": True, + "search_radius": 0.0, + "number_of_interpolation_points": 1, + } + + @staticmethod + @pytest.fixture + def object_properties(parent_object): + return ObjectPropertiesToTest( + read_write=[ + ("name", "new_name"), + ("active", False), + ("origin", (0.1, 0.2, 0.3)), + ("normal", (0, 1.0 / math.sqrt(2), 1.0 / math.sqrt(2))), + ("in_plane_reference_direction1", (math.sqrt(1 / 3), math.sqrt(2 / 3), 0)), + ("scope_entire_model", False), + ( + "scope_element_sets", + [parent_object.create_element_set(), parent_object.create_element_set()], + ), + ("extrusion_type", ExtrusionType.SURFACE_NORMAL), + ("extrusion_type", ExtrusionType.SURFACE_SWEEP_BASED), + ("scale_factor", 1.5), + ("core_scale_factor", 12.3), + ("section_cut_type", SectionCutType.PRODUCTION_PLY_WISE), + ("section_cut_type", SectionCutType.ANALYSIS_PLY_WISE), + ("intersection_type", IntersectionType.IN_PLANE), + ("use_default_tolerance", False), + ("tolerance", 0.6), + ("use_default_interpolation_settings", False), + ("search_radius", 12.3), + ("number_of_interpolation_points", 5), + ], + read_only=[ + ("id", "some_id"), + ("status", "UPTODATE"), + ("locked", True), + ], + ) From b11846f9a30c8bc758d3e59e1d939b81df0c7cda Mon Sep 17 00:00:00 2001 From: Dominik Gresch Date: Wed, 23 Oct 2024 17:39:26 +0200 Subject: [PATCH 4/5] Skip tests on 24R2 --- tests/unittests/test_section_cut.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/unittests/test_section_cut.py b/tests/unittests/test_section_cut.py index c8e97b107a..864585ef3a 100644 --- a/tests/unittests/test_section_cut.py +++ b/tests/unittests/test_section_cut.py @@ -22,13 +22,20 @@ import math +from packaging.version import parse as parse_version import pytest -from ansys.acp.core import ExtrusionType, IntersectionType, SectionCutType +from ansys.acp.core import ExtrusionType, IntersectionType, SectionCut, SectionCutType from .common.tree_object_tester import NoLockedMixin, ObjectPropertiesToTest, TreeObjectTester +@pytest.fixture(autouse=True) +def skip_if_unsupported_version(acp_instance): + if parse_version(acp_instance.server_version) < parse_version(SectionCut._SUPPORTED_SINCE): + pytest.skip("InterfaceLayer is not supported on this version of the server.") + + @pytest.fixture def parent_object(load_model_from_tempfile): with load_model_from_tempfile() as model: From e80c72cf7f1ad5fd4c09e7db5a609174ea3248ff Mon Sep 17 00:00:00 2001 From: Dominik Gresch Date: Mon, 28 Oct 2024 10:30:42 +0100 Subject: [PATCH 5/5] Update section cut limitation --- doc/source/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/index.rst b/doc/source/index.rst index 3cfe23eaf0..799731da1f 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -78,4 +78,4 @@ Limitations * Only shell workflows are supported, solid models can not yet be defined using PyACP * FieldDefinitions for variable material properties are not supported -* Section cuts are not supported +* Section cuts cannot be visualized