The online racing simulator
SVG-to-Layout: autocross layouts from pictures or drawings
The idea is:
1) Draw the layout in Inkscape (https://inkscape.org)
2) A tool that turns the .svg drawing into a layout.

The advantage is that one can add a reference image in background and trace the course there.

I just realized rest of post looks way to scary with all the links and explanations so just watch the video:
Video: https://www.youtube.com/watch?v=K-ppxFYI-_8



It is not the goal to draw the *complete* track in inkscape but rather just the important positions.
Details like curbs, turn markers, chalk etc can better be added with the normal LFS editor.
But for example load the image of a track that one wants to create and mark the edges of the road: That gives accurate references for continuing to work in LFS editor.

Another nice thing is that in Inkscape with few clicks one can create shapes that in LFS editor would take lots of effort:
-spirals
-circles
-triangles, hexagons, pentagram etc..
-or just many cones along a curved line


Notes:
-LFS track images: https://www.lfs.net/forum/post/676857
-Save drawing as layout.svg in same folder as the tool

-document must be sized 2560x2560 pixel and "centered" at 0:0

-It only works with rectangles. (I do not want to write whole svg graphic parser)

-To place different objects: Rightlick on rectangles, set "Label" in object properties.
See https://www.lfs.net/programmer/lyt which number creates which object.

-It does not work, LFS just spams "coordinates out of bound" or something:
Sometimes Inkscape messes up the file in a way that the tool can not read it.
For example the coordinate-system-blablub can be shifted around and then the file contains something like:

Basically that means every object is not placed at position Y but at position Y+offset.
This confuses the tool.
To get rid of that:
-Select everything, go to menu "Objects" - "Ungroup"
-Move objects a bit to left then back to right with arrow keys
-If all else fails, edit the .svg with a text editor

It might work with other vector programs, but if they save in even slightly way then the tool can probally not read it. I use Inkscape version 0.48
Attached images
evil transform in svg.png
Attached files
SVG-to-Layout v1.zip - 518.7 KB - 565 views
AU1_SCCALabor Day Autocross.lyt the layout that can be seen in the video.
All the poles were placed in Inkscape on reference image then I added the rest in LFS. (turn markers etc)

BL3_Schnecke is a track that might be quite tiring to do solely in LFS because it is so many pylons:


BL3_knubbelfluss is nothing special, just drew a freehand line and placed cones on it, then added some curbs etc.
Attached images
September-2013-Map-Final.png
schnecke.jpg
Attached files
AU1_SCCALabor Day Autocross.lyt - 2.1 KB - 675 views
BL3_Schnecke.lyt - 1.9 KB - 701 views
BL3_knubbelfluss.lyt - 3.7 KB - 524 views
Respect mate
thanks
-
(L@gger) DELETED by L@gger : Misclick before finished reply
I really like the idea of layout editor based on graphical input for the real layouts recreation.
Unfortunately this version is old and has some bugs that are limiting its usage.

I made a revision with following improvements to extend the possibilities.
The workflow with the tool is the same.

Tested with LFS06R and Incscape 0.92.3

Improvements:
  • Accuracy of object placement now better than 0.07m. Before it was > 1m
  • Now supports heading of objects.
  • Logs redesigned.
Now the tool can be used for 90% of the layout work if following the tips. The tool is still not robust as .SVG parser is simple and partial. Therefore you need to use predefined template / workflow to create layouts without issues.

Except the listed problems by Gutholz there are few problematic things not mentioned:
  • Placement on layer that is not positioned at [0,0] and of size 2560x2560 will yield bad results.
    Mostly invalid object positions. Be careful with clicking on different layer and read the tips.
  • Bad rectangle size. Use the rectangle size of the object you are trying to place.
Hope this helps. I personally use the tool for Formula Student race tracks recreation.

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

Marek
Attached images
Generator_Overview.png
Attached files
SVG-to-Layout v1_1.zip - 5.6 MB - 561 views
Nice work, that should make it much more useable.
Cool that the tool even found some "real world use"!
Hey guys I've used this tool and followed all steps as above, the autocross track is set at 0,0 and sized at 2560x2560. However, when I use the svg to layout tool it says the cones are in an invalid track position. Cheers
I have been trying to debug some issues I've been having with this software. It works, mostly, but some cones just get completely ignored and I can't figure out why. I've been trying to make some changes and compile from the source, but I have been unable to get this to work as I get tons of errors when compiling, even with no changes.
First, sorry for the inconvenience. This is maybe my worst program ever. Schwitz
Over the years multiple people have contacted me with problems and I could only help like maybe half of them.

If cones get ignored, there is likely something silly in the svg file.
If you attach the svg file I can take a look.

In hindsight, going with svg files was a bad plan. I knew that svg files are complex but I did not foresee how messed up all image-editors sometimes save the files. svg can include scaling, rotation, shifted origins and all kind of stuff that my program can not deal with. Often editors create files that look the same but internally are completly different. In Inkscape, even just opening a file, adding one dot/cone does sometimes mess up the whole coordinate system for all other elements. It makes debugging very tiresome.

compiling:
I also had problems with that on my new computer. Actually I think it was linker problems.

I still like the idea of such editor but at the moment I just do not have the time for it.
I would likely try creating the graphical editor-part in Lua but there is no insim lib for that. Then the editor would create a list of LFS-coordinates as txt-file and another script would send those to LFS.
If someone wants to cooperate on that, message me.
I fixed my problems, kinda
After looking through the code and the SVG that I was outputting from Inkscape, I determined the problem lay with the fact that the code has nested while loops that operate on the same file stream. The SVG that at least my Inkscape outputs contains both the /> and the <rect within the same line. So the loop ended up skipping every other rectange. I had exactly half the number of cones I placed.

While I could have just manually edited my SVG file to make it work, I ended up modifying the code a bit so that it would always work with all cones. The only issue is that any cones without a transformation will still get ignored.

I was able to design a course for my local AUTOX group for this weekend and will definitely be using it in the future! Happy to help work on some future improvements. Attached is my revision.

P.S. The compiling problems were due to missing the pthread DLLs and went away as soon as I installed them and linked them correctly.
Attached files
revised.zip - 172.6 KB - 167 views

FGED GREDG RDFGDR GSFDG