18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-01 19:57:06 +01:00
Commit Graph

4 Commits

Author SHA1 Message Date
maj00r d87da1c476 feat(editor): the joints of old tracks as hard points of the pieces, the names, events and circuits of the old tracks kept by the lines
E6 (editor-tracks-domain.md §5 "Podział na kawałki zachowuje miejsca...", §10 "Stare złącza jako twarde punkty podziału"), the hook of the
generator E2a left (generator_options::hard_splits, a line given any refused).

- A line keeps the old tracks it was taken over from (line::hard_splits): where along it the stretch of each begins, its name, the words of
  its entry before the path (the width, the friction, ... the visibility and the materials) and after it (the speed, the events, the
  isolated circuits and the rest), whether it ran against the line. In the line rather than in the options of the generator, so a command
  which cuts or joins lines carries them and an undo puts them back: a line cut (split_line, a turnout laid into it) gives those past the
  cut to the part after it, and the old track cut in two keeps its name and its events on the part it ran into first, the other part a
  stretch of it the generator names (continued); two lines joined, the second one's after the first one's.
- The generator ends the pieces at each joint inside the line (a joint stays, a break of the elements next to it gives way) and writes the
  pieces of a stretch as the old track was: its name on the piece it ran into first with all its attributes, <name>_2, <name>_3... on the
  others with them but its events (an event of a track is called once), its surface, the path written the way it ran (event1 and event2,
  the sign of the rolls); an old track of no name named by the generator, its events kept. A line with none is made as before.
- The project file: "old <chainage> <name> reversed <0|1> continued <0|1> surface <words> attributes <words>" in the block of a line;
  version 1, unreleased, read as before without them.

Tests: G: a line of three curves given three old tracks (one named with its events and its circuit, one of no name, one which ran against
the line): the pieces end at the joints, each name once, the attributes of the first on its first piece and without its event on the
others, the event of the unnamed one once, the one which ran against the line written from the end of the line; written into the project
file and read back the same. It takes the place of the E2a case of the hook refusing. Unit tests 1103 -> 1103.
2026-11-23 16:59:27 +01:00
maj00r ca1f2239df feat(editor): the double, symmetric and secant switches, the slips and the crossings of the catalogue in the domain model
E5 (editor-tracks-domain.md §4 "Rozjazd", §7): every type of the catalogue is a turnout the model lays, its tracks lines it owns and its
legs nodes, kept whole or refused like the ordinary switches E2b laid. E2b refused the rest with "stage E5".

- Secant blades (S42): the diverging track runs along the main one for the pre-blade stretch and turns off it by the angle of the blades
  at their tips, the rest of 1:n on its arc; a turn inside the track, the node at the start keeping the heading of the main track. The
  generator ends a piece there with the heading of the element before it (unchanged where a line runs on in its heading).
- Double switches (Rpd, Rpj, Rps): the main track cut at the start of the second switch, its node holding the main track, the main track
  of the second switch (main2) and its diverging track, to the other side or the same one, as switch_design::build() lays it. Written as
  the switch tool writes them: the first switch, a plain track of a metre before the second one (the simulation joins a switch to plain
  tracks only), the second switch.
- Symmetric switches (Rls): both tracks turning off by half of the angle, to both sides, laid at a free end of a line, which they end (the
  line beyond it would have to turn at the node); not moved along the line.
