XTrackCAD
Seccions d'aquesta pàgina 6
01General#
- Modelisme
- Circuits / Layouts
- XTrackCAD
- XTrkCAD
Model
RR Track Planner (Sourceforge)
- Tickets
- Feature requests
- Bugs
- Files (File / Parameter files / Browse)
- /usr/local/share/xtrkcad/params/
- flnpicco.xtp (Fleischmann Piccolo 9xxx)
- rocon.xtp (Roco 22xxx) (2017-10-15: replaced by N-fl.xtp)
- N-fl.xtp (fpm) (Fleischmann 222xx)
- usuari / user
- Custom structures (STRUCTURE), prototypes
(CARPROTO), turnouts (TURNOUT)
- Manage -> Custom defined parts
- ~/.xtrkcad/xtrackcad.cus
- Custom structures (STRUCTURE), prototypes
(CARPROTO), turnouts (TURNOUT)
- ...
- /usr/local/share/xtrkcad/params/
- Tickets
02Documentació / Documentation#
- Ús / Usage
- Problema tamaño Roco 22207 xtrkCAD AVISO a USUARIOS DEL PROGRAMA
- Reviews
- XTrkCad
- Model Railway/Railroad Layout Design Software
- downloadable examples
- XTrkCad
- Model Railway/Railroad Layout Design Software
- File
formats
- U: information from turnout designer
U "Regular turnout" "" "<manufacturer>" "<left_description>" "#_left" "<right_description>" "#_right" <length> <angle> <height> <length> <roadbed_width> <line_width> <colour>
- E: unconnected end points
- S: straight track segment
- C: curved track segment
- U: information from turnout designer
03Instal·lació / Installation#
- rpm
- Mageia
- download
rpm
urpmi xtrkcad-setup-4.3.0-1.i686.rpm- Problemes / Problems
- Un paquet demanat no es pot instal·lar:
xtrkcad-4.3.0-1.i686 (a causa de webkitgtk no satisfetes)
- Un paquet demanat no es pot instal·lar:
- download
rpm
- Mageia
- sh
- xtrkcad-setup-4.3.0-1.i686.sh
- chmod +x xtrkcad-setup-4.3.0-1.i686.sh
- ./xtrkcad-setup-4.3.0-1.i686.sh
- xtrkcad-setup-4.3.0-1.i686/bin/xtrkcad
- Problemes / Problems
- ./xtrkcad: error while loading shared libraries: libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory
- tgz
- codi font / source code
- Baixa el codi / Download code
- Current release
- Download and install
- XTrkCAD
Model RR Track Planner (Sourceforge)
- xtrkcad (tree)
- Bugs
- Forks
- cescp
/
xtrkcad-fork
- DXF with elevations
- cescp
/
xtrkcad-fork
- Dependencies
- Mageia
urpmimercurial
- Mageia
- old instructions
https://sourceforge.net/projects/xtrkcad-fork/files/XTrackCad/Version%204.3.0/xtrkcad_4_3_0.hg/downloadmkdir xtrkcadcd xtrkcadhg inithg unbundle ../xtrkcad_4_3_0.hg- create and edit .hg/hgrc adding these lines:
[paths]
default = http://hg.code.sf.net/p/xtrkcad-fork/xtrkcad
hg pullhg update
- first time
cd ~/src/- hg clone http://hg.code.sf.net/p/xtrkcad-fork/xtrkcad
- cd xtrkcad
- next times
cd ~/src/xtrkcad/- hg pull
- hg update
- Compilació / Compilation
- Dependències / Dependencies
- Mageia
urpmi cmake task-c++-devel lib64gtk+2.0-devel lib64zip-devel lib64cmocka-devel lib64freeimage-devel inkscape
- Mageia
- Build
notes
cd ~/srccd xtrkcadmkdir buildcd buildccmake ../- c
CMAKE_BUILD_TYPE *Debug
CMAKE_INSTALL_PREFIX */usr/local
INTL_LIBRARY
LIBZIP_VERSION *1.5.2
XTRKCAD_USE_BROWSER *ON
XTRKCAD_USE_DOXYGEN *OFF
XTRKCAD_USE_GETTEXT *OFF
XTRKCAD_USE_GTK *ON
- c
- g
- c
- make
- sudo make
install
- old instructions
- ~/src/xtrkcad/app/lib/Readme.md
cd [/disc]
mkdir -p build/xtrkcadcdbuild/xtrkcadccmake ../../src/xtrkcad- c
CMAKE_BUILD_TYPE *Debug
CMAKE_INSTALL_PREFIX */usr/local
INTL_LIBRARY */usr/lib64/libintl.so
XTRKCAD_USE_BROWSER *ON
XTRKCAD_USE_DOXYGEN *OFF
XTRKCAD_USE_GETTEXT *ON
XTRKCAD_USE_GTK *ON
- c
- g
- c
makesudo make install
- ~/src/xtrkcad/app/lib/Readme.md
- Eclipse
(Eclipse
CDT4 Generator)
- Dependències / Dependencies
- Mageia
urpmi gdb
- Mageia
mkdir -p build/xtrackcad_eclipse
cdbuild/xtrkcad_eclipseccmake -G"Eclipse CDT4 - Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug ../../src/xtrkcad- launch Eclipse
- Import...
- C/C++ Existing code as Makefile project
- ...build/xtrackcad_eclipse/
- Toolchain:
- Linux GCC
- Dependències / Dependencies
- Problemes / Problems
- Bugs
- .../xtrkcad/app/bin/dlayer.c:638:
undefined
reference to `_itoa'
- Solució / Solution
- #204: solved
- app/bin/dlayer.c
char *_itoa(long i, char* s, int dummy_radix) {
sprintf(s, "%ld", i);
return s;
}
- Solució / Solution
- Dependències / Dependencies
- Baixa el codi / Download code
04Ús / Usage#
- Tutorials
- Help
- Demos
- Examples
- Beginner's tutorial
- Structure
Tutorial
- edificacions
- Planning The Altamont and Blue Ridge 2
- Help
- Command line:
xtrkcad [-v] [-l logfile] [-d {logmodule}[={0,1,2,...}]] [trackfile]- logmodule: init, malloc, error, command, shortPath,
fillElev, structure, traverseTurnout, turnout, print,
paramLayout, hotspot, switchmotor, ease, traverseJoint,
undo, pan, zoom, track, group, block, profile, curve,
carDlgList, carDlgState, join, modify
- get all logmodule values:
grep LogFindIndex -R .
- get all logmodule values:
- Examples:
xtrkcad -l xtrkcad.log -d init -d track -d command toto.xtcxtrkcad -l /dev/stdout -d init -d track=4 -d print toto.xtc
- logmodule: init, malloc, error, command, shortPath,
fillElev, structure, traverseTurnout, turnout, print,
paramLayout, hotspot, switchmotor, ease, traverseJoint,
undo, pan, zoom, track, group, block, profile, curve,
carDlgList, carDlgState, join, modify
- Options / Layout:
- Scale: N
- Preferences
- File / Parameter files / Browse
- Fleischmann
222xx
- /usr/local/share/xtrkcad/params/N-fl.xtp
- ~/xtrkcad/params/rocon_mm.xtp
- Fleischmann
222xx
- Custom
- Exemples / Examples
- Manage
- Turnout designer
- Custom defined parts
- Edit
- Construcció del circuit / Build layout
- seleccioneu la via a dalt / select track on top
- moveu-la a prop d'una via existent / move it next to existing track
- trieu-ne l'orientació fent: majúscula + clic esquerre / choose end by: shift + left click
- posicioneu-la amb la barra d'espai / fix it with space bar
- Pan
- [shift+] arroy keys
- View -> Pan/Zoom
- Selecció / Select
- Change -> Select (Ctrl + E)
- selecció de totes les vies connectades / select all
connected tracks
- Shift: to select all segment
- selecció de vies individuals / select individual tracks:
- Ctrl: to add tracks
- selecció de vies entre dues vies / select all tracks
between two tracks:
- seleccioneu la primera via / select first track
- seleccioneu amb CTRL l'última via / ctrl select last track
- seleccioneu amb majúscules totes les vies del mig / shift to select all tracks in between
- unselect
- ESC
- Move
- Change -> Move (Shift + Ctrl + M)
- Join
- movent / moving
- select section
- Change -> Join tracks
- Shift + click on end point of selected section
- click on the other section
- afegint vies flexibles / adding flex tracks
- select section
- Change -> Join tracks
- click on end point of selected section
- click on the other section
- movent / moving
- Connect (slightly move all tracks to get a connection)
- Options -> Preferences: Connection Distance
- Change -> Connect Two Tracks
- Split
- Split track icon
- Elevation
- if you define an elevation at one point, all connected tracks will have the same elevation (gold)
- if you define elevation at two points, all connected
tracks will have calculated elevation (purple)
- tracks beyond those point will maintain the elevation (gold)
- to display the grade of endpoints, set the elevation endpoint as Grade
- Track elevations
- gold: defined
- purple: calculated
- Impressió / Print (File -> Print)
- circuit en diverses pàgines / layout in several pages
- Print Scale (tab to apply value; do not use enter)
- Page Width, Height to define dimensions for each page (Max to set it to maximum possible value for given Print Scale)
- Page Format to define orientation of selected part (does not have any effect in final pdf orientation)
- select wanted pages on layout (Select All to select them all; Clear to unselect them all)
- tot el circuit en una pàgina / all layout in one single
page
- Snap Shot
- etiqiuetes / labels
- controlled by values in Options -> Display
- Two Rail Scale < x (2x when printing)
- Label Scale <= y (y when printing, but you may want to increase Label Font Size; if values do not appear on display, they will not appear on print)
- Label Font Size: must be, at least, the double of Print Scale
- controlled by values in Options -> Display
- circuit en diverses pàgines / layout in several pages
05Trens / Trains#
- Running a train
- Exemples / Examples
- Help -> Examples...: cascade.xtc
- Parameters Files (app/lib/params/)
-
file CONTENTS CARPROTO
loco
- Diesel (10101)
- Steam (10201)
- Electric (10301)
freight (30100)
(Guide to railcars)passenger (50100) Maintenance of Way (70100) Other (90100) br.xtp British Rolling-stock Prototype Cars - Diesel
- 01 02 03 04 05 06 07 08 14 15 16 17 121 141/142 143 150 153 156 158 20 31 33 33/2 37 47 56 60 66 HST
- Electric
- 73 85 86 87 90 91
- CCT
- GUV
- POS
- BG
eu.xtp European Rolling-Stock Prototype Cars - - Bogie Large Van (Cargowaggon) 20.8m
- Twin RIV Van (use in pairs)
protoam.xtp North American Rolling-Stock Prototype Cars - Diesel
- 44t
- AC4400CW, AC6000CW
- AEM7
- C30-7
- Dash 8-40B, Dash 8-40BW, Dash 8-40C, Dash 8-40CW
- DD-40X
- E8A
- F3A, F3B, F9A, F9B, FP7, F59PHI
- H15-44, H16-44, H15/16-44
- M420
- RS1, RS3, RS4/5, RS11, RSD12
- S1, S2, S3, S4
- SW7, SW9, SW1200
- U23B, U23C, U25B, U25C, U28C, U30B, U30C, U33B, U33C, U50C
- GP7, GP9, GP35, GP38, GP39, GP40, GP40-2
- SD35, SD38, SD39, SD40, SD40-2, SD40-2F, SD45, SD50, SD60, SD60M, SD70M, SD75M
- Box (40, 50, 53, 60, 86)
- Caboose (34 Cupola, Ext Vision)
- Gondola (42, 50, 65)
- Flat (42, 50, 60, 89)
- Hopper (25, 30, 45, 67)
- Hopper, Centerflow (36, 40, 50, 56)
- Hopper, Covered (35, 40, 50)
- Hopper, Cyl (50, 56)
- Reefer (36, 40, 50, 57)
- Stock (40, 50, 60, 85)
- Tank (28, 39, 40, 55, 60, 65)
- Coach (80)
proto-ng.xtp
protosteam.xtp
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- Notes:
-
awk 'BEGIN {ORS=" "} $1 ~ /^CARPROTO/ && $4 ~ /10101/ {gsub(/\"/,"",$2);print $2}' protoam.xtp
-
- ...
-
- Car inventory
- és un inventori real; si poseu un cotxe al circuit, desapareixerà de la barra. Però podeu afegir tants cotxes com calgui / this is a real inventory: if you place a car onto the layout, it will disappear from the hot bar. But you can add as many cars as you need
- Posicionament d'un cotxe / Placing a car (Linux)
- seleccioneu el mode tren / select train mode
- seleccioneu un cotxe a la barra / select one car on the hot bar
- moveu el cursor al circuit / move cursor to layout
- feu clic amb el botó dret (noel deixeu anar) i moveu el cursor (si no moveu el cursor, el cotxe no apareixerà) / left-click (do not release) and move the cursor (if you do not move the cursor, the car will not be displayed)
- deixeu el cotxe allà on vulgueu / place the car where you want
- Desviaments / Turnouts
- shift + left click to change its position
- Custom
- Manage -> Custom defined parts
- Car Prototype
- Car Part
- Move
- per a moure'l a un fitxer separat / to move to a separate file (.xtp)
- la primera vegada que es crea cal posar una etiqueta / the first time it is created, a label must be entered
- les properes vegades els elements s'afegiran al fitxer / next times, items are added to the file
- exemples / examples
- francesc.pinyol.m
/ xtrkcad-custom-fpm
- proto-fpm.xtp
- francesc.pinyol.m
/ xtrkcad-custom-fpm
- Manage -> Custom defined parts
- File format
-
Create a new: Car prototype cm for 1:1
- Car Length: 1524,000 (cm for 1:1 train)
- Truck Centers: 1224,280
- Width: 304,800
- Center Offset: 0,000
- Car Length: 2640,00 cm
protoam.xtp inches for 1:1 CARPROTO "Coach, 80'" 0 50100 960.000 120.000 0 0 842.000 992.000 CARPROTO "elec_1524" 2 10301 600.000 120.000 0 0 482.000 632.000
inventory
my_layout.xtc inches for model (e.g. 1:160) CAR 3 N "Unknown Coach, 80' " 512 50100 6.000 0.750 0 0 5.263 6.200 16744448 0.000 0.000 0 0 0 0 0 0 0 0 0 "" 492 0 40.088 65.418 60.000 CAR 12 N "Custom elec_1524 elec 1524 " 518 10301 3.750 0.750 0 0 3.013 3.950 16744448 0.000 0.000 0 0 0 0 0 0 0 0 0 "" 518 0 57.067 58.858 270.000
measurement on layout
- Length: 15.240cm
- Length: 9.520cm
- Width: 1.905cm
- Length: 16.5cm
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- 12 inches = 1 foot
- 960 inches = 80 feet
- ...
-
- Problemes / Problems
- ...
063D#
- Viewers
- XTrackViewer
- XtrackCad
3D (XTrackCAD User Group)
- XTrackCAD User Group
- 3D Viewer Update (5th Oct 2023)
- XtrackCad 3D (12th May 2022)
- Codi
- cd
Xtrk3D
- ln -s Interface.h interface.h
- ln -s Vertex.h vertex.h
- dotnet build -v d
- cd
Xtrk3D
- Requisits
- Mageia 9
- sudo dnf install glm-devel lib64glew-devel
- sudo dnf install lib64glew-devel
- Mageia 9
- Baixada / Download
- Xtrk3DViewer
Files
- Xtrk3DViewer_0_12_5_source.zip
cd ~/Baixades/mv Xtrk3DViewer_0_12_5_source.zip ~/src/cd ~/src/unzip Xtrk3DViewer_0_12_5_source.zip
- Xtrk3DViewer
Files
- Modificacions del codi font / Modifications on
source code
- See: linux_build.md
cd ~/src/Xtrk3DViewer/- init git
git initgit add .git commit -m "initial import"
- replace backslashes by slashes:
sed -i '/^#include/ s*\\*/*g' */*.hppsed -i '/^#include/ s*\\*/*g' */*.hsed -i '/^#include/ s*\\*/*g' */*.cpp
- link header files so as when referenced in
different case an error is not raised:
- ln
-s Interface.h
Xtrk3D/interface.h
- ln -s Vertex.h Xtrk3D/vertex.h
- ln -s misc.h Xtrk3D/Misc.h
- ln
-s TrackPlan.h Xtrk3D/Trackplan.h
- ln
-s Interface.h
Xtrk3D/interface.h
- or replace references to the correct file:
- sed -i '/^#include/ s*interface.h*Interface.h*g' */*.{cpp,h,hpp}
- sed -i '/^#include/ s*vertex.h*Vertex.h*g' */*.{cpp,h,hpp}
- sed -i '/^#include/ s*Misc.h*misc.h*g' */*.{cpp,h,hpp}
- sed -i '/^#include/ s*Trackplan.h*TrackPlan.h*g' */*.{cpp,h,hpp}
- other references to header files:
sed -i 's*#include "../../zip/zip_file.hpp"*#include "zip/zip_file.hpp"*g' ./Xtrk3D/PolygonSet.cpp
- ...
- Compilació
- cmakeconverter
- ...
- dotnet-vcxproj
- Install
.NET on Linux
- Scripted
install
- .vcxproj
and .props file structure
echo 'export PATH="$HOME/.dotnet:${PATH}"' >>~/.bashrc
- Scripted
install
- (once) clone repo:
cd ~/src/git clone https://github.com/roozbehid/dotnet-vcxproj.git
- (once) install templates:
cd ~src/dotnet-vcxproj
dotnet new install GCC.Build.Template- will install gccbuild template
- to list all installed templates
dotnet new list
- go to your project
cd ~/src/Xtrk3DViewer/- modify the name of the configurations
(Debug|x64 -> LinuxDebug|x64):
sed -i 's/Debug|x64/LinuxDebug|x64/g' Xtrk3DViewer.slnsed -i 's/Debug|x64/LinuxDebug|x64/g' */*.vcxproj
- or set environment variables:
- export SolutionDir=~/src/Xtrk3DViewer
- export VCTargetsPath=.
- export LANGUAGE=en
- add AdditionalIncludeDirectories
- ./Xtrk3D/Xtrk3D.vcxproj
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='LinuxDebug|x64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>../thirdparty</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
- ./Xtrk3DViewer/Xtrk3DViewer.vcxproj
- ...
- ./Xtrk3D/Xtrk3D.vcxproj
- or replace references to the correct
file:
- sed -i '/^#include/ s*interface.h*Interface.h*g' */*.{cpp,h,hpp}
- sed -i '/^#include/ s*vertex.h*Vertex.h*g' */*.{cpp,h,hpp}
- sed -i '/^#include/ s*Misc.h*misc.h*g' */*.{cpp,h,hpp}
- sed -i '/^#include/ s*Trackplan.h*TrackPlan.h*g' */*.{cpp,h,hpp}
- other references to header files:
sed -i 's*#include "../../zip/zip_file.hpp"*#include "zip/zip_file.hpp"*g' ./Xtrk3D/PolygonSet.cpp
dotnet new gccbuild- modificarà / will modify:
*/*.vcxproj
- crearà / will create:
*/Microsoft.Cpp.Default.props*/project.json
- modificarà / will modify:
dotnet clean-p:Configuration=LinuxDebug -p:Platform=x64
dotnet build -v d -p:Configuration=LinuxDebug -p:Platform=x64
- dotnet
build -v d
- Problemes
- Flags look to not be properly passed to compiler #21
- EarcutWrapper.cpp(45,85): error : invalid use of non-static member function ‘glm::detail::tvec2<T, P> glm::detail::tvec3<T, P>::xy() const [with T = float; glm::precision P = glm::highp]’ [/disc/src/Xtrk3DViewer/Xtrk3D/Xtrk3D.vcxproj]
cd Xtrk3D; g++ -fmax-errors=1000 -I "../thirdparty" -D_DEBUG -D_LIB -Wall -Wno-comment -Wno-parentheses -Wno-missing-braces -Wno-write-strings -Wno-unknown-pragmas -Wno-attributes -fpermissive -x c++ -g2 -gdwarf-2 -m64 -c Trackplan.cpp -o "obj/x64/LinuxDebug/Trackplan.o"Trackplan.cpp:425:68: error: invalid use of member function ‘glm::vec<2, T, Q> glm::vec<3, T, Q>::xy() const [with T = float; glm::qualifier Q = glm::packed_highp]’ (did you forget the ‘()’ ?)
425 | float len = glm::length(m2.xy - m1.xy);
| ~~~^~- glm
- versions
- thirdparty: GLM 0.9.5.4: 2014-06-21
- Linux package:
glm-devel-0.9.9.8 - error: cannot bind non-const lvalue reference of type 'Xtrk3D::Shape&' to an rvalue of type 'Xtrk3D::Shape'
- swizzle
- error : invalid use of non-static member function 'glm::detail::tvec2<T, P> glm::detail::tvec4<T, P>::xy() const
- e.g. segment.cpp L257 has already parenthesis
- solution: use parenthesis everywhere
- error : cannot bind non-const lvalue reference of type '...&' to an rvalue of type ''
- solution: create a variable
- error : expected primary-expression before 'struct'
g++ -fmax-errors=1000 -I "../thirdparty" -D_DEBUG -D_LIB -Wall -Wno-comment -Wno-parentheses -Wno-missing-braces -Wno-write-strings -Wno-unknown-pragmas -Wno-attributes -fpermissive -x c++ -g2 -gdwarf-2 -m64 -c Structure.cpp -o "obj/x64/LinuxDebug/Structure.o"- solution:
struct CS(...) -> {...}- error : cannot bind non-const lvalue reference of type 'glm::vec3&' {aka 'glm::detail::tvec3<float, glm::highp>&'} to an rvalue of type 'glm::detail::tvec3<float, glm::highp>'
g++ -fmax-errors=1000 -I "../thirdparty" -D_DEBUG -D_LIB -Wall -Wno-comment -Wno-parentheses -Wno-missing-braces -Wno-write-strings -Wno-unknown-pragmas -Wno-attributes -fpermissive -x c++ -g2 -gdwarf-2 -m64 -c track.cpp -o "obj/x64/LinuxDebug/track.o"- ...
- ...
- Problemes
- Install
.NET on Linux
- monodevelop
- Open: Xtrk3DViewer.sln
- Problemes:
- "This project type is not supported by
MonoDevelop"
- només suporta fitxers amb .net; no en c++
- Feature list
- "This project type is not supported by
MonoDevelop"
- VSCode
- Instal·lació
- Visual
Studio Code on Linux
- Extensions
- C/C++ Extension pack
- vscode-solution-explorer
- Extensions
- Install
.NET on Linux
echo 'export PATH="$HOME/.dotnet:${PATH}"' >>~/.bashrc
- Visual
Studio Code on Linux
- ...
- Instal·lació
- DEPRECATED:
xbuild Xtrk3D.vcxproj- sudo dnf install mono-devel
msbuild Xtrk3D.vcxproj- sudo dnf ?
- cmakeconverter
- XTrackCAD User Group
- XtrackCad
3D (XTrackCAD User Group)
- XTrackViewer
- DXF
- select all tracks to be exported
- Export DXF
- Use a CAD program (e.g. Blender + DWG/DXF plugin, FreeCAD)
- Feature requests
- Fork
http://www.francescpinyol.cat/.html
Primera versió: / First version: 2.I.2021
Darrera modificació: 2 de juny de 2024 / Last update: 2nd June
2024