-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCylinderZone.py
More file actions
43 lines (31 loc) · 1.22 KB
/
Copy pathCylinderZone.py
File metadata and controls
43 lines (31 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
"""CylinderZone definition file."""
from parapy.core import Input, Part
from parapy.geom import Cylinder, Position
from model.Zone import Zone
class CylinderZone(Zone):
"""Represents a zone in the shape of a cylinder.
Builds upon the Zone superclass. Defines the shape of the zone. All other functionalities are in the Zone class.
"""
radius: float = Input(100)
height: float = Input(100)
@radius.on_slot_change
def radius_on_change(self) -> None:
"""Update the nodes inside the zone when the radius slot is changed."""
self.update_nodes_inside_zone()
@height.on_slot_change
def height_on_change(self) -> None:
"""Update the nodes inside the zone when the height slot is changed."""
self.update_nodes_inside_zone()
@Part
def shape(self) -> Cylinder:
"""Define the shape of the Zone."""
return Cylinder(
radius=self.radius,
height=self.height,
position=Position(
location=self.position.location, orientation=self.orientation
),
centered=True,
color=self.color,
transparency=self.transparency,
)