Skip to content

npxpy.nodes.structures.Lens

Bases: Structure

A class representing a lens node with specific optical properties.

Attributes:

Name Type Description
radius Union[float, int]

The radius of the lens.

height Union[float, int]

The height of the lens.

crop_base bool

Flag indicating whether the base of the lens should be cropped.

asymmetric bool

Flag indicating whether the lens is asymmetric.

curvature Union[float, int]

The curvature of the lens.

conic_constant Union[float, int]

The conic constant of the lens.

curvature_y Union[float, int]

The curvature of the lens in the Y direction (for asymmetric lenses).

conic_constant_y Union[float, int]

The conic constant in the Y direction.

nr_radial_segments int

The number of radial segments.

nr_phi_segments int

The number of phi segments.

Source code in npxpy/nodes/structures.py
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
class Lens(Structure):
    """
    A class representing a lens node with specific optical properties.

    Attributes:
        radius (Union[float, int]): The radius of the lens.
        height (Union[float, int]): The height of the lens.
        crop_base (bool): Flag indicating whether the base of the lens should be cropped.
        asymmetric (bool): Flag indicating whether the lens is asymmetric.
        curvature (Union[float, int]): The curvature of the lens.
        conic_constant (Union[float, int]): The conic constant of the lens.
        curvature_y (Union[float, int]): The curvature of the lens in the Y direction (for asymmetric lenses).
        conic_constant_y (Union[float, int]): The conic constant in the Y direction.
        nr_radial_segments (int): The number of radial segments.
        nr_phi_segments (int): The number of phi segments.
    """

    def __init__(
        self,
        preset: Preset,
        name: str = "Lens",
        radius: Union[float, int] = 100.0,
        height: Union[float, int] = 50.0,
        crop_base: bool = False,
        asymmetric: bool = False,
        curvature: Union[float, int] = 0.01,
        conic_constant: Union[float, int] = 0.01,
        curvature_y: Union[float, int] = 0.01,
        conic_constant_y: Union[float, int] = -1.0,
        nr_radial_segments: int = 500,
        nr_phi_segments: int = 360,
        slicing_origin: str = "scene_bottom",
        slicing_offset: Union[float, int] = 0.0,
        priority: int = 0,
        expose_individually: bool = False,
        position: List[Union[float, int]] = [0.0, 0.0, 0.0],
        rotation: List[Union[float, int]] = [0.0, 0.0, 0.0],
        color="lightblue",
    ):
        """
        Initialize a Lens node with optical properties.

        Parameters:
            preset (Preset): The preset associated with the lens.
            name (str): The name of the lens.
            radius (Union[float, int]): The radius of the lens. Must be > 0.
            height (Union[float, int]): The height of the lens. Must be > 0.
            crop_base (bool): Whether to crop the base of the lens.
            asymmetric (bool): Whether the lens is asymmetric.
            curvature (Union[float, int]): The curvature of the lens.
            conic_constant (Union[float, int]): The conic constant of the lens.
            curvature_y (Union[float, int]): The curvature in the Y direction (if asymmetric).
            conic_constant_y (Union[float, int]): The conic constant in the Y direction.
            nr_radial_segments (int): The number of radial segments.
            nr_phi_segments (int): The number of phi segments.
            slicing_origin (str): The slicing origin.
            slicing_offset (Union[float, int]): The slicing offset.
            priority (int): The priority of the lens.
            expose_individually (bool): Whether to expose the lens individually.
            position (List[Union[float, int]]): The position of the lens [x, y, z].
            rotation (List[Union[float, int]]): The rotation of the lens [psi, theta, phi].
        """
        super().__init__(
            preset=preset,
            mesh=None,
            name=name,
            slicing_origin=slicing_origin,
            slicing_offset=slicing_offset,
            priority=priority,
            expose_individually=expose_individually,
            rotation=rotation,
            position=position,
            color=color,
        )

        # Setters for validation
        self.radius = radius
        self.height = height
        self.crop_base = crop_base
        self.asymmetric = asymmetric
        self.curvature = curvature
        self.conic_constant = conic_constant
        self.curvature_y = curvature_y
        self.conic_constant_y = conic_constant_y
        self.nr_radial_segments = nr_radial_segments
        self.nr_phi_segments = nr_phi_segments

        self.polynomial_type = "Normalized"
        self.polynomial_factors = []
        self.polynomial_factors_y = []

        self.surface_compensation_factors = []
        self.surface_compensation_factors_y = []

        self.load_mesh = False
        self.load_preset = True

        #  This guy sits in Structure. Ensures no mesh is passed.
        self._mesh = False

    # Setters with validation for Lens-specific attributes
    @property
    def radius(self):
        """The radius of the lens."""
        return self._radius

    @radius.setter
    def radius(self, value: Union[float, int]):
        if not isinstance(value, (float, int)) or value <= 0:
            raise ValueError("radius must be a positive number.")
        self._radius = value

    @property
    def height(self):
        """The height of the lens."""
        return self._height

    @height.setter
    def height(self, value: Union[float, int]):
        if not isinstance(value, (float, int)) or value <= 0:
            raise ValueError("height must be a positive number.")
        self._height = value

    @property
    def crop_base(self):
        """Whether the lens base should be cropped."""
        return self._crop_base

    @crop_base.setter
    def crop_base(self, value: bool):
        if not isinstance(value, bool):
            raise TypeError("crop_base must be a boolean.")
        self._crop_base = value

    @property
    def asymmetric(self):
        """Whether the lens is asymmetric."""
        return self._asymmetric

    @asymmetric.setter
    def asymmetric(self, value: bool):
        if not isinstance(value, bool):
            raise TypeError("asymmetric must be a boolean.")
        self._asymmetric = value

    @property
    def curvature(self):
        """The curvature of the lens."""
        return self._curvature

    @curvature.setter
    def curvature(self, value: Union[float, int]):
        if not isinstance(value, (float, int)):
            raise TypeError("curvature must be a float or an int.")
        self._curvature = value

    @property
    def conic_constant(self):
        """The conic constant of the lens."""
        return self._conic_constant

    @conic_constant.setter
    def conic_constant(self, value: Union[float, int]):
        if not isinstance(value, (float, int)):
            raise TypeError("conic_constant must be a float or an int.")
        self._conic_constant = value

    @property
    def curvature_y(self):
        """The curvature of the lens in the Y direction."""
        return self._curvature_y

    @curvature_y.setter
    def curvature_y(self, value: Union[float, int]):
        if not isinstance(value, (float, int)):
            raise TypeError("curvature_y must be a float or an int.")
        self._curvature_y = value

    @property
    def conic_constant_y(self):
        """The conic constant in the Y direction."""
        return self._conic_constant_y

    @conic_constant_y.setter
    def conic_constant_y(self, value: Union[float, int]):
        if not isinstance(value, (float, int)):
            raise TypeError("conic_constant_y must be a float or an int.")
        self._conic_constant_y = value

    @property
    def nr_radial_segments(self):
        """The number of radial segments for the lens."""
        return self._nr_radial_segments

    @nr_radial_segments.setter
    def nr_radial_segments(self, value: int):
        if not isinstance(value, int):
            raise TypeError("nr_radial_segments must be an int.")
        self._nr_radial_segments = value

    @property
    def nr_phi_segments(self):
        """The number of phi segments for the lens."""
        return self._nr_phi_segments

    @nr_phi_segments.setter
    def nr_phi_segments(self, value: int):
        if not isinstance(value, int):
            raise TypeError("nr_phi_segments must be an int.")
        self._nr_phi_segments = value

    @property
    def polynomial_type(self):
        """The type of polynomial ('Normalized' or 'Standard')."""
        return self._polynomial_type

    @polynomial_type.setter
    def polynomial_type(self, value: str):
        if value not in ["Normalized", "Standard"]:
            raise ValueError(
                "polynomial_type must be either 'Normalized' or 'Standard'."
            )
        self._polynomial_type = value

    @property
    def polynomial_factors(self):
        """List of polynomial factors."""
        return self._polynomial_factors

    @polynomial_factors.setter
    def polynomial_factors(self, value: List[Union[float, int]]):
        if not all(isinstance(f, (float, int)) for f in value):
            raise TypeError(
                "All polynomial_factors elements must be float or int."
            )
        self._polynomial_factors = value

    @property
    def polynomial_factors_y(self):
        """Polynomial factors for Y axis (if asymmetric)."""
        return self._polynomial_factors_y

    @polynomial_factors_y.setter
    def polynomial_factors_y(self, value: List[Union[float, int]]):
        if not all(isinstance(f, (float, int)) for f in value):
            raise TypeError(
                "All polynomial_factors_y elements must be float or int."
            )
        self._polynomial_factors_y = value

    # Setters for surface_compensation_factors and surface_compensation_factors_y

    @property
    def surface_compensation_factors(self):
        """List of surface compensation factors."""
        return self._surface_compensation_factors

    @surface_compensation_factors.setter
    def surface_compensation_factors(self, value: List[Union[float, int]]):
        if not all(isinstance(f, (float, int)) for f in value):
            raise TypeError(
                "All surface_compensation_factors elements must be float or int."
            )
        self._surface_compensation_factors = value

    @property
    def surface_compensation_factors_y(self):
        """Surface compensation factors for Y axis (if asymmetric)."""
        return self._surface_compensation_factors_y

    @surface_compensation_factors_y.setter
    def surface_compensation_factors_y(self, value: List[Union[float, int]]):
        if not all(isinstance(f, (float, int)) for f in value):
            raise TypeError(
                "All surface_compensation_factors_y elements must be float or int."
            )
        self._surface_compensation_factors_y = value

    def polynomial(
        self,
        polynomial_type: str = "Normalized",
        polynomial_factors: List[Union[float, int]] = [0, 0, 0],
        polynomial_factors_y: List[Union[float, int]] = [0, 0, 0],
    ):
        """
        Set the polynomial factors for the lens.

        Parameters:
            polynomial_type (str): The type of polynomial.
            polynomial_factors (List[Union[float, int]]):
                List of polynomial factors.
            polynomial_factors_y (List[Union[float, int]]):
                Polynomial factors for Y axis (if asymmetric).

        Returns:
            self: The updated Lens object.
        """
        self.polynomial_type = polynomial_type  # Use setter for validation
        self.polynomial_factors = (
            polynomial_factors  # Use setter for validation
        )
        if self.asymmetric:
            self.polynomial_factors_y = (
                polynomial_factors_y  # Use setter for validation
            )
        return self

    def surface_compensation(
        self,
        surface_compensation_factors: List[Union[float, int]] = [0, 0, 0],
        surface_compensation_factors_y: List[Union[float, int]] = [0, 0, 0],
    ):
        """
        Set the surface compensation factors for the lens.

        Parameters:
            surface_compensation_factors (List[Union[float, int]]):
                Surface compensation factors.
            surface_compensation_factors_y (List[Union[float, int]]):
                Surface compensation factors for Y axis (if asymmetric).

        Returns:
            self: The updated Lens object.
        """
        self.surface_compensation_factors = (
            surface_compensation_factors  # Use setter for validation
        )
        if self.asymmetric:
            self.surface_compensation_factors_y = (
                surface_compensation_factors_y  # Use setter for validation
            )
        return self

    def auto_load(
        self,
        project: Project,
    ):
        """
        Load passed presets to passed project if the flags are set.
        """
        self.project = project

        if self.load_preset:
            self.project.load_presets(self.preset)

        if self.load_mesh:
            if self.mesh._type != "mesh_file":
                raise TypeError(
                    "Images are used only for MarkerAligner class."
                )
            self.project.load_resources(self.mesh)
        return self

    def to_dict(self) -> dict:
        """
        Convert the lens to a dictionary representation.

        Returns:
            dict: The dictionary representation of the lens.
        """
        self.geometry = {
            "type": "lens",
            "radius": self.radius,
            "height": self.height,
            "crop_base": self.crop_base,
            "asymmetric": self.asymmetric,
            "curvature": self.curvature,
            "conic_constant": self.conic_constant,
            "curvature_y": self.curvature_y,
            "conic_constant_y": self.conic_constant_y,
            "polynomial_type": self.polynomial_type,
            "polynomial_factors": self.polynomial_factors,
            "polynomial_factors_y": self.polynomial_factors_y,
            "surface_compensation_factors": self.surface_compensation_factors,
            "surface_compensation_factors_y": self.surface_compensation_factors_y,
            "nr_radial_segments": self.nr_radial_segments,
            "nr_phi_segments": self.nr_phi_segments,
        }

        node_dict = super().to_dict()
        node_dict["geometry"] = self.geometry
        return node_dict

