geometor.menelaus.render¶
Publication-grade .euclid-graphic SVG renderer for 2D planar and 3D spherical Menelaus models.
Supports both:
2D Planar
Modelconstructions (render_planar_svg(),export_planar_svg()), clipping infinite algebraic lines cleanly to a padded frame, rendering 3-vertex midpoint<path>segments, and avoiding point-label collisions.3D Unit-Sphere \(S^2\) constructions (
render_spherical_svg(),export_spherical_svg()), projecting exactSphericalPointandGreatCircleelements orthographically onto 2D while preserving full interactivesvg.euclid-graphicdata-refwiring forpublish.
Attributes¶
Functions¶
|
Render a 2D |
|
Write a 2D |
|
Render an orthographic 3D projection of \(S^2\) as an interactive .euclid-graphic SVG. |
|
Write a 3D orthographic unit-sphere SVG to |
Module Contents¶
- geometor.menelaus.render.EMBEDDED_SVG_STYLE: str = ''¶
- geometor.menelaus.render.render_planar_svg(model: geometor.model.Model, *, graphic_id: str = 'menelaus-planar', width: int = 760, height: int = 520, padding_px: float = 54.0, label_overrides: dict[str, str] | None = None) str¶
Render a 2D
Modelinto a complete .euclid-graphic SVG string.
- geometor.menelaus.render.export_planar_svg(model: geometor.model.Model, output_path: pathlib.Path | str, **kwargs: Any) pathlib.Path¶
Write a 2D
ModelSVG tooutput_path.
- geometor.menelaus.render.render_spherical_svg(*, points: Sequence[tuple[geometor.menelaus.spherical.SphericalPoint, str]], arcs: Sequence[tuple[geometor.menelaus.spherical.SphericalPoint, geometor.menelaus.spherical.SphericalPoint, str, str]], full_circles: Sequence[tuple[geometor.menelaus.spherical.GreatCircle, str, str]] = (), graphic_id: str = 'menelaus-spherical', width: int = 640, height: int = 560, azimuth_deg: float = 36.0, elevation_deg: float = 24.0, label_overrides: dict[str, str] | None = None) str¶
Render an orthographic 3D projection of \(S^2\) as an interactive .euclid-graphic SVG.
- Parameters:
points – Sequence of
(SphericalPoint, css_role)(e.g."given","trace result").arcs – Sequence of
(P, Q, css_role, data_ref)geodesic minor arcs on \(S^2\).full_circles – Sequence of
(GreatCircle, css_role, data_ref)full great circles (front/back split).graphic_id – Interactive graphic ID.
width – SVG width in pixels.
height – SVG height in pixels.
azimuth_deg – Camera azimuth angle in degrees.
elevation_deg – Camera elevation angle in degrees.
label_overrides – Optional label text map.
- geometor.menelaus.render.export_spherical_svg(output_path: pathlib.Path | str, **kwargs: Any) pathlib.Path¶
Write a 3D orthographic unit-sphere SVG to
output_path.