Modified Track Path Editor + Tracks/Discussion

What would really help would be adding the actual length of the decoration objects within it's total length. Someone want to test this out and update Mr Grumpy's data?
As in although a circuit gate is 100m (Eifel), the actual object within is only 3m (not including the stairs either side)?
 
Last edited:
As in although a circuit gate is 100m (Eifel), the actual object within is only 3m (not including the stairs either side)?
Yep, would make stacking objects much easier. Also important for anyone that wants to make a scenery editor to know the actual physical size of the objects.
 
The elevation profile needs to be in this format:

header
distance,elevation
distance,elevation
distance,elevation
etc.

Are you on Windows or Linux?

I'm using Windows 7 on my old Laptop.
I went back to Geocontext, got the values in the correct format that you have listed. The previous one I got must have been something completely different. So, I'll try the new file next time I fire it up.
Also, is there anyway we can import a drawing or .gpx of a track to your TLC to be used to trace out courses like in PD's TPE? That would definitely help in the making of short circuits.
 
I started working on an algorithm to project a path using latitude and longitude data to cartesian coordinates, using azimuthal equidistance projection. Since the Earth of round (which may be new to any members of the Flat Earth Society) you can't just take the GPS position and plot it on a screen, it needs to be projected onto a flat surface first.

I picked the azimuthal equidistance projection since it is good at preserving the shapes near to the center of view. Since the tracks are so small relative to the size of the Earth there shouldn't be any noticeable deformation.

Here is the code so far. The project_path function takes a list of tuples (latitude, longitude) and converts it to metric (x, y) data relative to the center point.

Code:
from math import*

def great_circle_distance(p0, p1):
    '''Returns the distance (m) between two points (lat, long)'''
    R = 6371.0  #radius of Earth in km
  
    lat0, lon0 = radians(p0[0]), radians(p0[1])
    lat1, lon1 = radians(p1[0]), radians(p1[1])

    dlon = lon1-lon0
    dlat = lat1-lat0

    a = sin(dlat / 2)**2 + cos(lat0) * cos(lat1) * sin(dlon/2)**2
    c = 2 * atan2(sqrt(a), sqrt(1-a))

    distance = R * c * 1000     #distance in meters

    return distance

def get_bearing(p0, p1):
    '''Returns the azimuth (radians) between two points (lat, long)'''
    lat0, lon0 = radians(p0[0]), radians(p0[1])
    lat1, lon1 = radians(p1[0]), radians(p1[1])

    dlon = lon1-lon0
    dlat = lat1-lat0

    y = sin(lon1-lon0) * cos(lat1)
    x = cos(lat0)*sin(lat1) - sin(lat0)*cos(lat1)*cos(lon1-lon0)
    bearing = atan2(y, x)

    return bearing

def point_to_cartesian(center, point):
    '''Azimuthal equidistance projection'''
    distance = great_circle_distance(center, point)
    bearing = get_bearing(center, point)

    x = distance * sin(bearing)
    y = distance * cos(bearing)

    return (x, y)

def get_path_center(path):
    lat = [point[0] for point in path]
    lon = [point[1] for point in path]

    latmax = max(lat)
    latmin = min(lat)
    lonmax = max(lon)
    lonmin = min(lon)

    lat = latmin+(latmax-latmin)/2
    lon = lonmin+(lonmax-lonmin)/2

    return (lat, lon)

def project_path(path):
    '''Projects a path of (lat,lon) values to cartesian coordinates'''
    center = get_path_center(path)
    coords = [point_to_cartesian(center, point) for point in path]
    return coords

Edit: First track made with the aid of latitude and longitude data retrieved from Google Maps! Just plotted the road to the village on the other side of the forest. Didn't spend any time on elevation, so it's a bit crude. But it works and that's the main point right now!

https://www.gran-turismo.com/es/gt6/user/#!/friend/eran0004/course/2781162/

Hopefully I can have the tool ready to be shared tomorrow. There are some loose wires here and there that I need to connect first...

Here is a screenshot showing how it works. The blue dots indicates the imported gps path. The black line is the track I created by tracing the gps plot.

tvärålund.png


And here is a link to the same road on Google Maps (note that just about half of it fitted on the Andalucía map) https://goo.gl/maps/4Hc33ogb2S32
 
Last edited:
I started working on an algorithm to project a path using latitude and longitude data to cartesian coordinates, using azimuthal equidistance projection. Since the Earth of round (which may be new to any members of the Flat Earth Society) you can't just take the GPS position and plot it on a screen, it needs to be projected onto a flat surface first.

