Skip to article frontmatterSkip to article content

gdsfactory.cross_section.cross_section

gdsfactory.cross_section.cross_section(width: float = 0.5, offset: float = 0, layer: tuple[int, int] | str | int | LayerEnum = 'WG', sections: tuple[Section, ...] | None = None, port_names: tuple[str, str] = ('o1', 'o2'), port_types: tuple[str, str] = ('optical', 'optical'), bbox_layers: Sequence[tuple[int, int] | str | int | LayerEnum] | None = None, bbox_offsets: Sequence[float] | None = None, cladding_layers: Sequence[tuple[int, int] | str | int | LayerEnum] | None = None, cladding_offsets: Sequence[float] | None = None, cladding_simplify: Sequence[float] | None = None, cladding_centers: Sequence[float] | None = None, radius: float | None = 10.0, radius_min: float | None = None, main_section_name: str = '_default')CrossSection

Return CrossSection.

Parameters
  • widthmain Section width (um).

  • offsetmain Section center offset (um).

  • layermain section layer.

  • sectionslist of Sections(width, offset, layer, ports).

  • port_namesfor input and output (‘o1’, ‘o2’).

  • port_typesfor input and output: electrical, optical, vertical_te …

  • bbox_layerslist of layers bounding boxes to extrude.

  • bbox_offsetslist of offset from bounding box edge.

  • cladding_layerslist of layers to extrude.

  • cladding_offsetslist of offset from main Section edge.

  • cladding_simplifyOptional Tolerance value for the simplification algorithm. All points that can be removed without changing the resulting. polygon by more than the value listed here will be removed.

  • cladding_centerscenter offset for each cladding layer. Defaults to 0.

  • radiusrouting bend radius (um).

  • radius_minmin acceptable bend radius.

  • main_section_namename of the main section. Defaults to _default

import gdsfactory as gf

xs = gf.cross_section.cross_section(width=0.5, offset=0, layer='WG')
p = gf.path.arc(radius=10, angle=45)
c = p.extrude(xs)
c.plot()
   ┌────────────────────────────────────────────────────────────┐
   │                                                            │
   │                                                            │
   │                   boox_layer                               │
   │                                                            │
   │         ┌──────────────────────────────────────┐           │
   │         │                            ▲         │bbox_offset│
   │         │                            │         ├──────────►│
   │         │           cladding_offset  │         │           │
   │         │                            │         │           │
   │         ├─────────────────────────▲──┴─────────┤           │
   │         │                         │            │           │
─ ─┤         │           core   width  │            │           ├─ ─ center
   │         │                         │            │           │
   │         ├─────────────────────────▼────────────┤           │
   │         │                                      │           │
   │         │                                      │           │
   │         │                                      │           │
   │         │                                      │           │
   │         └──────────────────────────────────────┘           │
   │                                                            │
   │                                                            │
   │                                                            │
   └────────────────────────────────────────────────────────────┘