Skip to main content

Crate geop_lib_sheet

Crate geop_lib_sheet 

Source
Expand description

A Sheet: plain 2-D strokes and labels on paper, in millimetres with y up, each on a layer — what a drawing and a flat pattern are laid out as, and written in a Format: SVG (to_svg) or DXF (to_dxf).

The kernel’s curves become lines, arcs and circles where they are those exactly (see [NurbCurve3D::as_line], [NurbCurve3D::as_arc]), and polylines through points of them otherwise.

Text in an SVG sheet, or in any other XML a writer makes, is escaped by xml_escape.

Structs§

Label
A line of text, its baseline at at, turned angle degrees counter-clockwise.
Layer
What a stroke or label is, which decides how it is drawn: a layer of a DXF file, a class of an SVG one. The sheet knows no layer of its own: whoever draws on it defines the layers it draws on (a drawing its visible and hidden lines, a flat pattern what is cut and where it is bent).
Sheet
A sheet of paper, width x height millimetres, and what is on it.
Stroke

Enums§

Anchor
Which point of a label its position is.
Format
A file format a sheet is written in.
LineType
How a layer’s strokes are dashed.
Shape
A shape on the paper.

Functions§

decimal
x as written on a sheet: to places decimals, without trailing zeros.
strokes_of
The curves curves on the paper, through place from their own coordinates at scale: each a line, an arc or a circle where it is one exactly, those continuing each other on one layer joined, and every other curve a polyline through points of it.
to_dxf
The sheet as a DXF document.
to_svg
The sheet as an SVG document. The paper’s y points up, SVG’s down: every point is flipped, which turns counter-clockwise arcs into SVG’s negative sweep.
xml_escape
text fit for XML: for an element’s content, or an attribute’s value between either kind of quotes.

Type Aliases§

P
A point on the paper.