tvaLib
Public Member Functions | List of all members
lib.scene.SDR Class Reference
Inheritance diagram for lib.scene.SDR:

Public Member Functions

def __init__ (self, aligns_data, pavement_half_width=3, max_exit_region_size=10)
 

Detailed Description

Definition at line 1339 of file scene.py.

Constructor & Destructor Documentation

◆ __init__()

def lib.scene.SDR.__init__ (   self,
  aligns_data,
  pavement_half_width = 3,
  max_exit_region_size = 10 
)
Generate sorties de route (run off the road) region. 

Definition at line 1340 of file scene.py.

1340  def __init__(self, aligns_data, pavement_half_width=3, max_exit_region_size=10):
1341  ''' Generate sorties de route (run off the road) region. '''
1342  tvaLib.Constructors.SuperList.__init__(self)
1343 
1344  try:
1345  for align_data in aligns_data:
1346  # For each point
1347  poly_data = []
1348  # Right curb
1349  for pix in range(len(align_data)):
1350  if(pix==0): poly_data.append(tvaLib.Geo.orthogonal_point_extension(pavement_half_width, align_data[pix], align_data[pix+1]))
1351  elif(pix==len(align_data)-1): poly_data.append(tvaLib.Geo.orthogonal_point_extension(-pavement_half_width, align_data[pix], align_data[pix-1]))
1352  else: poly_data.append(tvaLib.Geo.orthogonal_point_extension(pavement_half_width, align_data[pix], align_data[pix+1], PN1=align_data[pix-1]))
1353  # Left curb
1354  for pix in list(reversed(range(len(align_data)))):
1355  if(pix==0): poly_data.append(tvaLib.Geo.orthogonal_point_extension(-pavement_half_width, align_data[pix], align_data[pix+1]))
1356  elif(pix==len(align_data)-1): poly_data.append(tvaLib.Geo.orthogonal_point_extension(pavement_half_width, align_data[pix], align_data[pix-1]))
1357  else: poly_data.append(tvaLib.Geo.orthogonal_point_extension(-pavement_half_width, align_data[pix], align_data[pix+1], PN1=align_data[pix-1]))
1358  self.data.append(SDRpoly(poly_data))
1359  except: raise Exception, [392, 'Critical error encountered with alignment data (at coordinate "'+str(align_data[pix])+'") while building SDR alignment boundaries. Consider flushing the corresponding alignment data and rebuilding it.']
1360 

The documentation for this class was generated from the following file: