Cell
Source code in gdsr/_gdsr.pyi
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 |
|
__init__
add
remove
contains
is_empty
move_to
move_to(point: PointLike) -> Self
move_by
move_by(vector: PointLike) -> Self
rotate
rotate(angle: float, centre: PointLike = Point(0, 0)) -> Self
Rotate everything in the cell by an angle around a centre point.
Parameters:
-
angle
(float
) –Counter-clockwise rotation angle in degrees.
-
centre
(PointLike
, default:Point(0, 0)
) –Centre point of rotation, defaults to Point(0, 0).
Source code in gdsr/_gdsr.pyi
scale
scale(factor: float, centre: PointLike = Point(0, 0)) -> Self
Scale everything in the cell by a factor around a centre point.
Parameters:
-
factor
(float
) –Scaling factor.
-
centre
(PointLike
, default:Point(0, 0)
) –Centre point of scaling, defaults to Point(0, 0).
Source code in gdsr/_gdsr.pyi
flatten
flatten(*layer_data_types: LayerDataType, depth: int | None = None) -> Self
Flatten the cell to a certain depth on the specified layer, data_type pairs.
Each reference on the depth is replaced by the elements it references. If the depth is 0, nothing is flattened If the depth is 1, only the first level of references is flattened and so on.
When depth is None, the cell is flattened to the deepest level.
This method modifies the cell in place and returns itself.
Parameters:
-
layer_data_types
(LayerDataType
, default:()
) –the layer, data_type pairs to flatten on
-
depth
(int
, default:None
) –Depth of the flattening, defaults to None.
Source code in gdsr/_gdsr.pyi
get_elements
get_elements(*layer_data_types: LayerDataType, depth: int | None = None) -> list[Element]
Return a list of elements in the cell.
This method does not modify the cell. It simply returns the elements until the specified depth. If a reference is encountered before it reaches the specified depth, the reference is flattened to the level of depth relative to the cell.
When depth is None, the cell is flattened to the deepest level.
Parameters:
-
layer_data_types
(LayerDataType
, default:()
) –the layer, data_type pairs to flatten on
-
depth
(int
, default:None
) –Depth of the flattening, defaults to None.
Source code in gdsr/_gdsr.pyi
copy
to_gds
Write the Cell to a GDS file.
Parameters:
-
file_name
(PathLike
, default:None
) –Output GDS file name.
-
units
(float
, default:1e-06
) –GDS file units in meters, defaults to 1e-6.
-
precision
(float
, default:1e-10
) –GDS file precision, defaults to 1e-10.
Returns:
-
str
–GDS file name
Source code in gdsr/_gdsr.pyi
is_on
is_on(*layer_data_types: LayerDataType) -> bool
Return True if the cell is on any of the layer, data_type pairs.
This method returns True if all elements in the cell are on any of the layer, data_type pairs.