Method Add
- Namespace
- GeometryHelper.Export
- Assembly
- GeometryHelper.dll
Add(GeoPoint2, string)
Adds a point, drawn as a dot.
public SvgWriter Add(GeoPoint2 point, string colour = "black")
Parameters
Returns
Add(GeoLine2, string)
Adds a segment.
public SvgWriter Add(GeoLine2 line, string colour = "black")
Parameters
Returns
Add(GeoArc2, string)
Adds an arc.
public SvgWriter Add(GeoArc2 arc, string colour = "black")
Parameters
Returns
Remarks
An arc of a whole turn is drawn as a circle: an SVG arc command that ends where it starts draws nothing, so a path from (10, 0) round to (10, 0) would leave the picture empty. So is an arc of more than half a turn whose end prints as its start, since the picture has six places: a radius 10 arc turning 1E-9 short of a whole turn is a circle.
Add(GeoEdge2, string)
Adds an edge, straight or curved.
public SvgWriter Add(GeoEdge2 edge, string colour = "black")
Parameters
Returns
Add(GeoCircle2, string, string)
Adds a circle.
public SvgWriter Add(GeoCircle2 circle, string colour = "black", string fill = "none")
Parameters
circleGeoCircle2colourstringfillstring
Returns
Add(GeoEllipse2, string, string)
Adds an ellipse, drawn as an ellipse, turned by the direction of its major axis.
public SvgWriter Add(GeoEllipse2 ellipse, string colour = "black", string fill = "none")
Parameters
ellipseGeoEllipse2colourstringfillstring
Returns
Remarks
The picture grows by the ellipse's bounding box, not by a square of its major radius: an ellipse of radii 30 and 10 (60 across by 20) turned 30 degrees is 52.915 wide and 34.641 high, and the picture is fitted to that.
Add(GeoSpline2, double, string)
Adds a spline: as the Bézier curves it is made of where SVG has them, and through chords no further from it than a tolerance where it has none.
public SvgWriter Add(GeoSpline2 spline, double chordTolerance, string colour = "black")
Parameters
splineGeoSpline2The spline.
chordTolerancedoubleThe largest gap allowed between a chord and the spline where it is drawn through chords, in drawing units; above nought.
colourstringThe colour of the line.
Returns
- SvgWriter
This writer, for adding the next shape.
Remarks
A spline that is not rational and of degree 3 or less is drawn exactly, to the six places the picture's numbers have, cut
at its knots into the Bézier pieces it is made of: a C command for each piece of a cubic, a Q for each of a quadratic and an L for each of a spline of degree 1,
so that the cubic with the control points (0, 0), (100, 150), (200, 150), (300, 0) is M 0 0 C 100 150 200 150 300 0,
and the tolerance is not used. SVG has no curve for a rational spline, a circle among them, nor for a degree above 3:
such a spline is drawn through the corners Flatten(double) cuts it at, every one kept, so that
the circle of radius 100 within 0.01 is 256 chords. The picture grows by the box the curve fills, not by its control points,
and not at all where the spline is refused.
Exceptions
- ArgumentNullException
Thrown when the spline is null.
- ArgumentOutOfRangeException
Thrown when the chord tolerance is not a finite number above nought, or a spline drawn through chords would need more than 1 048 576 of them.
Add(GeoTriangle2, string, string)
Adds a triangle.
public SvgWriter Add(GeoTriangle2 triangle, string colour = "black", string fill = "none")
Parameters
triangleGeoTriangle2colourstringfillstring
Returns
Add(IEnumerable<GeoTriangle2>, string, string)
Adds triangles, each a closed path of its own, such as what a triangulation gives.
public SvgWriter Add(IEnumerable<GeoTriangle2> triangles, string colour = "black", string fill = "none")
Parameters
trianglesIEnumerable<GeoTriangle2>colourstringfillstring
Returns
Exceptions
- ArgumentNullException
Thrown when the triangles are null.
Add(GeoMesh2, string, string)
Adds a mesh, each face a closed path of its own through the corners it has.
public SvgWriter Add(GeoMesh2 mesh, string colour = "black", string fill = "none")
Parameters
Returns
Remarks
A mesh of a grid of 4 cells is 4 paths, so that the joints between the cells show.
Exceptions
- ArgumentNullException
Thrown when the mesh is null.
Add(GeoRay2, string)
Adds a ray, drawn from its origin to where it leaves the picture.
public SvgWriter Add(GeoRay2 ray, string colour = "black")
Parameters
Returns
Remarks
A ray has no end, so how far it runs is settled when the picture is read: to the edge of the picture fitted round everything else. Its origin counts towards the fit and its length does not. A ray along +X from (0, 0) in a picture of a square 0 to 100 is drawn to x = 105, the edge with its margin; a ray added to nothing else is drawn in the picture a unit across centred on its origin, so that the ray along +X from (5, 5) runs to x = 5.55.
Exceptions
- ArgumentException
Thrown when the ray has no direction, as a
defaultone has.
Add(GeoXLine2, string)
Adds a line without ends, drawn across the picture from edge to edge.
public SvgWriter Add(GeoXLine2 xline, string colour = "black")
Parameters
Returns
Remarks
A line has no end, so how far it runs is settled when the picture is read: both ways to the edge of the picture fitted round everything else, as a ray's one way. Its origin counts towards the fit, as a ray's does. The line along X through (0, 0) in a picture of a square 0 to 100 is drawn from x = -5 to x = 105, the edges with their margin; a line added to nothing else is drawn in the picture a unit across centred on its origin, from x = -0.55 to x = 0.55.
Exceptions
- ArgumentException
Thrown when the line has no direction, as a
defaultone has.
Add(GeoPolyline2, string)
Adds a chain.
public SvgWriter Add(GeoPolyline2 polyline, string colour = "black")
Parameters
polylineGeoPolyline2colourstring
Returns
Exceptions
- ArgumentNullException
Thrown when the chain is null.
Add(GeoPolylineArc2, string)
Adds a chain with arcs.
public SvgWriter Add(GeoPolylineArc2 chain, string colour = "black")
Parameters
chainGeoPolylineArc2colourstring
Returns
Exceptions
- ArgumentNullException
Thrown when the chain is null.
Add(GeoPolygon2, string, string)
Adds a polygon.
public SvgWriter Add(GeoPolygon2 polygon, string colour = "black", string fill = "none")
Parameters
polygonGeoPolygon2colourstringfillstring
Returns
Exceptions
- ArgumentNullException
Thrown when the polygon is null.
Add(GeoPolygonArc2, string, string)
Adds a loop with arcs.
public SvgWriter Add(GeoPolygonArc2 loop, string colour = "black", string fill = "none")
Parameters
loopGeoPolygonArc2colourstringfillstring
Returns
Exceptions
- ArgumentNullException
Thrown when the loop is null.
Add(GeoRectangle2, string, string)
Adds a rectangle.
public SvgWriter Add(GeoRectangle2 rectangle, string colour = "black", string fill = "none")
Parameters
rectangleGeoRectangle2colourstringfillstring
Returns
Add(GeoFace2, string, string)
Adds a face, its holes left empty.
public SvgWriter Add(GeoFace2 face, string colour = "black", string fill = "none")
Parameters
Returns
Exceptions
- ArgumentNullException
Thrown when the face is null.