Skip to content

Commit

Permalink
Add property rotation_angle to the Oriented Selection Set (#315)
Browse files Browse the repository at this point in the history
* Add property rotation_angle to the Oriented Selection Set

* update reference to ansys-api-acp
  • Loading branch information
roosre authored Nov 27, 2023
1 parent 6ccd17e commit 14068bf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/ansys/acp/core/_tree_objects/oriented_selection_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ def __init__(
draping_mesh_size: float = 0.0,
draping_material_model: DrapingMaterialType = DrapingMaterialType.WOVEN,
draping_ud_coefficient: float = 0.0,
rotation_angle: float = 0.0,
):
super().__init__(name=name)
self.element_sets = element_sets
Expand All @@ -140,6 +141,7 @@ def __init__(
self.draping_mesh_size = draping_mesh_size
self.draping_material_model = DrapingMaterialType(draping_material_model)
self.draping_ud_coefficient = draping_ud_coefficient
self.rotation_angle = rotation_angle

def _create_stub(self) -> oriented_selection_set_pb2_grpc.ObjectServiceStub:
return oriented_selection_set_pb2_grpc.ObjectServiceStub(self._channel)
Expand Down Expand Up @@ -187,6 +189,8 @@ def _create_stub(self) -> oriented_selection_set_pb2_grpc.ObjectServiceStub:
)
draping_ud_coefficient = grpc_data_property("properties.draping_ud_coefficient")

rotation_angle = grpc_data_property("properties.rotation_angle")

selection_rules = define_polymorphic_linked_object_list(
"properties.selection_rules",
allowed_types=(
Expand Down
2 changes: 2 additions & 0 deletions tests/unittests/test_oriented_selection_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class TestOrientedSelectionSet(NoLockedMixin, TreeObjectTester):
"draping_mesh_size": 0.0,
"draping_material_model": "woven",
"draping_ud_coefficient": 0.0,
"rotation_angle": 0.0,
}
CREATE_METHOD_NAME = "create_oriented_selection_set"

Expand Down Expand Up @@ -71,6 +72,7 @@ def object_properties(parent_object):
("draping_mesh_size", 0.1),
("draping_material_model", "ud"),
("draping_ud_coefficient", 0.5),
("rotation_angle", 22.35),
],
read_only=[
("id", "some_id"),
Expand Down

0 comments on commit 14068bf

Please sign in to comment.