Skip to content

npxpy.nodes.space.Group

Bases: _GatekeeperSpace

Class representing a group node.

Attributes:

Name Type Description
position List[float]

Position of the group [x, y, z].

rotation List[float]

Rotation of the group [psi, theta, phi].

Source code in npxpy/nodes/space.py
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
class Group(_GatekeeperSpace):
    """
    Class representing a group node.

    Attributes:
        position (List[float]): Position of the group [x, y, z].
        rotation (List[float]): Rotation of the group [psi, theta, phi].
    """

    def __init__(
        self,
        name: str = "Group",
        position: List[float] = [0, 0, 0],
        rotation: List[float] = [0.0, 0.0, 0.0],
    ):
        """
        Initialize a Group node.
        """
        super().__init__("group", name)
        self.position = position
        self.rotation = rotation

    def _to_dict(self) -> Dict:
        """
        Convert the Group object into a dictionary.
        """
        node_dict = super()._to_dict()
        node_dict["position"] = self.position
        node_dict["rotation"] = self.rotation
        return node_dict

__init__(name='Group', position=[0, 0, 0], rotation=[0.0, 0.0, 0.0])

Initialize a Group node.

Source code in npxpy/nodes/space.py
199
200
201
202
203
204
205
206
207
208
209
210
def __init__(
    self,
    name: str = "Group",
    position: List[float] = [0, 0, 0],
    rotation: List[float] = [0.0, 0.0, 0.0],
):
    """
    Initialize a Group node.
    """
    super().__init__("group", name)
    self.position = position
    self.rotation = rotation