Would it be somehow possible to include the elevation
data into the exported DXF-file or alternatively to
introduce an alternate 3D style export based on simple
definitions like height of roadbed, ties and rails to
get the tracks reasonably right (and the splines along
which our virtual locos might ride)?
I've made a fork where elevation is kept in DXF export:
https://sourceforge.net/u/cescp/xtrkcad-fork/ci/default/tree/
It's a first attempt to make it possible to see the layout in 3D,
by opening the exported DXF file with a CAD program (e.g. FreeCAD).
In my code, I do not tilt the tracks in space. Instead, given the weak
slopes used in layouts, I've just added the z coordinate in DXF
output.
Up to now, it's working with straight tracks, curved tracks, simple
turnouts and double turnouts.
What is not completely working yet are curved tracks (or curved
sections of turnouts): as I do not kwnow how to specify tilts for
arcs in DXF, centres are at the correct height, but the curves are
completely horizontal. See attached files.
Is this the right approach to have a 3D view of a layout?
Can someone help with the issue about curved tracks?
Last edit: Francesc Pinyol Margalef 2018-01-14
Here is the xtc file.
Francesc,
To quote from https://www.autodesk.com/techpubs/autocad/acad2000/dxf/
So, if you want a curve in 3D space, you either have to use a 3D entity polyline - or (I guess) to reorientate the current OCS plane so that the 2D object lies on it. (I dont know if you can do this object by object, but I suppose it is plausible to think that if you set the extrusion direction to be orthogonal to the 2D object's plane that might do it?). Note if you do this, though, you will have to adjust the elevation to be in terms of that dimension - by projecting the elevation you want to be in the new Z for the curve OCS rather than the one in XtrkCAD which is in WCS.
Hope that gives you a few clues...
Adam