I picked the azimuthal equidistance projection since it is good at preserving the shapes near to the center of view. Since the tracks are so small relative to the size of the Earth there shouldn't be any noticeable deformation.

Here is the code so far. The project_path function takes a list of tuples (latitude, longitude) and converts it to metric (x, y) data relative to the center point.

Code:
from math import*

def great_circle_distance(p0, p1):
    '''Returns the distance (m) between two points (lat, long)'''
    R = 6371.0  #radius of Earth in km
 
    lat0, lon0 = radians(p0[0]), radians(p0[1])
    lat1, lon1 = radians(p1[0]), radians(p1[1])

    dlon = lon1-lon0
    dlat = lat1-lat0

    a = sin(dlat / 2)**2 + cos(lat0) * cos(lat1) * sin(dlon/2)**2
    c = 2 * atan2(sqrt(a), sqrt(1-a))

    distance = R * c * 1000     #distance in meters

    return distance

def get_bearing(p0, p1):
    '''Returns the azimuth (radians) between two points (lat, long)'''
    lat0, lon0 = radians(p0[0]), radians(p0[1])
    lat1, lon1 = radians(p1[0]), radians(p1[1])

    dlon = lon1-lon0
    dlat = lat1-lat0

    y = sin(lon1-lon0) * cos(lat1)
    x = cos(lat0)*sin(lat1) - sin(lat0)*cos(lat1)*cos(lon1-lon0)
    bearing = atan2(y, x)

    return bearing

def point_to_cartesian(center, point):
    '''Azimuthal equidistance projection'''
    distance = great_circle_distance(center, point)
    bearing = get_bearing(center, point)

    x = distance * sin(bearing)
    y = distance * cos(bearing)

    return (x, y)

def get_path_center(path):
    lat = [point[0] for point in path]
    lon = [point[1] for point in path]

    latmax = max(lat)
    latmin = min(lat)
    lonmax = max(lon)
    lonmin = min(lon)

    lat = latmin+(latmax-latmin)/2
    lon = lonmin+(lonmax-lonmin)/2

    return (lat, lon)

def project_path(path):
    '''Projects a path of (lat,lon) values to cartesian coordinates'''
    center = get_path_center(path)
    coords = [point_to_cartesian(center, point) for point in path]
    return coords

Edit: First track made with the aid of latitude and longitude data retrieved from Google Maps! Just plotted the road to the village on the other side of the forest. Didn't spend any time on elevation, so it's a bit crude. But it works and that's the main point right now!

https://www.gran-turismo.com/es/gt6/user/#!/friend/eran0004/course/2781162/

Hopefully I can have the tool ready to be shared tomorrow. There are some loose wires here and there that I need to connect first...

Here is a screenshot showing how it works. The blue dots indicates the imported gps path. The black line is the track I created by tracing the gps plot.

View attachment 643288

And here is a link to the same road on Google Maps (note that just about half of it fitted on the Andalucía map) https://goo.gl/maps/4Hc33ogb2S32
Thankyou! This will be much easier than what I have to do. And better looking. Plus that means short circuits will be easier to create.
Once I have my .gpx and elev.txt files, I have to import the .gpx to my android emulator so I can use it to trace the route on the original TPE. Then, after saving, rip a replay and use the ted to apply the elev.txt in your elev editor and re upload. So far, I'm impressed with the results. I've already created three touges in one day.

https://www.gran-turismo.com/gb/gt6/user/#!/friend/Swift_13B/course/2779410/

https://www.gran-turismo.com/gb/gt6/user/#!/friend/Swift_13B/course/2780622/

https://www.gran-turismo.com/gb/gt6/user/#!/friend/Swift_13B/course/2780833/
 
Track Layout Creator 1.9
https://www.gtplanet.net/forum/threads/course-maker-toolbox.352281/#post-11706459

Changes:
  • File -> Import reference path. Imports a *.csv file containing latitude and longitude data and projects it on the landscape. Can be used as a reference when modelling. A *.csv file can be obtained by uploading a .gpx file at http://www.geocontext.org/publ/2010/04/profiler/en/ (while this site generates a *.gpx file from a Google Maps link: https://mapstogpx.com/). At geocontext.org, select Data in CSV and click the checkbutton to enable latitude and longitude data. Then copy the contents of the text box (don't forget the first row, since it contains the header for each column) and paste it in an empty *.txt file. Change the extension from *.txt to *.csv and then you can import it in the Track Layout Creator. An example *.csv file is included in the folder so you can see the structure of it.

  • Two new options added to the Display menu:
    • Display -> Reference path: Displays / hides the reference path (see above).
    • Display -> Road width: If enabled, the line width of the road is the same as the road width. If disabled, the line width of the road is 1 px. Disabling this option makes it easier to align the road with the reference path.
  • Other: Various little tweaks and graphics updates.
 
