Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add property rotation_angle to the Oriented Selection Set #315

Merged
merged 2 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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