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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
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
217
218
219
220
221
222
223
224
225
226
227
228
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
230
231
232
233
234
235
236
237
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