Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
HelgeGehring committed Jun 29, 2022
1 parent 258a6c9 commit 4f8f0fb
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions gdsfactory/path.py
Expand Up @@ -608,19 +608,28 @@ def straight(length: float = 10.0, npoints: int = 2) -> Path:
return p


def spiral_archimedean(inner_radius: float = 20, separation: float = 1, number_of_loops: float = 10,
npoints: int = 1000) -> Path:
def spiral_archimedean(
inner_radius: float, separation: float, number_of_loops: float, npoints: int
) -> Path:
"""
Returns an Archimedean spiral
:param inner_radius: Inner radius of the spiral
:param separation: Separation between the loops
:param number_of_loops: Number of loops
:param npoints: Number of Points
:return: Path of an archimedean spiral
Args:
inner_radius: Inner radius of the spiral
separation: Separation between the loops
number_of_loops: Number of loops
npoints: Number of Points
Returns:
Path of an archimedean spiral
"""
return Path([(separation / np.pi * theta + inner_radius) * np.array((np.sin(theta), np.cos(theta)))
for theta in np.linspace(0, number_of_loops * 2 * np.pi, npoints)])
return Path(
[
(separation / np.pi * theta + inner_radius)
* np.array((np.sin(theta), np.cos(theta)))
for theta in np.linspace(0, number_of_loops * 2 * np.pi, npoints)
]
)


def smooth(
Expand Down

0 comments on commit 4f8f0fb

Please sign in to comment.