17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-05 08:44:32 +01:00
Files
maszyna/maj0sted/include/maj0sted/maj0sted.hpp
maj00r 2376e4867b Editor: rebuild the plan library around a solved document, and bend turnouts onto curves
The library was a heap of half-built services - fitting, parallelism, niwelety,
an SVG writer - that never met each other. In their place is one authored
Document and one solver that lays it whole: tracks as element chains, turnouts
placed on them, and a Solution that is rebuilt from scratch every time and never
fed back into the document. What cannot be laid comes back as a diagnostic with
the number in it rather than as silence or a fitted-away error.

Turnouts are dimensioned the way the drawings dimension them. The blade follows
Koc's rys. 5.9 - the curve is theoretically tangent to the opornica at PR, the
blade starts at a with a planed nose of d, and A is where the rail stands u
thick - and a + d derived that way lands on his tablica 5.1. Bending follows
5.3.6: it rotates the triangle OBC about the centre of the turnout, so the
tangent t and the crossing angle stand and both radii follow from them. That is
Koc's (5.7) and (5.8) without coding either, and it puts a symmetrically bent
Rz 49E1-190-1:9 on the catalogue's Rlus 49E1-380,292-1:9. A rozjazd standing on
a curve is bent onto it; one on a track drawn straight can carry a bend of its
own. The szyny laczace take up the difference, because the switch and the frog
are only bent, not re-cut.

The plan panel draws all of it: the catalogue drawing of a type with its
construction points, the theoretical arc dashed where no rail runs, and the
blade nose as the straight it is cut as. Dragging a straight now stops where it
would pull the track out from under a turnout.

File format goes to m0s 6. Versions 3 to 5 still open.
2026-08-29 19:32:46 +02:00

28 lines
991 B
C++

#pragma once
// maj0sted — the model behind a railway track-layout editor ("edytor
// torowiska"). One header pulls in the whole public surface.
//
// The shape of it: a Document is authored (construction lines, catalogue
// turnout types and their placements, tracks made of elements), `solve` turns it
// into a Solution, and nothing ever travels back the other way.
#include "maj0sted/version.hpp"
// The authored model, and what solving it produces.
#include "maj0sted/editor/model.hpp"
#include "maj0sted/editor/solution.hpp"
// Solving: one track's chain, and a whole document in dependency order.
#include "maj0sted/editor/chain.hpp"
#include "maj0sted/editor/layout.hpp"
// Geometry primitives shared by the solver and the renderer.
#include "maj0sted/domain/geometry/segment_layout.hpp"
#include "maj0sted/domain/geometry/turnout.hpp"
// Presentation and IO.
#include "maj0sted/editor/render.hpp"
#include "maj0sted/io/document_io.hpp"
#include "maj0sted/io/scn_export.hpp"