asymmetric property writable

Whether the lens is asymmetric.

conic_constant property writable

The conic constant of the lens.

conic_constant_y property writable

The conic constant in the Y direction.

crop_base property writable

Whether the lens base should be cropped.

curvature property writable

The curvature of the lens.

curvature_y property writable

The curvature of the lens in the Y direction.

height property writable

The height of the lens.

nr_phi_segments property writable

The number of phi segments for the lens.

nr_radial_segments property writable

The number of radial segments for the lens.

polynomial_factors property writable

List of polynomial factors.

polynomial_factors_y property writable

Polynomial factors for Y axis (if asymmetric).

polynomial_type property writable

The type of polynomial ('Normalized' or 'Standard').

radius property writable

The radius of the lens.

surface_compensation_factors property writable

List of surface compensation factors.

surface_compensation_factors_y property writable

Surface compensation factors for Y axis (if asymmetric).

__init__(preset, name='Lens', radius=100.0, height=50.0, crop_base=False, asymmetric=False, curvature=0.01, conic_constant=0.01, curvature_y=0.01, conic_constant_y=-1.0, nr_radial_segments=500, nr_phi_segments=360, slicing_origin='scene_bottom', slicing_offset=0.0, priority=0, expose_individually=False, position=[0.0, 0.0, 0.0], rotation=[0.0, 0.0, 0.0], color='lightblue')

Initialize a Lens node with optical properties.

Parameters:

Name Type Description Default
preset Preset

The preset associated with the lens.

required
name str

The name of the lens.

'Lens'
radius Union[float, int]

The radius of the lens. Must be > 0.

100.0
height Union[float, int]

The height of the lens. Must be > 0.

50.0
crop_base bool

Whether to crop the base of the lens.

False
asymmetric bool

Whether the lens is asymmetric.

False
curvature Union[float, int]

The curvature of the lens.

0.01
conic_constant Union[float, int]

The conic constant of the lens.

0.01
curvature_y Union[float, int]

The curvature in the Y direction (if asymmetric).

0.01
conic_constant_y Union[float, int]

The conic constant in the Y direction.

-1.0
nr_radial_segments int

The number of radial segments.

500
nr_phi_segments int

The number of phi segments.

360
slicing_origin str

The slicing origin.

'scene_bottom'
slicing_offset Union[float, int]

The slicing offset.

0.0
priority int

The priority of the lens.

0
expose_individually bool

Whether to expose the lens individually.

False
position List[Union[float, int]]

The position of the lens [x, y, z].

[0.0, 0.0, 0.0]
rotation List[Union[float, int]]

The rotation of the lens [psi, theta, phi].

[0.0, 0.0, 0.0]
Source code in npxpy/nodes/structures.py
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
def __init__(
    self,
    preset: Preset,
    name: str = "Lens",
    radius: Union[float, int] = 100.0,
    height: Union[float, int] = 50.0,
    crop_base: bool = False,
    asymmetric: bool = False,
    curvature: Union[float, int] = 0.01,
    conic_constant: Union[float, int] = 0.01,
    curvature_y: Union[float, int] = 0.01,
    conic_constant_y: Union[float, int] = -1.0,
    nr_radial_segments: int = 500,
    nr_phi_segments: int = 360,
    slicing_origin: str = "scene_bottom",
    slicing_offset: Union[float, int] = 0.0,
    priority: int = 0,
    expose_individually: bool = False,
    position: List[Union[float, int]] = [0.0, 0.0, 0.0],
    rotation: List[Union[float, int]] = [0.0, 0.0, 0.0],
    color="lightblue",
):
    """
    Initialize a Lens node with optical properties.

    Parameters:
        preset (Preset): The preset associated with the lens.
        name (str): The name of the lens.
        radius (Union[float, int]): The radius of the lens. Must be > 0.
        height (Union[float, int]): The height of the lens. Must be > 0.
        crop_base (bool): Whether to crop the base of the lens.
        asymmetric (bool): Whether the lens is asymmetric.
        curvature (Union[float, int]): The curvature of the lens.
        conic_constant (Union[float, int]): The conic constant of the lens.
        curvature_y (Union[float, int]): The curvature in the Y direction (if asymmetric).
        conic_constant_y (Union[float, int]): The conic constant in the Y direction.
        nr_radial_segments (int): The number of radial segments.
        nr_phi_segments (int): The number of phi segments.
        slicing_origin (str): The slicing origin.
        slicing_offset (Union[float, int]): The slicing offset.
        priority (int): The priority of the lens.
        expose_individually (bool): Whether to expose the lens individually.
        position (List[Union[float, int]]): The position of the lens [x, y, z].
        rotation (List[Union[float, int]]): The rotation of the lens [psi, theta, phi].
    """
    super().__init__(
        preset=preset,
        mesh=None,
        name=name,
        slicing_origin=slicing_origin,
        slicing_offset=slicing_offset,
        priority=priority,
        expose_individually=expose_individually,
        rotation=rotation,
        position=position,
        color=color,
    )

    # Setters for validation
    self.radius = radius
    self.height = height
    self.crop_base = crop_base
    self.asymmetric = asymmetric
    self.curvature = curvature
    self.conic_constant = conic_constant
    self.curvature_y = curvature_y
    self.conic_constant_y = conic_constant_y
    self.nr_radial_segments = nr_radial_segments
    self.nr_phi_segments = nr_phi_segments

    self.polynomial_type = "Normalized"
    self.polynomial_factors = []
    self.polynomial_factors_y = []

    self.surface_compensation_factors = []
    self.surface_compensation_factors_y = []

    self.load_mesh = False
    self.load_preset = True

    #  This guy sits in Structure. Ensures no mesh is passed.
    self._mesh = False

auto_load(project)

Load passed presets to passed project if the flags are set.

Source code in npxpy/nodes/structures.py
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
def auto_load(
    self,
    project: Project,
):
    """
    Load passed presets to passed project if the flags are set.
    """
    self.project = project

    if self.load_preset:
        self.project.load_presets(self.preset)

    if self.load_mesh:
        if self.mesh._type != "mesh_file":
            raise TypeError(
                "Images are used only for MarkerAligner class."
            )
        self.project.load_resources(self.mesh)
    return self

polynomial(polynomial_type='Normalized', polynomial_factors=[0, 0, 0], polynomial_factors_y=[0, 0, 0])

Set the polynomial factors for the lens.

Parameters:

Name Type Description Default
polynomial_type str

The type of polynomial.

'Normalized'
polynomial_factors List[Union[float, int]]

List of polynomial factors.

[0, 0, 0]
polynomial_factors_y List[Union[float, int]]

Polynomial factors for Y axis (if asymmetric).

[0, 0, 0]

Returns:

Name Type Description
self

The updated Lens object.

Source code in npxpy/nodes/structures.py
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
def polynomial(
    self,
    polynomial_type: str = "Normalized",
    polynomial_factors: List[Union[float, int]] = [0, 0, 0],
    polynomial_factors_y: List[Union[float, int]] = [0, 0, 0],
):
    """
    Set the polynomial factors for the lens.

    Parameters:
        polynomial_type (str): The type of polynomial.
        polynomial_factors (List[Union[float, int]]):
            List of polynomial factors.
        polynomial_factors_y (List[Union[float, int]]):
            Polynomial factors for Y axis (if asymmetric).

    Returns:
        self: The updated Lens object.
    """
    self.polynomial_type = polynomial_type  # Use setter for validation
    self.polynomial_factors = (
        polynomial_factors  # Use setter for validation
    )
    if self.asymmetric:
        self.polynomial_factors_y = (
            polynomial_factors_y  # Use setter for validation
        )
    return self