- Slips (Rkp, Rkpd) and diamond crossings (Skrz): the main track a part of the line, the crossing track across its middle at the angle of
  the slip between two nodes of its own, the slip curves from the start to the end of the crossing track and, of a double slip, from its
  start to the end of the main track; slip_of() lays the curves with the blades of the ordinary switch of the rail, radius and angle (no
  data of the slips' own blades was found), passing the crossing as near as the rails of the simulator's profile let them. The three with
  the blades outside of the diamond whose curves then reach past the half length of Id-4 (49E1 190-1:6,6, 300-1:9, 500-1:9, by up to 0.3 m)
  are laid as long as their curves. Written as the switch tool writes them: a switch at each leg a slip curve leaves, the tracks crossing
  and the middles of the slip curves plain tracks, the joints inside it the same numbers on both sides.
- The rules: a double switch, a slip, a crossing (11.4 pkt 4 a, b) and a symmetric switch (no rule of table 11.8 for it) lie on straights
  only; an invariant, refused with the reason before anything is laid. The norms judge the tracks crossing at a slip or a crossing as
  crossings (no cant, tab. 9.6), its slip curves as diverging tracks.
- The ends of the tracks of a turnout which carry no line through their node (the starts of the diverging tracks, the ends of the slip
  curves) are branch_end(); a node holds such an end beside a track of the same turnout on its side. settle() lays all the tracks a turnout
  lays itself (lay_tracks()), the nodes of its own where they end; lifting, moving, changing (to another kind too) and removing a turnout
  take all of them along.
- The project file: the turnout record gets "second <node> <main2> <diverging2> <node>" and "crossing <line> <node> <node> slip <line>"
  where the turnout has them (diverging 0 0 for a crossing); version 1, unreleased, read as before without them. The generated section
  keeps each track a turnout is made of.
- TSI INF 4.2.3.4(1), 150 m at least, judges the plain line, not the curves of switches (4.2.5): its hard row leaves out the tracks of the
  turnouts, so the industrial S42 switches of R 70 and 140 m are laid.

Tests: U: every type of the catalogue laid (41 ordinary, 3 symmetric, 15 double, 18 slips, 20 crossings) on a straight to both sides
along the line and against it, its legs where the catalogue puts them (the main track a + b, 1:n at the ends, the second switch at the
stagger, the crossing track at the angle of the slip, half its length from the crossing), moved and taken out, the line one again, each a
step to undo; the turn of the secant blades of S42-190-1:7 at the end of the pre-blade stretch; a double switch, two slips and a crossing
refused in a curve, a secant S42 bent in a side track, a symmetric switch refused at the end of a curve. The three fitted to the tangents
of S42-140-1:6,6 16/12 measured are refused by the norms (tab. 9.14) where the transition one is. P: 200 random edits with every type along
arcs and transitions, seeds 5150, 2718 and 1618: the invariants after each, a refusal changing nothing, undone back to the start exactly.
G: every type made into the tracks of the simulator and read back by TTrack::Load, the ends of the paths at the legs or at each other to
the bit, the velocity and the frog; a double switch, a double slip and a crossing written to the project file and read back, their tracks
laid again the same to the bit. The E2b case of the types refused now checks that they're laid. Unit tests 1077 -> 1086.
2026-11-23 14:49:35 +01:00
maj00r b0f7744434 feat(editor): the switch tracks of the simulator made of the turnouts of the track geometry, the legs at their nodes to the bit
The generator (editor-tracks-domain.md §5, "Rozjazdy") makes a turnout one switch track entry TTrack::Load reads: the paths of its main
and its diverging track, each from the start of the turnout.

- Each path the pieces of its line as the generator cuts any line (within 0.5 mm of the elements, the rolls and the heights from the
  line), turned round where the main track runs against the turnout, written as pieces1/pieces2; the path itself the curve between
  their ends and headings for the versions which know only the path, or the one piece where one makes it. The ends of both paths are
  the numbers of the nodes of the legs, so the tracks on the other side of them meet them to the bit.
- velocity as the speed rule gives it (the main limit for both where it's the lower, else the diverging one below 0), frogs, the
  movable nose and the blades of the type where it has them; the name <turnout_prefix><turnout>, t by default.
- A track of a turnout isn't made as a line of its own; generate_all() makes the lines, then the turnouts.

Tests (G): turnouts on a straight with a grade (a 1:12 to the left along the line, a 1:9 to the right against it, a 1:26.5 with a
movable nose) and one bent outward into R 1200 m with 60 mm, written and read back: both paths from the start node, the main one to
the end of the main track, the diverging one to its end, to the bit; the pieces as written, joined to the bit, each within 0.5 mm of
its line both ways (the farthest 6e-6 mm: short arcs of one Bezier curve each); the radius of the bent diverging curve; the velocity,
the movable nose and the frogs read back; the tracks of the lines on the other side of the legs ending there with the same numbers and
rolls (of the other sign where they meet head on). The diverging track of Rz 60E1-2500-1:26,5 as the simulator draws it within the chord
offsets of Id-4 (30 m chords, 41 to 49 mm in the middle): 45.0 mm all along, 130 km/h on it.

Left for E5: the catalogue as a data file (now switch_design::catalogue() in code), the double, symmetric and secant switches, the bending
exact everywhere (now table 11.8 for the curve of the basic switch, the rest of the diverging track bent with the main one, a main track
on a transition taken at its mean curvature), the connection solver (crossovers, the spacing measured along).
2026-11-23 12:41:49 +01:00
maj00r e53fbcfe55 feat(editor): the tracks of the simulator made of the lines of the track geometry, within half a millimetre
The last part of E2a (editor-tracks-domain.md §3 and §5): the generator, the layer between the domain and the simulator. A line is
cut into cubic Bezier pieces, each one a track entry of the text TTrack::Load reads. Nothing of the editor writes them yet.

- The pieces end at the elements, at the ends of the vertical curves and of the cant ramps; each one halved until the curve as the
  simulator draws it lies within 0.5 mm of the line, in the plan and in the height, and its cant within 2 mm of the line where the
  simulator turns the roll evenly; none longer than a track may be (400 m), none shorter than 10 cm. The handles of an arc are its
  own, 4/3 tan(turn / 4) R; a transition takes the handles which give the curve the curvatures of the line at its ends (G2 Hermite,
  by Newton's method, those of an arc where it finds none near them); a cubic parabola is the cubic Bezier curve it is, cut by its
  blossom; a straight of an even grade has no control vectors, as the simulator draws it. A piece TTrack would take for a straight
  (its 2 cm check of the control vector) is one, close enough or halved.
- The rolls and the heights come from the functions of the line, the radius from the element: an arc's own, the sharpest over a
  transition, 0 on a straight. A piece ends at a node with the numbers of the node, its place, its heading and its cant, so the
  tracks on both sides of it have the same numbers to the bit; the numbers are written in the shortest form which reads back to the
  same double.
- The names come from the identifiers: <prefix><line>_<element><piece>, the element the straight leading to a vertex (s7, se to
  the end) or the transition in, the arc or the transition out of a vertex (v7i, v7a, v7o); a change of a curve leaves the names of
  the pieces of the others.
- The joints of old tracks as hard points of the pieces, keeping their names and events, are E6 (§10): generator_options has their
  place, a line given any is refused rather than made without them.

Tests: the pieces of lines of clothoids, Bloss curves and cubic parabolas, of R 190 m and of 5 km with vertical curves, each
measured both ways (the points of the curve set square onto the line, and the points of the line against the nearest of the curve,
searched on its own): within 1 mm, the farthest 0.35 mm (0.45 mm with Bloss curves). G: a line split on a straight and in an arc,
its tracks written and read back by TTrack::Load (the E0 seam): the ends at the nodes and between the pieces the same to the bit on
both sides, the rolls and the headings of the control vectors too, the curve within 1 mm of the line, the radius of the element;
a line laid the other way through its nodes; the names unique and kept by a change of another curve; the E6 hook refusing.
2026-11-23 11:30:25 +01:00