mirror of
https://github.com/pim-n/road-gen.git
synced 2026-02-03 09:23:09 +01:00
Initial commit
This commit is contained in:
0
src/road_gen/prefabs/__init__.py
Normal file
0
src/road_gen/prefabs/__init__.py
Normal file
19
src/road_gen/prefabs/prefabs.py
Normal file
19
src/road_gen/prefabs/prefabs.py
Normal file
@ -0,0 +1,19 @@
|
||||
import numpy as np
|
||||
|
||||
def straight(length: int) -> np.ndarray:
|
||||
return np.zeros(length)
|
||||
|
||||
def turn_left(length: int, radius: float) -> np.ndarray:
|
||||
return np.full(length, 1.0 / radius)
|
||||
|
||||
def turn_right(length: int, radius: float) -> np.ndarray:
|
||||
return - turn_left(length, radius)
|
||||
|
||||
PREFABS = {
|
||||
'straight': straight,
|
||||
'turn_left': turn_left,
|
||||
'turn_right': turn_right,
|
||||
}
|
||||
|
||||
def print_available_prefabs():
|
||||
print(PREFABS.keys())
|
||||
Reference in New Issue
Block a user