mirror of
https://github.com/pim-n/pg-rad
synced 2026-03-23 21:58:12 +01:00
Integrate modules from road-gen that are needed for segmented road generation
This commit is contained in:
20
src/road_gen/prefabs/prefabs.py
Normal file
20
src/road_gen/prefabs/prefabs.py
Normal file
@ -0,0 +1,20 @@
|
||||
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,
|
||||
}
|
||||
Reference in New Issue
Block a user