depictioner

package
v0.0.0-...-7a21720 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2024 License: CC0-1.0 Imports: 3 Imported by: 0

Documentation

Index

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

func DepictFunction(
	p mech.Portion,

	fr maf.Frame,
	fn func(t float64) maf.Vec,
) mech.Depiction

DepictFunction depicts the line segments connecting a sequence of points on the given function using quadratic Bezier curves.

func DepictLine

func DepictLine(
	p mech.Portion,

	fr maf.Frame,
	seg maf.LineSeg,
) mech.Depiction

DepictLine depicts a portion of a line segment using quadratic Bezier curves.

func DepictParametric

func DepictParametric(
	p mech.Portion,
	fr maf.Frame,
	fn Parametric,
) mech.Depiction

DepictParametric depicts a portion of a parametric function's curve using quadratic Bezier curves.

func DepictPlanarParametric

func DepictPlanarParametric(
	p mech.Portion,
	fr maf.Frame,
	fn PlanarParametric,
) mech.Depiction

DepictPlanarParametric depicts a portion of a planar parametric function's curve using quadratic Bezier curves.

func DepictWholeQuadraticBezier

func DepictWholeQuadraticBezier(
	p mech.Portion,

	fr maf.Frame,
	bez maf.Bez,
) mech.Depiction

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

func DepictXYCartesian(
	p mech.Portion,

	fr maf.Frame,
	fn XYCartesian,
) mech.Depiction

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

func DepictXYParametric(
	p mech.Portion,
	fr maf.Frame,
	fn XYParametric,
) mech.Depiction

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.

func (*Figure) Depiction

func (fig *Figure) Depiction() mech.Depiction

Depiction of the figure.

func (*Figure) Name

func (fig *Figure) Name() string

Name of the figure.

func (*Figure) SetName

func (fig *Figure) SetName(name string)

SetName of the figure.

type Parametric

type Parametric func(float64) (maf.Vec, maf.Vec)

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

type PlanarParametric func(float64) (maf.Vec, maf.Vec)

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

type XYCartesian func(float64) (float64, float64, float64)

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.

type XYParametric

type XYParametric func(float64) (maf.Vec2, maf.Vec2)

XYParametric defines a parametric function/graph in the XY plane and maps a parameter to the function's position and unit tangent direction vector.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL