Documentation ¶
Index ¶
- func AppendInflection(pic mech.Depiction, p mech.Portion, n uint32, fr maf.Frame, a, c curveSample3D) (mech.Depiction, uint32)
- func AppendInitial(pic mech.Depiction, n uint32, global maf.Vec, rgb [3]float32, th float32) (mech.Depiction, uint32)
- func AppendQuadratic(pic mech.Depiction, n uint32, b maf.Vec, c maf.Vec, rgb [3]float32, th float32) (mech.Depiction, uint32)
- func AppendXYInflection(pic mech.Depiction, p mech.Portion, n uint32, fr maf.Frame, a, c xySample) (mech.Depiction, uint32)
- func DepictFunction(p mech.Portion, fr maf.Frame, fn func(t float64) maf.Vec) mech.Depiction
- func DepictLine(p mech.Portion, fr maf.Frame, seg maf.LineSeg) mech.Depiction
- func DepictParametric(p mech.Portion, fr maf.Frame, fn Parametric) mech.Depiction
- func DepictPlanarParametric(p mech.Portion, fr maf.Frame, fn PlanarParametric) mech.Depiction
- func DepictWholeQuadraticBezier(p mech.Portion, fr maf.Frame, bez maf.Bez) mech.Depiction
- func DepictXYCartesian(p mech.Portion, fr maf.Frame, fn XYCartesian) mech.Depiction
- func DepictXYParametric(p mech.Portion, fr maf.Frame, fn XYParametric) mech.Depiction
- type Figure
- type Parametric
- type PlanarParametric
- type XYCartesian
- type XYParametric
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendInflection ¶
func AppendInflection( pic mech.Depiction, p mech.Portion, n uint32, fr maf.Frame, a, c curveSample3D, ) (mech.Depiction, uint32)
AppendInflection appends to the depiction two quadratic Beziers which in the case of an inflection will make an almost flat S shape which doesn't leave gaps as a single linear quadratic would.
A single quadratic can't handle an inflection.
The first control point shall already be written, by either the append initial function or as a shared control point with a previous append function.
Returns the possibly reallocated depiction and the new abstract write position into the vertex attributes array.
func AppendInitial ¶
func AppendInitial( pic mech.Depiction, n uint32, global maf.Vec, rgb [3]float32, th float32, ) (mech.Depiction, uint32)
AppendInitial appends a portion's unshared first vertex to the depiction.
Returns the possibly reallocated depiction and the new abstract write position into the vertex attributes array.
func AppendQuadratic ¶
func AppendQuadratic( pic mech.Depiction, n uint32, b maf.Vec, c maf.Vec, rgb [3]float32, th float32, ) (mech.Depiction, uint32)
AppendQuadratic appends a quadratic Bezier to the depiction.
The first control point shall already be written, by either the append initial function or as a shared control point with a previous append function.
Returns the possibly reallocated depiction and the new abstract write position into the vertex attributes array.
func AppendXYInflection ¶
func AppendXYInflection( pic mech.Depiction, p mech.Portion, n uint32, fr maf.Frame, a, c xySample, ) (mech.Depiction, uint32)
AppendXYInflection appends to the depiction two quadratic Beziers which in the case of an inflection will make an almost flat S shape which doesn't leave gaps as a single linear quadratic would.
A single quadratic can't handle an inflection.
The first control point shall already be written, by either the append initial function or as a shared control point with a previous append function.
Returns the possibly reallocated depiction and the new abstract write position into the vertex attributes array.
func DepictFunction ¶
DepictFunction depicts the line segments connecting a sequence of points on the given function using quadratic Bezier curves.
func DepictLine ¶
DepictLine depicts a portion of a line segment using quadratic Bezier curves.
func DepictParametric ¶
DepictParametric depicts a portion of a parametric function's curve using quadratic Bezier curves.
func DepictPlanarParametric ¶
DepictPlanarParametric depicts a portion of a planar parametric function's curve using quadratic Bezier curves.
func DepictWholeQuadraticBezier ¶
DepictWholeQuadraticBezier depicts a whole quadratic Bezier curve with a single quadratic Bezier.
The portion interval limits shall be 0 and 1 in either direction.
func DepictXYCartesian ¶
DepictXYCartesian depicts a portion of a Cartesian function's curve using quadratic Bezier curves.
The input quality parameter shall be sufficiently large that no interval division contains more than one inflection point.
func DepictXYParametric ¶
DepictXYParametric depicts a portion of a parametric function's curve using quadratic Bezier curves.
Types ¶
type Figure ¶
type Figure struct { Fig mech.Depiction FigName string Orientation maf.Frame // The Bezier curve positions are relative to this frame. sync.Mutex }
A Figure is able to produce a depiction of itself made from quadratic Bezier curves.
type Parametric ¶
Parametric defines a parametric function/graph in 3D space and maps a parameter to the function's position and unit tangent direction vector.
type PlanarParametric ¶
PlanarParametric defines a parametric function/graph which is known to be constrained to a plane in 3D space and maps a parameter to the function's position and unit tangent direction vector.
type XYCartesian ¶
XYCartesian defines a Cartesian function/graph in the XY plane and maps an abscissa (X-coordinate) to the function's ordinate (Y-coordinate), gradient, and concavity.