XTrackCAD

Índex / Index

General

Documentació / Documentation

  • 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

Instal·lació / Installation

  • rpm
  • 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
    • Compilació / Compilation
      • Dependències / Dependencies
        • Mageia
          • urpmi cmake task-c++-devel lib64gtk+2.0-devel lib64zip-devel lib64cmocka-devel lib64freeimage-devel inkscape
      • Build notes
        • cd ~/src
        • cd xtrkcad
        • mkdir build
        • cd build
        • ccmake ../
          • 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
        • make
        • sudo make install
      • old instructions
        • ~/src/xtrkcad/app/lib/Readme.md
          • cd [/disc]
          • mkdir -p build/xtrkcad
          • cd build/xtrkcad
          • ccmake ../../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
          • make
          • sudo make install
      • Eclipse (Eclipse CDT4 Generator)
        • Dependències / Dependencies
          • Mageia
            • urpmi gdb
        • mkdir -p build/xtrackcad_eclipse
        • cd build/xtrkcad_eclipse
        • ccmake -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
      • Problemes / Problems

Ús / Usage

  • Tutorials
  • 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 .
      • Examples:
        • xtrkcad -l xtrkcad.log -d init -d track -d command toto.xtc
        • xtrkcad -l /dev/stdout -d init -d track=4 -d print toto.xtc
  • Options / Layout:
    • Scale: N
  • Preferences
  • File / Parameter files / Browse
    • Fleischmann 222xx
      • /usr/local/share/xtrkcad/params/N-fl.xtp
      • ~/xtrkcad/params/rocon_mm.xtp
  • Custom
  • 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
  • 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

Trens / 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
      • Coach (80)


      proto-ng.xtp





      protosteam.xtp





    • 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)
    1. seleccioneu el mode tren / select train mode
    2. seleccioneu un cotxe a la barra / select one car on the hot bar
    3. moveu el cursor al circuit / move cursor to layout
    4. 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)
    5. 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
  • 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
    • 12 inches = 1 foot
    • 960 inches = 80 feet
    • ...
  • Problemes / Problems
  • ...

3D

  • Viewers
    • XTrackViewer
      • XtrackCad 3D (XTrackCAD User Group)
        • XTrackCAD User Group
        • Codi
          • cd Xtrk3D
            • ln -s Interface.h interface.h
            • ln -s Vertex.h vertex.h
          • dotnet build -v d
        • Requisits
          • Mageia 9
            • sudo dnf install glm-devel lib64glew-devel
            • sudo dnf install lib64glew-devel
        • Baixada / Download
        • Modificacions del codi font / Modifications on source code
          • See: linux_build.md
          • cd ~/src/Xtrk3DViewer/
          • init git
            • git init
            • git add .
            • git commit -m "initial import"
          • replace backslashes by slashes:
            • sed -i '/^#include/ s*\\*/*g' */*.hpp
            • sed -i '/^#include/ s*\\*/*g' */*.h
            • sed -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
          • 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
            1. Install .NET on Linux
            2. (once) clone repo:
              • cd ~/src/
              • git clone https://github.com/roozbehid/dotnet-vcxproj.git
            3. (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
            4. 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.sln
                • sed -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
                  • ...
              • 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
              • 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]
                  • ...
          • monodevelop
            • Open: Xtrk3DViewer.sln
            • Problemes:
              • "This project type is not supported by MonoDevelop"
          • VSCode
          • DEPRECATED: xbuild Xtrk3D.vcxproj
            • sudo dnf install mono-devel
          • msbuild Xtrk3D.vcxproj
            • sudo dnf ?
  • DXF

http://www.francescpinyol.cat/.html
Primera versió: / First version: 2.I.2021
Darrera modificació: 28 de gener de 2024 / Last update: 28th January 2024

Valid HTML 4.01!

Cap a casa / Back home.