mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-12-02 00:22:42 +01:00
8b48cfddae2fa905fe32367d2e04f3ba55bbd354
3 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
0301c6e9cc |
fix(editor): the pieces of a cut old track get its events as the simulator fires them, its joints follow a line laid anew
- keep_old_tracks() kept all the events on the first piece of an old track. The simulator fires event1 as a vehicle enters a track at its Point2, event2 at its Point1 and event0 while it stands on it (TrkFoll.cpp), so with a 120 m track cut into 40 and 80 m a train running towards Point1 got event1 about 80 m late, and one standing on the second piece no event0. Now each piece gets event0/eventall0, the piece at Point1 event2/eventall2 and the piece at Point2 event1/eventall1. The keywords are compared in any case, as the simulator lowers its tokens. - The joints of the old tracks kept their chainages through move_vertex, set_vertex, insert_vertex and remove_vertex: widening a 90° curve by 20 m shortens the line by about 8.6 m, and a joint past the new end was dropped, a short buffer-stop or signal track there with its name, events and circuit. Each joint now goes to the point of the new line nearest to where it was. solved_line::nearest() is shared with the crossover planner. - Sonar: the seeded generators of the takeover tests are marked (S2245), two dereferences after a REQUIRE too (S2259). |
||
|
|
5b83a5c1bc |
feat(editor): the old tracks of a scenery chained and taken over as lines by one command of the model, the norms told, not refusing
E6 (editor-tracks-domain.md §10): a set of old tracks made lines of the domain in one step to undo (editor/layout/layoutLegacy and the command take_over). Model only: the question with a preview before and after is the editor's, after E4a. - legacy_track: an old track as its entry has it, in the world, with no scene: its name, its paths, the words before and after them. walk_chains(): the plain tracks of the set chained the way a train runs them (the chain walking of the old digitization, kept): a track joined at an end to exactly one other plain track of the set, within the 2 cm the simulator joins them within, goes on into it; a switch, a track not taken over, a fork or a free end ends the chain, held in the heading of the main path of the switch or of the track holding it, which the line runs on from. Each chain runs from its end the smaller in x, then in z, whichever track it was found from. - plan_takeover(): each chain recognized (layoutRecognition), its held ends kept, the old tracks along it as its hard splits (a track named none of no name), the class of its line of the highest speed of its tracks; the deviation of each line and the worst of all; silent where each line keeps within the tolerance. Nothing is laid. - take_over, a command of the model: the lines between new nodes at the ends of their old tracks, their vertices, grade lines and old tracks as recognized. The invariants refuse it as they refuse any command; the norms don't: the BLOCK limits the old tracks pass are told in outcome::broken (an old track may break the norms where nobody touched it, improving it is a separate decision; edits of the lines after it are judged by edit_policy::no_new_block). take_over_tracks() executes it and returns the deviation of each line and whether the takeover is silent, for the question. - A switch stays an old track, a fixed constraint: the lines end at its legs in its headings. Its type recognized in the catalogue and the switch laid into the line as a turnout, so the line runs on through it, is left for later. Tests: U: the line of three curves cut into old tracks, each written the way it was: the tracks in three random orders, seeds 4401, 5502 and 6603, the walk starting from another one of them each time: the same line, its vertices to 1e-6 m and its radii and transitions to 1e-9, the same old tracks at the same chainages. Unit tests 1103 -> 1104. |
||
|
|
3f5f2af1ce |
feat(editor): the old tracks recognized as lines of the domain: the curves read off the curvature, fitted by least squares, the deviation measured
The first part of E6 (editor-tracks-domain.md §10 "Automatyczne przejęcie odcinka", editor-tracks-tests.md §4 "E6"): a chain of the paths of an old scenery, Bezier curves drawn by hand or by older tools, made a line of the domain (editor/layout/layoutRecognition). Model only, nothing of the editor asks it yet. - The chain sampled along its arc length in the plan, every metre for the fit and every half metre for the deviation, each joint with the turn of the heading there: the point, the heading and the curvature of the Bezier curve as the simulator draws it, the cant of the roll turned evenly with the parameter as the simulator turns it (1500 mm sin roll, of the other sign where a path runs against the chain). - The curves found where the curvature changes: the heading differenced over 30 m (the noise of the ends of the old paths, written to the millimetre, and the ripple of the Bezier curves evened out), runs of one sign past 1/5000 m; a run whose curvature falls to a third of what it is on both sides cut in two; the arc of each where the curvature is half of it or more (the area over that width is the turn), its transitions where it rises from a tenth to nine tenths, the window taken off; a turn of more than a quarter of a circle laid as curves of a quarter at most. A turn of more than 5 mrad at one joint making up a curve is a kink (told, laid as the shortest curve which fits); an arc whose halves differ by a quarter is a compound curve (told, laid as one). - Each curve a vertex of the domain, clothoid - arc - clothoid, its point where the straights fitted around it cross; then the points, the radii and the transitions of all of them fitted by least squares to the offsets of the points of the chain from the line the domain lays (Levenberg-Marquardt, the Jacobian by differences over the points each parameter moves; the transitions by their squares, since what a transition moves the curve by grows with its square; the points and the radii first, then all of it). An end held by what stays beyond it (a switch, an old track not taken over) keeps the first or the last vertex on its heading. The curves the curvature doesn't show (a radius over 5 km, a turn spread over the joints) are added where the line keeps off the points by the tolerance, six at most; the small turns of old tracks laid jagged, joint by joint, are left out where the line keeps nearer without them; where it keeps more than a metre off, the plan of the added curves alone is tried; a vertex whose tangents cross behind the curve tells nothing of it, and a vertex no radius lays is taken out. - The cant of each vertex fitted to the rolls along its arc and its transitions; a cant the rolls ramp up with no transition under it is fitted again with transitions as long as the ramps, kept where the line keeps nearer so. The grade line: the heights as straight grades within 1 cm (Douglas and Peucker), the heights of the breaks by least squares, each vertical curve the largest of the usual radii which keeps within it. - The deviation measured densely: each point of the chain every half metre set square onto the line, the farthest and the root mean square of the distance in the plan, of the height and of the cant, where the farthest is. The tolerance of a takeover with no question (takeover_tolerance): 20 mm in the plan and in the height, as the simulator itself joins the ends of the tracks within 2 cm, so the tracks made again lie where the simulator takes the old ones to be; 10 mm of the cant, 0.4 degree of the roll, under the half degree many old files round the rolls to. The norms aren't asked here. Tests: U: three curves (R 800 m with clothoids of 80 m and 60 mm, R 600 m with 60 and 70 m and 90 mm, R 1500 m with none) and a grade line with two breaks, cut at random places 8 to 25 m apart, each piece a Bezier curve, the joints shaken by up to 4 mm across and in height, the rolls rounded to the tenth of a degree, seeds 1101, 2202 and 3303: the radii within 1 %, the transitions within 3 m or moving the arc within 5 mm of where the laid ones move it, the cants within 3 mm, the deviation within the tolerance; the same walked the other way round, the transitions swapped. A kink of 0.6 degree at a joint told and laid within the tolerance; an arc of 11 km found where the curvature shows none; an end held in a heading 2 mrad off the chain kept to 1e-9 rad. Unit tests 1101 -> 1103. |