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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
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
205
206
207
208
209
210
211
212
213
214
215
216
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

to_dict()

Convert the Group object into a dictionary.

Source code in npxpy/nodes/space.py
218
219
220
221
222
223
224
225
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