17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-06 17:28:36 +01:00
Files
maszyna/maj0sted/include/maj0sted/io/svg_writer.hpp
maj00r a083269867 Vendor the maj0sted track layout library and link it into the editor
Drop-in copy of C:\Users\maj00r\Projects\maj0sted-master minus its web/
directory - the WASM frontend is not being ported, the editor drives the
same C++ API natively. What is left is plain C++20 with no dependencies:
domain model (niweleta, plan and profile geometry, fitting, parallelism),
project serialization, rail sampling and the editor document.

src/web/ribbon.cpp was missing from the library source list; added, since
without it the ribbon symbols never make it into the archive.
2026-08-27 19:36:55 +02:00

21 lines
641 B
C++

#pragma once
#include <string>
#include "maj0sted/render/scene.hpp"
namespace maj0sted::io {
struct SvgOptions {
double width_px = 900.0; ///< target drawing width
double margin_px = 24.0; ///< padding around the drawing
double stroke_px = 2.0; ///< line width
};
/// Renders a scene to a standalone SVG document (north up). Straights, arcs and
/// transition curves are drawn in distinct colours. Dependency-free — just a
/// simple viewer; a real GUI would consume render::Scene directly.
[[nodiscard]] std::string to_svg(const render::Scene& scene, const SvgOptions& options = {});
} // namespace maj0sted::io