pub struct Drawing { /* private fields */ }Expand description
A sketch drawn point by point, each point placed by two formulas — its
x and y from a fixed origin — so that every point follows the
parameters on its own, and solving the sketch is solving a linear
system with one answer. Curves only join points; arcs take a radius.
It is drawn where the parameters as defined put it, so a program built as it is needs no solving.
Implementations§
Source§impl Drawing
impl Drawing
Sourcepub fn new(program: &Program) -> GeopResult<Self>
pub fn new(program: &Program) -> GeopResult<Self>
A drawing for a step of program, drawn with its parameters as it
defines them.
Sourcepub fn point(
&mut self,
x: impl AsRef<str>,
y: impl AsRef<str>,
) -> GeopResult<PointId>
pub fn point( &mut self, x: impl AsRef<str>, y: impl AsRef<str>, ) -> GeopResult<PointId>
The point at (x, y), each a formula.
pub fn line(&mut self, a: PointId, b: PointId) -> CurveId
Sourcepub fn bezier(&mut self, control: Vec<PointId>) -> CurveId
pub fn bezier(&mut self, control: Vec<PointId>) -> CurveId
The Bézier curve of the control points control, of degree one
less than there are: a spline on one span, through its first and
last point.
Sourcepub fn polygon(&mut self, corners: &[[String; 2]]) -> GeopResult<Vec<CurveId>>
pub fn polygon(&mut self, corners: &[[String; 2]]) -> GeopResult<Vec<CurveId>>
A closed polygon through corners, each [x, y] formulas: its
lines, the first from the first corner to the second.
Sourcepub fn arc(
&mut self,
start: PointId,
end: PointId,
radius: &str,
ccw: bool,
) -> GeopResult<CurveId>
pub fn arc( &mut self, start: PointId, end: PointId, radius: &str, ccw: bool, ) -> GeopResult<CurveId>
The shorter arc of radius from start to end, turning
counter-clockwise if ccw.
Sourcepub fn circle(&mut self, center: PointId, diameter: &str) -> GeopResult<CurveId>
pub fn circle(&mut self, center: PointId, diameter: &str) -> GeopResult<CurveId>
A circle around center of diameter.
Sourcepub fn on(self, plane: SketchPlane) -> AddSketchArgs
pub fn on(self, plane: SketchPlane) -> AddSketchArgs
The sketch, on plane: drawn where its dimensions put it, so it
needs no solving — and a build with the parameters as defined then
solves none (see AddSketch), which is what keeps a large profile, a
rack’s teeth, cheap to place.