Thanks for continuing to improve the track layout creator. Is there a way to import the track into the " official Track Path editor" so we can add decorations that way ?
 
Here is my decoration placer prototype. It takes a decoration key, a distance (which can be a single value or a list of [startdistance, enddistance], a boolean signifying if the decoration should be placed on the right side of the track and a justify factor, which is used if only one distance value is provided.

Justify = 0 places the start of the decoration at the distance value. Justify = 1 places the end of the decoration at the distance value. Justify = 0.5 places the center of the decoration at the distance value. Any number between 0 and 1 can be used.

Code:
posdict = {'A':0, 'B': 1, 'AB': 2, 'C': 6}  #left side values onlyv

def add_deco(key, distance, right=False, justify=0.0):
    '''Adds a single decoration item.'''
 
    typeid, size, poskey = andalusia_deco[key]
    sideIsLeft = "_RIGHT" not in key

    flag = int(right == sideIsLeft)

    try:
        startdistance = distance-(size*justify)
        enddistance = startdistance + size
    except:
        startdistance = distance[0]
        enddistance = distance[1]

    position = posdict[poskey]+(3*right)
    if position > 7:
        position = 7

    return [key, typeid, flag, startdistance, enddistance, position]

Example, adding a building on the left side, centered on a distance of 1337 meters:

Code:
>>> add_deco(key='BUILDING_RIGHT_A', distance=1337, right=False, justify=0.5)
['BUILDING_RIGHT_A', 13268933452885368405, 1, 1317.0, 1357.0, 2]

The returning list contains:
Item key ('BUILDING_RIGHT_A')
Item ID (13268933452885368405)
Item flag (1)
Startdistance (1317.0)
Enddistance (1357.0)
Position (2 = TRACK_LEFT_AB)

Edit: Time to test the first track edited with this script. I'll let you know if my PS3 explodes or not!

Edit2: Works pretty good. Here is the track: https://www.gran-turismo.com/es/gt6/user/#!/friend/eran0004/course/2784749/

The track has 142 decoration items, of which 4 were placed manually with hex editing. The other 138 were placed with the new script. The second half of the track I experimented with a randomized decoration generator, placing a random choice of buildings, trees and rocks.
 
Last edited:
The decoration editor prototype is available for download here:

https://www.gtplanet.net/forum/threads/course-maker-toolbox.352281/#post-11796772

There is no user interface yet, so it will have to be operated through the interactive IDLE interpreter, using python commands. I have supplied some instructions, I hope that it will be enough for you to at least be able to try it.

Also, if anyone have a great for idea for what the user interface should look like, please let me know!
 
Last edited:
The decoration editor prototype is available for download here:

https://www.gtplanet.net/forum/threads/course-maker-toolbox.352281/#post-11796772

There is no user interface yet, so it will have to be operated through the interactive IDLE interpreter, using python commands. I have supplied some instructions, I hope that it will be enough for you to at least be able to try it.

Also, if anyone have a great for idea for what the user interface should look like, please let me know!

A simple interface would work nice, Once opened, the user should be able to load the .ted. Then, like your Elev editor, have like a list of icons on a pop up window or, with a drop down list. Then, (Once a deco item has been selected) a window with a blank field asking for a distance value from start (0 meters/ feet) to where you want to place the deco object. Then, or during the same window. have a check list as to either plot it using the start, end or center of the deco. Then, once that is entered maybe have side check options to either switch between left side of the road and the right.
Kinda the same way you have the options and display in your elevation editor. Except it shows the plotted route with small labels on the items you place. I'm picturing this in a similar form to your TLC and Elev editor.
I hope that's not asking too much.

For example. You run the software --> Load the .ted --> Select an deco item --> Enter the value from start (ex. Item is 1500m from start(0). you enter 1500) --> Then select whether to place it using the start, end or center. --> Then select weather it should be on the right side or left side of the road.

I know that you can overlap deco items. Yet, I'm not sure if any checks should be in place to limit overlapping.
 
Made some changes:

add_deco()
add decoration(s) on a specific position

Code:
add_deco(keys, distance, side='left', justify='start')

keys: A single decoration key or a tuple containing several keys. If several keys are provided, a random choice is done.
distance: A single distance or a tuple containing a start distance and an end distance.
side: Which side to place the decoration on. Can be 'left', 'right' or 'both'.
justify: Where to place the decoration relative to the distance (if only one distance is provided). Can be 'start', 'center' or 'end'.

add_decos()
add decorations along a distance range

Code:
add_decos(keys, startdistance, enddistance, side='left', chance=1.0)

keys: One or several decoration keys.
startdistance: Where to start placing the decorations.
enddistance: Where to stop placing the decorations.
side: Which side to place the decorations on. Can be 'left', 'right', 'both' or 'random'.
chance: The probability that a decoration will be placed in any given iteration of the loop. Can be any value between 0.0 and 1.0. If a decoration is not placed, a gap with a random length between 20 and 100 meters is generated instead.

print_decos()
prints a list of decorations

Code:
print_decos(side='both')

side: Which side to print. Can be 'left', 'right' or 'both'. The print format is: [index], key, startdistance, enddistance, side

delete_deco()
deletes a decoration

Code:
delete_deco(index)

index: The list index of the decoration to delete.

move_deco()
moves a decoration

Code:
move_deco(index, distance)

index: The list index of the decoration to move.
distance: The distance to move the decoration (can be positive or negative).


-------------------------------------

Example:

A random mix of forest and rocks from 1000m to 2000m can be created with the following function call. The variables woods and rocks are tuples containing all the keys of forest and rocks items.

Code:
>>> add_decos(woods+rocks, 1000, 2000, 'random', 0.5)

Printing the result, first both sides and then left side only and right side only:

Code:
>>> print_decos()
[0], ROCK, 1000.0, 1100.0, left
[1], ROCK, 1100.0, 1200.0, right
[2], ROCK_OUTER, 1359.0, 1459.0, left
[3], TREES, 1725.0, 1825.0, left
[4], ROCK, 1875.0, 1975.0, left
[5], ROCK_INNER, 1975.0, 2075.0, left
[6], TREES_INNER_B, 1975.0, 2075.0, right

>>> print_decos('left')
[0], ROCK, 1000.0, 1100.0, left
[2], ROCK_OUTER, 1359.0, 1459.0, left
[3], TREES, 1725.0, 1825.0, left
[4], ROCK, 1875.0, 1975.0, left
[5], ROCK_INNER, 1975.0, 2075.0, left

>>> print_decos('right')
[1], ROCK, 1100.0, 1200.0, right
[6], TREES_INNER_B, 1975.0, 2075.0, right
 

Attachments

  • Decoration Editor 0.1.1.zip
    9.8 KB · Views: 17
The track i am working on is using a banked curb from an oval.
I am trying to understand how banking works.

I have a track descent when entering the curve.
It seems that the track is rotating from the segments center. Not easy to manage transitions.
if i am right, i suppose that i have to raise the banked track part by track-width/2 * sin(bank-angle) ?

The content of the bank structure in the TED file is unclear to me :
Track Banking Structure.png


Can you help me please to understand the parameters and usage ?
 
The track i am working on is using a banked curb from an oval.
I am trying to understand how banking works.

I have a track descent when entering the curve.
It seems that the track is rotating from the segments center. Not easy to manage transitions.
if i am right, i suppose that i have to raise the banked track part by track-width/2 * sin(bank-angle) ?

The content of the bank structure in the TED file is unclear to me :
View attachment 644121

Can you help me please to understand the parameters and usage ?

It's the center, yes.

Bank structure:
  1. Bank angle (degrees)
  2. Transition length from previous bank. Needs to be identical to the previous bank's transition to this bank. Total transition length is shiftnext of previous bank + shiftprev of this bank.
  3. Transition length to next bank. Needs to be identical to the next bank's transition from this bank.
  4. The number of height points that belong to this bank segment.
  5. The index in the heights list to start counting from.
  6. Position of the start of the bank segment.
  7. Length of the bank segment.

Height points are evenly distributed within a bank segment, so if the length is 100m and there are 20 data points then you know that there are 5m between the data points. Knowing that, the bank angle of this bank, the previous bank and the next bank, and the transition length you can calculate the angle of each data point. Knowing the angle of each point you can calculate how much it needs to be raised.
 
The track i am working on is using a banked curb from an oval.
I am trying to understand how banking works.

I have a track descent when entering the curve.
It seems that the track is rotating from the segments center. Not easy to manage transitions.
if i am right, i suppose that i have to raise the banked track part by track-width/2 * sin(bank-angle) ?

The content of the bank structure in the TED file is unclear to me :
View attachment 644121

Can you help me please to understand the parameters and usage ?
Banking can be a pain so I'll try my best to explain & give a few examples.

To make a 1 or more banked segments is the easy part, you pick your section of track you make it say (10 for anti-clockwise or -10 for clockwise)
To join more sections together is just as easy because it has the same banking value so example time :)

Section 1, banking -10, shiftnext 0
Section 2, banking -10, shiftprevious 0

Now for the blending in part, this part can be a pain in bovril highway :)

When blending in you must take note of the previous or next length of track you are blending into, otherwise you will get nasty little jumps. Example time again :)

Section 1, banking 0, vlength 100m, shiftnext 100.
Section 2, banking 5, vlength 100m, shiftprevious 100, shiftnext 0.
Section 3, banking 5, vlength 100m, shiftprevious 0, shiftnext 100.
Section 4, banking 0, vlength 100m, shiftprevious 100.
(All based on 4x sections of track at 100m each with a 100m blend in & out)

Now the more advanced part, as more often than not you wont have the luxury of having 4 parts of a corner the same length.
Notice above I didn't take the shiftnext or shiftprevious past 100m, that is because if you try to the make the blend longer than what the previous or next length of track is you will get a nasty bump.

A more realistic example:
Section 1, banking 0, vlength 97, shiftnext 97.
Section 2, banking 5, vlength 55, shiftprevious 97, shiftnext 0.
Section 3, banking 5, vlength 49, shiftprevious 0, shiftnext 85.
Section 4, banking 0, vlength 85, shiftprevious 85, shiftnext 0.

You may still encounter issues as I'm not entirely sure if the banked length plays a part, as a rule of thumb I normally keep it to blending the shortest distance to avoid any mistakes.

Example again lol.
Section 1, banking 0, vlength 97, shiftnext 55.
Section 2, banking 5, vlength 55, shiftprevious 55, shiftnext 0.
Section 3, banking 5, vlength 49, shiftprevious 0, shiftnext 49.
Section 4, banking 0, vlength 85, shiftprevious 49, shiftnext 0.

As you can see I've kept within the smaller values of track length to avoid any bumps.

There's still a few more trick to teach like banked S bends which can be tricky as you have to half the value of said track length as it's blending in & out in 1 go but we'll get to that if you need help with it.

1 last little example.
Section 1, banking 0, vlength 100m, shiftnext 50.
Section 2, banking 5, vlength 100m, shiftprevious 50, shiftnext 50.
Section 3, banking -5, vlength 100m, shiftprevious 50, shiftnext 50.
Section 4, banking 0, vlength 100m, shiftprevious 50.

Or

Section 1, banking 0, vlength 100m, shiftnext 50.
Section 2, banking 5, vlength 100m, shiftprevious 50, shiftnext 50.
Section 3, banking 0, vlength 100m, shiftprevious 50.

Hope all this makes a bit more sense :) any issues let us know & I'll try to help :)
 
It's the center, yes.

Bank structure:
  1. Bank angle (degrees)
  2. Transition length from previous bank. Needs to be identical to the previous bank's transition to this bank. Total transition length is shiftnext of previous bank + shiftprev of this bank.
  3. Transition length to next bank. Needs to be identical to the next bank's transition from this bank.
  4. The number of height points that belong to this bank segment.
  5. The index in the heights list to start counting from.
  6. Position of the start of the bank segment.
  7. Length of the bank segment.

Height points are evenly distributed within a bank segment, so if the length is 100m and there are 20 data points then you know that there are 5m between the data points. Knowing that, the bank angle of this bank, the previous bank and the next bank, and the transition length you can calculate the angle of each data point. Knowing the angle of each point you can calculate how much it needs to be raised.

Banking can be a pain so I'll try my best to explain & give a few examples.

Hope all this makes a bit more sense :) any issues let us know & I'll try to help :)

Thanks guys.
It's clear now, and i will have some pain to get it to work.

I have understood your examples Mr Grumpy , thank you very much.
I need to adjust a bit the way i have built the track segments. There is a chicane when entering the half-oval (i suppose that it's to slow down the cars and avoid them to fly), it will be a bit of fun to manage the transition.
More, as the end of the oval goes on the straight line, it will be twice a pain. But i have found this post #1299 from you that will help me.
I need to experiment.
 
@VelociRaptor: Killing two birds with one stone (poor birds), here is Track Layout Creator 2.0:

https://www.gtplanet.net/forum/threads/course-maker-toolbox.352281/#post-11706459

Changes
  • Disabled the text rotation of the vertical ruler for systems (Mac) that doesn't support it.

  • Added a camber axis option which allows you to adjust the point around which the corner camber rotates. The range is -1 to 1, where -1 is the inside of the turn, 1 is the outside of the turn and 0 is the center. Setting the axis to the inside will lift the outside. Setting it to the outside will lower the inside. Setting it to the center (which is how it normally works) lowers the inside and lifts the outside.
    Note: When loading a savefile created prior to 2.0, the camber axis is set to -1.0, so if you want it to remain at 0 you need to adjust that before you export the ted file.

Here is an example track I made when testing the camber axis option. This track has camber axis set to -1, i.e. the inside of the turns. https://www.gran-turismo.com/es/gt6/user/#!/friend/eran0004/course/2788110/

A side effect from implementing the camber axis option is that thanks to the trigonometry involved I was able to find that the track width of Eifel (which we suspected was narrower than we set it to be) is not incorrect after all, instead it appears to be perfectly to scale.
 
@VelociRaptor: Killing two birds with one stone (poor birds), here is Track Layout Creator 2.0:

https://www.gtplanet.net/forum/threads/course-maker-toolbox.352281/#post-11706459

Changes
  • Disabled the text rotation of the vertical ruler for systems (Mac) that doesn't support it.

  • Added a camber axis option which allows you to adjust the point around which the corner camber rotates. The range is -1 to 1, where -1 is the inside of the turn, 1 is the outside of the turn and 0 is the center. Setting the axis to the inside will lift the outside. Setting it to the outside will lower the inside. Setting it to the center (which is how it normally works) lowers the inside and lifts the outside.
    Note: When loading a savefile created prior to 2.0, the camber axis is set to -1.0, so if you want it to remain at 0 you need to adjust that before you export the ted file.

Here is an example track I made when testing the camber axis option. This track has camber axis set to -1, i.e. the inside of the turns. https://www.gran-turismo.com/es/gt6/user/#!/friend/eran0004/course/2788110/

A side effect from implementing the camber axis option is that thanks to the trigonometry involved I was able to find that the track width of Eifel (which we suspected was narrower than we set it to be) is not incorrect after all, instead it appears to be perfectly to scale.

I have a working banked section, not perfect with some very small oscillations at the entrance but inside and exit are flat. Will check that later as you can anyway enter full throttle.
Of course, it rotates from the center and i was fighting with EXCEL to compute elevations.

Thank you eran0004
Version 2.0 is running on my Mac
I tried your course, it's cool and the banking are fluent.

My concern is to move my track from tarnheld editor to Track Layout Creator.
(i need TED Editor for it's ability to embed and reload accurately a scaled google map bitmap, i have a solution with a locked transparent layer on my Mac screen for Track Layout Creator but i need to rescale and reoverlay each time, so i use it only for simple tracks that i can complete at once)

I saved my current track as 'track_name'.trk in TED Editor and tried to reopen it inside the Track Layout Creator.
But i get a bunch of errors about Tkinter : Are both formats compatible or is it Tkinter version again ?

Code:
Exception in Tkinter callback
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/tkinter/__init__.py", line 1699, in __call__
    return self.func(*args)
  File "/Users/PS3/GT6/Track Layout Creator 2.0/Track Layout Creator 2.0.py", line 616, in LoadTrack
    unpacked = struct.unpack_from('>3f', polygonbytes, i)
struct.error: unpack_from requires a buffer of at least 12 bytes

Exception in Tkinter callback
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/tkinter/__init__.py", line 1699, in __call__
    return self.func(*args)
  File "/Users/PS3/GT6/Track Layout Creator 2.0/Track Layout Creator 2.0.py", line 1792, in displayChange
    polygonChange()
  File "/Users/PS3/GT6/Track Layout Creator 2.0/Track Layout Creator 2.0.py", line 1799, in polygonChange
    drawPolygon(polygon)
  File "/Users/PS3/GT6/Track Layout Creator 2.0/Track Layout Creator 2.0.py", line 1307, in drawPolygon
    draw_polygon_label()
  File "/Users/PS3/GT6/Track Layout Creator 2.0/Track Layout Creator 2.0.py", line 1275, in draw_polygon_label
    text = '[%d]\nR %d\n%d°' % (index, radius, degrees(sweepAngle))
ValueError: cannot convert float NaN to integer

Exception in Tkinter callback
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/tkinter/__init__.py", line 1699, in __call__
    return self.func(*args)
  File "/Users/PS3/GT6/Track Layout Creator 2.0/Track Layout Creator 2.0.py", line 1802, in trackChange
    drawTrack(polygon)
  File "/Users/PS3/GT6/Track Layout Creator 2.0/Track Layout Creator 2.0.py", line 1333, in drawTrack
    draw_rounded()
  File "/Users/PS3/GT6/Track Layout Creator 2.0/Track Layout Creator 2.0.py", line 1437, in draw_rounded
    draw_cornerCountLabels()
  File "/Users/PS3/GT6/Track Layout Creator 2.0/Track Layout Creator 2.0.py", line 1358, in draw_cornerCountLabels
    pos = distanceToCoords(distance)
  File "/Users/PS3/GT6/Track Layout Creator 2.0/Track Layout Creator 2.0.py", line 993, in distanceToCoords
    segment = segments[segmentIndex]
IndexError: list index out of range

Exception in Tkinter callback
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/tkinter/__init__.py", line 1699, in __call__
    return self.func(*args)
  File "/Users/PS3/GT6/Track Layout Creator 2.0/Track Layout Creator 2.0.py", line 1802, in trackChange
    drawTrack(polygon)
  File "/Users/PS3/GT6/Track Layout Creator 2.0/Track Layout Creator 2.0.py", line 1333, in drawTrack
    draw_rounded()
  File "/Users/PS3/GT6/Track Layout Creator 2.0/Track Layout Creator 2.0.py", line 1437, in draw_rounded
    draw_cornerCountLabels()
  File "/Users/PS3/GT6/Track Layout Creator 2.0/Track Layout Creator 2.0.py", line 1358, in draw_cornerCountLabels
    pos = distanceToCoords(distance)
  File "/Users/PS3/GT6/Track Layout Creator 2.0/Track Layout Creator 2.0.py", line 993, in distanceToCoords
    segment = segments[segmentIndex]
IndexError: list index out of range


 
My concern is to move my track from tarnheld editor to Track Layout Creator.
(i need TED Editor for it's ability to embed and reload accurately a scaled google map bitmap, i have a solution with a locked transparent layer on my Mac screen for Track Layout Creator but i need to rescale and reoverlay each time, so i use it only for simple tracks that i can complete at once)

I saved my current track as 'track_name'.trk in TED Editor and tried to reopen it inside the Track Layout Creator.
But i get a bunch of errors about Tkinter : Are both formats compatible or is it Tkinter version again ?

Code:
Exception in Tkinter callback
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/tkinter/__init__.py", line 1699, in __call__
    return self.func(*args)
  File "/Users/PS3/GT6/Track Layout Creator 2.0/Track Layout Creator 2.0.py", line 616, in LoadTrack
    unpacked = struct.unpack_from('>3f', polygonbytes, i)
struct.error: unpack_from requires a buffer of at least 12 bytes

Exception in Tkinter callback
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/tkinter/__init__.py", line 1699, in __call__
    return self.func(*args)
  File "/Users/PS3/GT6/Track Layout Creator 2.0/Track Layout Creator 2.0.py", line 1792, in displayChange
    polygonChange()
  File "/Users/PS3/GT6/Track Layout Creator 2.0/Track Layout Creator 2.0.py", line 1799, in polygonChange
    drawPolygon(polygon)
  File "/Users/PS3/GT6/Track Layout Creator 2.0/Track Layout Creator 2.0.py", line 1307, in drawPolygon
    draw_polygon_label()
  File "/Users/PS3/GT6/Track Layout Creator 2.0/Track Layout Creator 2.0.py", line 1275, in draw_polygon_label
    text = '[%d]\nR %d\n%d°' % (index, radius, degrees(sweepAngle))
ValueError: cannot convert float NaN to integer

Exception in Tkinter callback
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/tkinter/__init__.py", line 1699, in __call__
    return self.func(*args)
  File "/Users/PS3/GT6/Track Layout Creator 2.0/Track Layout Creator 2.0.py", line 1802, in trackChange
    drawTrack(polygon)
  File "/Users/PS3/GT6/Track Layout Creator 2.0/Track Layout Creator 2.0.py", line 1333, in drawTrack
    draw_rounded()
  File "/Users/PS3/GT6/Track Layout Creator 2.0/Track Layout Creator 2.0.py", line 1437, in draw_rounded
    draw_cornerCountLabels()
  File "/Users/PS3/GT6/Track Layout Creator 2.0/Track Layout Creator 2.0.py", line 1358, in draw_cornerCountLabels
    pos = distanceToCoords(distance)
  File "/Users/PS3/GT6/Track Layout Creator 2.0/Track Layout Creator 2.0.py", line 993, in distanceToCoords
    segment = segments[segmentIndex]
IndexError: list index out of range

Exception in Tkinter callback
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/tkinter/__init__.py", line 1699, in __call__
    return self.func(*args)
  File "/Users/PS3/GT6/Track Layout Creator 2.0/Track Layout Creator 2.0.py", line 1802, in trackChange
    drawTrack(polygon)
  File "/Users/PS3/GT6/Track Layout Creator 2.0/Track Layout Creator 2.0.py", line 1333, in drawTrack
    draw_rounded()
  File "/Users/PS3/GT6/Track Layout Creator 2.0/Track Layout Creator 2.0.py", line 1437, in draw_rounded
    draw_cornerCountLabels()
  File "/Users/PS3/GT6/Track Layout Creator 2.0/Track Layout Creator 2.0.py", line 1358, in draw_cornerCountLabels
    pos = distanceToCoords(distance)
  File "/Users/PS3/GT6/Track Layout Creator 2.0/Track Layout Creator 2.0.py", line 993, in distanceToCoords
    segment = segments[segmentIndex]
IndexError: list index out of range


It's because they are not compatible formats. They have nothing in common at all actually. The Track Layout Creator is just for creating tracks, you can't edit ted files with it. It's easy to create ted data from a polygon shape, but it's really hard to create a polygon shape from ted data.
 
It's because they are not compatible formats. They have nothing in common at all actually. The Track Layout Creator is just for creating tracks, you can't edit ted files with it. It's easy to create ted data from a polygon shape, but it's really hard to create a polygon shape from ted data.
Ok i understand the incompatibility.
Nothing is perfect.

The only thing missing in Track Layout Creator to be easy to use for replica tracks is the ability to load a background image with the scaled grid on it.
TED Editor can do that but only on the center of the canvas (any corner would have been easier especialy with andalusia which is smaller). Once you have sized your google map bitmap so as to match the 100m grid, you are done and can use it forever.
 
Ok i understand the incompatibility.
Nothing is perfect.

The only thing missing in Track Layout Creator to be easy to use for replica tracks is the ability to load a background image with the scaled grid on it.
TED Editor can do that but only on the center of the canvas (any corner would have been easier especialy with andalusia which is smaller). Once you have sized your google map bitmap so as to match the 100m grid, you are done and can use it forever.

Loading a background image requires the Pillow library and since installing libraries for Python is a complicated business I don't want to use it.

You can load gps coordinates though, with the benefit of not having to worry about the scale or the rotation of the image. Here is Silverstone, for instance, the track length is accurate down to 0.2%. Took about 10 minutes to create this, including getting the gps path from http://www.geocontext.org/publ/2010/04/profiler/en/

(The gps path is the blue dots in the image)

silverstone.png


And here is the result: https://www.gran-turismo.com/es/gt6/user/#!/friend/eran0004/course/2788816/
 
Got a test room open for the new Juan Fangio Autodrome before general release.

Great track! The tunnel is a little bumpy, is that intended? If not, you can make the road segments there a bit shorter and add one more road segment there to increase the mesh resolution. It makes camber transitions more smooth.
 
Great track! The tunnel is a little bumpy, is that intended? If not, you can make the road segments there a bit shorter and add one more road segment there to increase the mesh resolution. It makes camber transitions more smooth.
I think the overall track isn't very smooth in real life, that's what I picked up watching onboard videos anyway. But tbh I didn't really notice but that's probably because I run a slightly softer suspension configuration on my cars.
 
You can load gps coordinates though, with the benefit of not having to worry about the scale or the rotation of the image. Here is Silverstone, for instance, the track length is accurate down to 0.2%. Took about 10 minutes to create this, including getting the gps path from http://www.geocontext.org/publ/2010/04/profiler/en/
I need to check how to do that.
I use GeoContext to extract the elevation profile and then apply it with Elevation Editor (with correction to re-align the profile longitudinaly).
I did not know that the GPS track coordinates could be extracted and applied.
 
Got a test room open for the new Juan Fangio Autodrome before general release.
I tried the track.
Good result pleasant to drive.
This tunnel is great !

The first 'loopback' corner at the end of the start line is a bit bumpy.
The 'loopback' corner before the tunnel and the tunnel itself are a bit more bumpy.
Once you get used to the track, you can manage easily those little bumps.
 
I tried the track.
Good result pleasant to drive.
This tunnel is great !

The first 'loopback' corner at the end of the start line is a bit bumpy.
The 'loopback' corner before the tunnel and the tunnel itself are a bit more bumpy.
Once you get used to the track, you can manage easily those little bumps.
Strange both you & eran feel the bumpyness, I hardly notice it even when using a loan GT500 car in arcade.
Maybe I'm used to it what with going round & round countless times while building it.

I'll look into it before I release it.
 
Last edited:
Back