surface_compensation(surface_compensation_factors=[0, 0, 0], surface_compensation_factors_y=[0, 0, 0])

Set the surface compensation factors for the lens.

Parameters:

Name Type Description Default
surface_compensation_factors List[Union[float, int]]

Surface compensation factors.

[0, 0, 0]
surface_compensation_factors_y List[Union[float, int]]

Surface compensation factors for Y axis (if asymmetric).

[0, 0, 0]

Returns:

Name Type Description
self

The updated Lens object.

Source code in npxpy/nodes/structures.py
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
def surface_compensation(
    self,
    surface_compensation_factors: List[Union[float, int]] = [0, 0, 0],
    surface_compensation_factors_y: List[Union[float, int]] = [0, 0, 0],
):
    """
    Set the surface compensation factors for the lens.

    Parameters:
        surface_compensation_factors (List[Union[float, int]]):
            Surface compensation factors.
        surface_compensation_factors_y (List[Union[float, int]]):
            Surface compensation factors for Y axis (if asymmetric).

    Returns:
        self: The updated Lens object.
    """
    self.surface_compensation_factors = (
        surface_compensation_factors  # Use setter for validation
    )
    if self.asymmetric:
        self.surface_compensation_factors_y = (
            surface_compensation_factors_y  # Use setter for validation
        )
    return self

to_dict()

Convert the lens to a dictionary representation.

Returns:

Name Type Description
dict dict

The dictionary representation of the lens.

Source code in npxpy/nodes/structures.py
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
def to_dict(self) -> dict:
    """
    Convert the lens to a dictionary representation.

    Returns:
        dict: The dictionary representation of the lens.
    """
    self.geometry = {
        "type": "lens",
        "radius": self.radius,
        "height": self.height,
        "crop_base": self.crop_base,
        "asymmetric": self.asymmetric,
        "curvature": self.curvature,
        "conic_constant": self.conic_constant,
        "curvature_y": self.curvature_y,
        "conic_constant_y": self.conic_constant_y,
        "polynomial_type": self.polynomial_type,
        "polynomial_factors": self.polynomial_factors,
        "polynomial_factors_y": self.polynomial_factors_y,
        "surface_compensation_factors": self.surface_compensation_factors,
        "surface_compensation_factors_y": self.surface_compensation_factors_y,
        "nr_radial_segments": self.nr_radial_segments,
        "nr_phi_segments": self.nr_phi_segments,
    }

    node_dict = super().to_dict()
    node_dict["geometry"] = self.geometry
    return node_dict