mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-12-01 17:37:09 +01:00
3f5f2af1ce
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.