mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-21 14:24:58 +01:00
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.
This commit is contained in:
@@ -2,14 +2,13 @@ cmake_minimum_required(VERSION 3.20)
|
||||
|
||||
project(maj0sted
|
||||
VERSION 0.1.0
|
||||
DESCRIPTION "Domain-Driven Design library for a railway track-layout editor"
|
||||
DESCRIPTION "Model and solver for a railway track-layout editor"
|
||||
LANGUAGES CXX)
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Options
|
||||
# ----------------------------------------------------------------------------
|
||||
option(MAJ0STED_BUILD_TESTS "Build unit tests" ON)
|
||||
option(MAJ0STED_BUILD_EXAMPLES "Build usage examples" ON)
|
||||
option(MAJ0STED_WARNINGS_AS_ERRORS "Treat warnings as errors" OFF)
|
||||
|
||||
# Only drive tests/examples/install defaults when built on its own, not when
|
||||
@@ -24,26 +23,17 @@ endif()
|
||||
# The static library
|
||||
# ----------------------------------------------------------------------------
|
||||
add_library(maj0sted STATIC
|
||||
src/domain/map_project.cpp
|
||||
src/domain/horizontal_alignment.cpp
|
||||
src/domain/vertical_alignment.cpp
|
||||
src/domain/niweleta.cpp
|
||||
src/domain/parallelism_service.cpp
|
||||
src/domain/fitting_service.cpp
|
||||
src/domain/gap_fitter.cpp
|
||||
src/domain/turnout.cpp
|
||||
src/io/project_serializer.cpp
|
||||
src/io/svg_writer.cpp
|
||||
src/io/scn_export.cpp
|
||||
src/render/plan_sampler.cpp
|
||||
src/render/rail_renderer.cpp
|
||||
src/editor/solve.cpp
|
||||
src/editor/editor.cpp
|
||||
src/editor/ribbon.cpp
|
||||
src/editor/model.cpp
|
||||
src/editor/solution.cpp
|
||||
src/editor/chain.cpp
|
||||
src/editor/sketch.cpp
|
||||
src/editor/layout.cpp
|
||||
src/editor/render.cpp
|
||||
src/editor/tile_cache.cpp
|
||||
src/app/editor_document.cpp
|
||||
src/app/straight_constraints.cpp
|
||||
src/app/basket_draft.cpp
|
||||
src/render/rail_renderer.cpp
|
||||
src/io/document_io.cpp
|
||||
src/io/scn_export.cpp
|
||||
)
|
||||
add_library(maj0sted::maj0sted ALIAS maj0sted)
|
||||
|
||||
@@ -77,13 +67,6 @@ if(MAJ0STED_BUILD_TESTS AND MAJ0STED_STANDALONE)
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Examples
|
||||
# ----------------------------------------------------------------------------
|
||||
if(MAJ0STED_BUILD_EXAMPLES AND MAJ0STED_STANDALONE)
|
||||
add_subdirectory(examples)
|
||||
endif()
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Install / package
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user