Documentation

Index

Constants

View Source
const Mil = MillimetresPerInch / 1000.0

    Mil is millimetres per 1/1000 of an inch

    View Source
    const MillimetresPerInch = 25.4

      MillimetresPerInch is millimetres per inch (25.4)

      View Source
      const Pi = math.Pi

        Pi (3.14159...)

        View Source
        const Tau = 2 * math.Pi

          Tau (2 * Pi).

          Variables

          This section is empty.

          Functions

          func BenchmarkSDF2

          func BenchmarkSDF2(description string, s SDF2)

            BenchmarkSDF2 reports the evaluation speed for an SDF2.

            func BenchmarkSDF3

            func BenchmarkSDF3(description string, s SDF3)

              BenchmarkSDF3 reports the evaluation speed for an SDF3.

              func Clamp

              func Clamp(x, a, b float64) float64

                Clamp x between a and b, assume a <= b

                func DtoR

                func DtoR(degrees float64) float64

                  DtoR converts degrees to radians

                  func EqualFloat64

                  func EqualFloat64(a, b, epsilon float64) bool

                    EqualFloat64 compares two float64 values for equality.

                    func ErrMsg

                    func ErrMsg(msg string) error

                      ErrMsg returns an error with a message function name and line number.

                      func FloatDecode

                      func FloatDecode(x float64) string

                        FloatDecode returns a string that decodes the float64 bitfields.

                        func FloatEncode

                        func FloatEncode(s int, f uint64, e int) float64

                          FloatEncode encodes a float64 from sign, fraction and exponent values.

                          func LoadFont

                          func LoadFont(fname string) (*truetype.Font, error)

                            LoadFont loads a truetype (*.ttf) font file.

                            func Mix

                            func Mix(x, y, a float64) float64

                              Mix does a linear interpolation from x to y, a = [0,1]

                              func RtoD

                              func RtoD(radians float64) float64

                                RtoD converts radians to degrees

                                func SawTooth

                                func SawTooth(x, period float64) float64

                                  SawTooth generates a sawtooth function. Returns [-period/2, period/2)

                                  func Sign

                                  func Sign(x float64) float64

                                    Sign returns the sign of x

                                    func ZeroSmall

                                    func ZeroSmall(x, y, epsilon float64) float64

                                      ZeroSmall zeroes out values that are small relative to a quantity.

                                      Types

                                      type ArcSpiralSDF2

                                      type ArcSpiralSDF2 struct {
                                      	// contains filtered or unexported fields
                                      }

                                        ArcSpiralSDF2 is a 2d Archimedean spiral.

                                        func (*ArcSpiralSDF2) BoundingBox

                                        func (s *ArcSpiralSDF2) BoundingBox() Box2

                                          BoundingBox returns the bounding box of a 2d Archimedean spiral.

                                          func (*ArcSpiralSDF2) Evaluate

                                          func (s *ArcSpiralSDF2) Evaluate(p V2) float64

                                            Evaluate returns the minimum distance to a 2d Archimedean spiral.

                                            type ArraySDF2

                                            type ArraySDF2 struct {
                                            	// contains filtered or unexported fields
                                            }

                                              ArraySDF2 defines an XY grid array of an existing SDF2.

                                              func (*ArraySDF2) BoundingBox

                                              func (s *ArraySDF2) BoundingBox() Box2

                                                BoundingBox returns the bounding box of a grid array of SDF2s.

                                                func (*ArraySDF2) Evaluate

                                                func (s *ArraySDF2) Evaluate(p V2) float64

                                                  Evaluate returns the minimum distance to a grid array of SDF2s.

                                                  func (*ArraySDF2) SetMin

                                                  func (s *ArraySDF2) SetMin(min MinFunc)

                                                    SetMin sets the minimum function to control blending.

                                                    type ArraySDF3

                                                    type ArraySDF3 struct {
                                                    	// contains filtered or unexported fields
                                                    }

                                                      ArraySDF3 stores an XYZ array of a given SDF3

                                                      func (*ArraySDF3) BoundingBox

                                                      func (s *ArraySDF3) BoundingBox() Box3

                                                        BoundingBox returns the bounding box of an XYZ SDF3 array.

                                                        func (*ArraySDF3) Evaluate

                                                        func (s *ArraySDF3) Evaluate(p V3) float64

                                                          Evaluate returns the minimum distance to an XYZ SDF3 array.

                                                          func (*ArraySDF3) SetMin

                                                          func (s *ArraySDF3) SetMin(min MinFunc)

                                                            SetMin sets the minimum function to control blending.

                                                            type Bezier

                                                            type Bezier struct {
                                                            	// contains filtered or unexported fields
                                                            }

                                                              Bezier curve specification..

                                                              func NewBezier

                                                              func NewBezier() *Bezier

                                                                NewBezier returns an empty bezier curve.

                                                                func (*Bezier) Add

                                                                func (b *Bezier) Add(x, y float64) *BezierVertex

                                                                  Add an x,y vertex to a polygon.

                                                                  func (*Bezier) AddV2

                                                                  func (b *Bezier) AddV2(x V2) *BezierVertex

                                                                    AddV2 adds a V2 vertex to a polygon.

                                                                    func (*Bezier) Close

                                                                    func (b *Bezier) Close()

                                                                      Close the bezier curve.

                                                                      func (*Bezier) Polygon

                                                                      func (b *Bezier) Polygon() (*Polygon, error)

                                                                        Polygon returns a polygon approximating the bezier curve.

                                                                        type BezierPolynomial

                                                                        type BezierPolynomial struct {
                                                                        	// contains filtered or unexported fields
                                                                        }

                                                                          BezierPolynomial contains the bezier polynomial parameters.

                                                                          func (*BezierPolynomial) Set

                                                                          func (p *BezierPolynomial) Set(x []float64)

                                                                            Set calculates bezier polynomial coefficients given the end/control points.

                                                                            type BezierSpline

                                                                            type BezierSpline struct {
                                                                            	// contains filtered or unexported fields
                                                                            }

                                                                              BezierSpline contains the x/y bezier curves for a 2D spline.

                                                                              func NewBezierSpline

                                                                              func NewBezierSpline(p []V2) *BezierSpline

                                                                                NewBezierSpline returns a bezier spline from the provided control/end points.

                                                                                func (*BezierSpline) Sample

                                                                                func (s *BezierSpline) Sample(p *Polygon, t0, t1 float64, p0, p1 V2, n int)

                                                                                  Sample generates polygon samples for a bezier spline.

                                                                                  type BezierVertex

                                                                                  type BezierVertex struct {
                                                                                  	// contains filtered or unexported fields
                                                                                  }

                                                                                    BezierVertex specifies the vertex for a bezier curve.

                                                                                    func (*BezierVertex) Handle

                                                                                    func (v *BezierVertex) Handle(theta, fwd, rev float64) *BezierVertex

                                                                                      Handle marks the vertex with a slope control handle.

                                                                                      func (*BezierVertex) HandleFwd

                                                                                      func (v *BezierVertex) HandleFwd(theta, r float64) *BezierVertex

                                                                                        HandleFwd sets the slope handle in the forward direction.

                                                                                        func (*BezierVertex) HandleRev

                                                                                        func (v *BezierVertex) HandleRev(theta, r float64) *BezierVertex

                                                                                          HandleRev sets the slope handle in the reverse direction.

                                                                                          func (*BezierVertex) Mid

                                                                                          func (v *BezierVertex) Mid() *BezierVertex

                                                                                            Mid marks the vertex as a mid-curve control point.

                                                                                            type Box2

                                                                                            type Box2 struct {
                                                                                            	Min, Max V2
                                                                                            }

                                                                                              Box2 is a 2d bounding box.

                                                                                              func NewBox2

                                                                                              func NewBox2(center, size V2) Box2

                                                                                                NewBox2 creates a 2d box with a given center and size.

                                                                                                func (Box2) BottomLeft

                                                                                                func (a Box2) BottomLeft() V2

                                                                                                  BottomLeft returns the bottom left corner of a 2d bounding box.

                                                                                                  func (Box2) Center

                                                                                                  func (a Box2) Center() V2

                                                                                                    Center returns the center of a 2d box.

                                                                                                    func (Box2) Equals

                                                                                                    func (a Box2) Equals(b Box2, tolerance float64) bool

                                                                                                      Equals test the equality of 2d boxes.

                                                                                                      func (Box2) Extend

                                                                                                      func (a Box2) Extend(b Box2) Box2

                                                                                                        Extend returns a box that encloses two 2d boxes.

                                                                                                        func (Box2) MinMaxDist2

                                                                                                        func (a Box2) MinMaxDist2(p V2) V2

                                                                                                          MinMaxDist2 returns the minimum and maximum dist * dist from a point to a box. Points within the box have minimum distance = 0.

                                                                                                          func (*Box2) Random

                                                                                                          func (b *Box2) Random() V2

                                                                                                            Random returns a random point within a bounding box.

                                                                                                            func (*Box2) RandomSet

                                                                                                            func (b *Box2) RandomSet(n int) V2Set

                                                                                                              RandomSet returns a set of random points from within a bounding box.

                                                                                                              func (Box2) ScaleAboutCenter

                                                                                                              func (a Box2) ScaleAboutCenter(k float64) Box2

                                                                                                                ScaleAboutCenter returns a new 2d box scaled about the center of a box.

                                                                                                                func (Box2) Size

                                                                                                                func (a Box2) Size() V2

                                                                                                                  Size returns the size of a 2d box.

                                                                                                                  func (Box2) TopLeft

                                                                                                                  func (a Box2) TopLeft() V2

                                                                                                                    TopLeft returns the top left corner of a 2d bounding box.

                                                                                                                    func (Box2) Translate

                                                                                                                    func (a Box2) Translate(v V2) Box2

                                                                                                                      Translate translates a 2d box.

                                                                                                                      func (Box2) Vertices

                                                                                                                      func (a Box2) Vertices() V2Set

                                                                                                                        Vertices returns a slice of 2d box corner vertices.

                                                                                                                        type Box3

                                                                                                                        type Box3 struct {
                                                                                                                        	Min, Max V3
                                                                                                                        }

                                                                                                                          Box3 is a 3d bounding box.

                                                                                                                          func NewBox3

                                                                                                                          func NewBox3(center, size V3) Box3

                                                                                                                            NewBox3 creates a 3d box with a given center and size.

                                                                                                                            func (Box3) Center

                                                                                                                            func (a Box3) Center() V3

                                                                                                                              Center returns the center of a 3d box.

                                                                                                                              func (Box3) Equals

                                                                                                                              func (a Box3) Equals(b Box3, tolerance float64) bool

                                                                                                                                Equals test the equality of 3d boxes.

                                                                                                                                func (Box3) Extend

                                                                                                                                func (a Box3) Extend(b Box3) Box3

                                                                                                                                  Extend returns a box that encloses two 3d boxes.

                                                                                                                                  func (Box3) MinMaxDist2

                                                                                                                                  func (a Box3) MinMaxDist2(p V3) V2

                                                                                                                                    MinMaxDist2 returns the minimum and maximum dist * dist from a point to a box. Points within the box have minimum distance = 0.

                                                                                                                                    func (*Box3) Random

                                                                                                                                    func (b *Box3) Random() V3

                                                                                                                                      Random returns a random point within a bounding box.

                                                                                                                                      func (*Box3) RandomSet

                                                                                                                                      func (b *Box3) RandomSet(n int) V3Set

                                                                                                                                        RandomSet returns a set of random points from within a bounding box.

                                                                                                                                        func (Box3) ScaleAboutCenter

                                                                                                                                        func (a Box3) ScaleAboutCenter(k float64) Box3

                                                                                                                                          ScaleAboutCenter returns a new 3d box scaled about the center of a box.

                                                                                                                                          func (Box3) Size

                                                                                                                                          func (a Box3) Size() V3

                                                                                                                                            Size returns the size of a 3d box.

                                                                                                                                            func (Box3) Translate

                                                                                                                                            func (a Box3) Translate(v V3) Box3

                                                                                                                                              Translate translates a 3d box.

                                                                                                                                              func (Box3) Vertices

                                                                                                                                              func (a Box3) Vertices() V3Set

                                                                                                                                                Vertices returns a slice of 3d box corner vertices.

                                                                                                                                                type BoxSDF2

                                                                                                                                                type BoxSDF2 struct {
                                                                                                                                                	// contains filtered or unexported fields
                                                                                                                                                }

                                                                                                                                                  BoxSDF2 is the 2d signed distance object for a rectangular box.

                                                                                                                                                  func (*BoxSDF2) BoundingBox

                                                                                                                                                  func (s *BoxSDF2) BoundingBox() Box2

                                                                                                                                                    BoundingBox returns the bounding box for a 2d box.

                                                                                                                                                    func (*BoxSDF2) Evaluate

                                                                                                                                                    func (s *BoxSDF2) Evaluate(p V2) float64

                                                                                                                                                      Evaluate returns the minimum distance to a 2d box.

                                                                                                                                                      type BoxSDF3

                                                                                                                                                      type BoxSDF3 struct {
                                                                                                                                                      	// contains filtered or unexported fields
                                                                                                                                                      }

                                                                                                                                                        BoxSDF3 is a 3d box.

                                                                                                                                                        func (*BoxSDF3) BoundingBox

                                                                                                                                                        func (s *BoxSDF3) BoundingBox() Box3

                                                                                                                                                          BoundingBox returns the bounding box for a 3d box.

                                                                                                                                                          func (*BoxSDF3) Evaluate

                                                                                                                                                          func (s *BoxSDF3) Evaluate(p V3) float64

                                                                                                                                                            Evaluate returns the minimum distance to a 3d box.

                                                                                                                                                            type CircleSDF2

                                                                                                                                                            type CircleSDF2 struct {
                                                                                                                                                            	// contains filtered or unexported fields
                                                                                                                                                            }

                                                                                                                                                              CircleSDF2 is the 2d signed distance object for a circle.

                                                                                                                                                              func (*CircleSDF2) BoundingBox

                                                                                                                                                              func (s *CircleSDF2) BoundingBox() Box2

                                                                                                                                                                BoundingBox returns the bounding box of a 2d circle.

                                                                                                                                                                func (*CircleSDF2) Evaluate

                                                                                                                                                                func (s *CircleSDF2) Evaluate(p V2) float64

                                                                                                                                                                  Evaluate returns the minimum distance to a 2d circle.

                                                                                                                                                                  type ConeSDF3

                                                                                                                                                                  type ConeSDF3 struct {
                                                                                                                                                                  	// contains filtered or unexported fields
                                                                                                                                                                  }

                                                                                                                                                                    ConeSDF3 is a truncated cone.

                                                                                                                                                                    func (*ConeSDF3) BoundingBox

                                                                                                                                                                    func (s *ConeSDF3) BoundingBox() Box3

                                                                                                                                                                      BoundingBox return the bounding box for the trucated cone..

                                                                                                                                                                      func (*ConeSDF3) Evaluate

                                                                                                                                                                      func (s *ConeSDF3) Evaluate(p V3) float64

                                                                                                                                                                        Evaluate returns the minimum distance to a trucated cone.

                                                                                                                                                                        type CubicPolynomial

                                                                                                                                                                        type CubicPolynomial struct {
                                                                                                                                                                        	// contains filtered or unexported fields
                                                                                                                                                                        }

                                                                                                                                                                          CubicPolynomial is a cubic polynomial

                                                                                                                                                                          func (*CubicPolynomial) Set

                                                                                                                                                                          func (p *CubicPolynomial) Set(y0, y1, D0, D1 float64)

                                                                                                                                                                            Set cubic polynomial coefficient values.

                                                                                                                                                                            type CubicSpline

                                                                                                                                                                            type CubicSpline struct {
                                                                                                                                                                            	// contains filtered or unexported fields
                                                                                                                                                                            }

                                                                                                                                                                              CubicSpline is a 2d cubic spline.

                                                                                                                                                                              func (*CubicSpline) BoundingBox

                                                                                                                                                                              func (s *CubicSpline) BoundingBox() Box2

                                                                                                                                                                                BoundingBox returns the bounding box for a cubic spline.

                                                                                                                                                                                type CubicSplineSDF2

                                                                                                                                                                                type CubicSplineSDF2 struct {
                                                                                                                                                                                	// contains filtered or unexported fields
                                                                                                                                                                                }

                                                                                                                                                                                  CubicSplineSDF2 is an SDF2 made from a set of cubic splines.

                                                                                                                                                                                  func (*CubicSplineSDF2) BoundingBox

                                                                                                                                                                                  func (s *CubicSplineSDF2) BoundingBox() Box2

                                                                                                                                                                                    BoundingBox returns the 2d bounding box of a cubic spline.

                                                                                                                                                                                    func (*CubicSplineSDF2) Evaluate

                                                                                                                                                                                    func (s *CubicSplineSDF2) Evaluate(p V2) float64

                                                                                                                                                                                      Evaluate returns the minimum distance from a point to the cubic spline SDF2. Note: This uses Newton-Raphson minimisation and is unstable in some circumstances. A simple (and slower) solution is to convert the cubic spline SDF2 to a polygon SDF2 and use that for rendering.

                                                                                                                                                                                      func (*CubicSplineSDF2) PolySpline2D

                                                                                                                                                                                      func (s *CubicSplineSDF2) PolySpline2D(n int) (SDF2, error)

                                                                                                                                                                                        PolySpline2D returns a polygon SDF2 approximating a cubic spline SDF2.

                                                                                                                                                                                        func (*CubicSplineSDF2) Polygonize

                                                                                                                                                                                        func (s *CubicSplineSDF2) Polygonize(n int) *Polygon

                                                                                                                                                                                          Polygonize returns a polygon approximating the cubic spline SDF2.

                                                                                                                                                                                          type CutSDF2

                                                                                                                                                                                          type CutSDF2 struct {
                                                                                                                                                                                          	// contains filtered or unexported fields
                                                                                                                                                                                          }

                                                                                                                                                                                            CutSDF2 is an SDF2 made by cutting across an existing SDF2.

                                                                                                                                                                                            func (*CutSDF2) BoundingBox

                                                                                                                                                                                            func (s *CutSDF2) BoundingBox() Box2

                                                                                                                                                                                              BoundingBox returns the bounding box for the cut SDF2.

                                                                                                                                                                                              func (*CutSDF2) Evaluate

                                                                                                                                                                                              func (s *CutSDF2) Evaluate(p V2) float64

                                                                                                                                                                                                Evaluate returns the minimum distance to cut SDF2.

                                                                                                                                                                                                type CutSDF3

                                                                                                                                                                                                type CutSDF3 struct {
                                                                                                                                                                                                	// contains filtered or unexported fields
                                                                                                                                                                                                }

                                                                                                                                                                                                  CutSDF3 makes a planar cut through an SDF3.

                                                                                                                                                                                                  func (*CutSDF3) BoundingBox

                                                                                                                                                                                                  func (s *CutSDF3) BoundingBox() Box3

                                                                                                                                                                                                    BoundingBox returns the bounding box of the cut SDF3.

                                                                                                                                                                                                    func (*CutSDF3) Evaluate

                                                                                                                                                                                                    func (s *CutSDF3) Evaluate(p V3) float64

                                                                                                                                                                                                      Evaluate returns the minimum distance to the cut SDF3.

                                                                                                                                                                                                      type CylinderSDF3

                                                                                                                                                                                                      type CylinderSDF3 struct {
                                                                                                                                                                                                      	// contains filtered or unexported fields
                                                                                                                                                                                                      }

                                                                                                                                                                                                        CylinderSDF3 is a cylinder.

                                                                                                                                                                                                        func (*CylinderSDF3) BoundingBox

                                                                                                                                                                                                        func (s *CylinderSDF3) BoundingBox() Box3

                                                                                                                                                                                                          BoundingBox returns the bounding box for a cylinder.

                                                                                                                                                                                                          func (*CylinderSDF3) Evaluate

                                                                                                                                                                                                          func (s *CylinderSDF3) Evaluate(p V3) float64

                                                                                                                                                                                                            Evaluate returns the minimum distance to a cylinder.

                                                                                                                                                                                                            type DifferenceSDF2

                                                                                                                                                                                                            type DifferenceSDF2 struct {
                                                                                                                                                                                                            	// contains filtered or unexported fields
                                                                                                                                                                                                            }

                                                                                                                                                                                                              DifferenceSDF2 is the difference of two SDF2s.

                                                                                                                                                                                                              func (*DifferenceSDF2) BoundingBox

                                                                                                                                                                                                              func (s *DifferenceSDF2) BoundingBox() Box2

                                                                                                                                                                                                                BoundingBox returns the bounding box of the difference of two SDF2s.

                                                                                                                                                                                                                func (*DifferenceSDF2) Evaluate

                                                                                                                                                                                                                func (s *DifferenceSDF2) Evaluate(p V2) float64

                                                                                                                                                                                                                  Evaluate returns the minimum distance to the difference of two SDF2s.

                                                                                                                                                                                                                  func (*DifferenceSDF2) SetMax

                                                                                                                                                                                                                  func (s *DifferenceSDF2) SetMax(max MaxFunc)

                                                                                                                                                                                                                    SetMax sets the maximum function to control blending.

                                                                                                                                                                                                                    type DifferenceSDF3

                                                                                                                                                                                                                    type DifferenceSDF3 struct {
                                                                                                                                                                                                                    	// contains filtered or unexported fields
                                                                                                                                                                                                                    }

                                                                                                                                                                                                                      DifferenceSDF3 is the difference of two SDF3s, s0 - s1.

                                                                                                                                                                                                                      func (*DifferenceSDF3) BoundingBox

                                                                                                                                                                                                                      func (s *DifferenceSDF3) BoundingBox() Box3

                                                                                                                                                                                                                        BoundingBox returns the bounding box of the SDF3 difference.

                                                                                                                                                                                                                        func (*DifferenceSDF3) Evaluate

                                                                                                                                                                                                                        func (s *DifferenceSDF3) Evaluate(p V3) float64

                                                                                                                                                                                                                          Evaluate returns the minimum distance to the SDF3 difference.

                                                                                                                                                                                                                          func (*DifferenceSDF3) SetMax

                                                                                                                                                                                                                          func (s *DifferenceSDF3) SetMax(max MaxFunc)

                                                                                                                                                                                                                            SetMax sets the maximum function to control blending.

                                                                                                                                                                                                                            type ElongateSDF2

                                                                                                                                                                                                                            type ElongateSDF2 struct {
                                                                                                                                                                                                                            	// contains filtered or unexported fields
                                                                                                                                                                                                                            }

                                                                                                                                                                                                                              ElongateSDF2 is the elongation of an SDF2.

                                                                                                                                                                                                                              func (*ElongateSDF2) BoundingBox

                                                                                                                                                                                                                              func (s *ElongateSDF2) BoundingBox() Box2

                                                                                                                                                                                                                                BoundingBox returns the bounding box of an elongated SDF2.

                                                                                                                                                                                                                                func (*ElongateSDF2) Evaluate

                                                                                                                                                                                                                                func (s *ElongateSDF2) Evaluate(p V2) float64

                                                                                                                                                                                                                                  Evaluate returns the minimum distance to an elongated SDF2.

                                                                                                                                                                                                                                  type ElongateSDF3

                                                                                                                                                                                                                                  type ElongateSDF3 struct {
                                                                                                                                                                                                                                  	// contains filtered or unexported fields
                                                                                                                                                                                                                                  }

                                                                                                                                                                                                                                    ElongateSDF3 is the elongation of an SDF3.

                                                                                                                                                                                                                                    func (*ElongateSDF3) BoundingBox

                                                                                                                                                                                                                                    func (s *ElongateSDF3) BoundingBox() Box3

                                                                                                                                                                                                                                      BoundingBox returns the bounding box of an elongated SDF3.

                                                                                                                                                                                                                                      func (*ElongateSDF3) Evaluate

                                                                                                                                                                                                                                      func (s *ElongateSDF3) Evaluate(p V3) float64

                                                                                                                                                                                                                                        Evaluate returns the minimum distance to a elongated SDF2.

                                                                                                                                                                                                                                        type ExtrudeFunc

                                                                                                                                                                                                                                        type ExtrudeFunc func(p V3) V2

                                                                                                                                                                                                                                          ExtrudeFunc maps V3 to V2 - the point used to evaluate the SDF2.

                                                                                                                                                                                                                                          func ScaleExtrude

                                                                                                                                                                                                                                          func ScaleExtrude(height float64, scale V2) ExtrudeFunc

                                                                                                                                                                                                                                            ScaleExtrude returns an extrusion functions that scales with z.

                                                                                                                                                                                                                                            func ScaleTwistExtrude

                                                                                                                                                                                                                                            func ScaleTwistExtrude(height, twist float64, scale V2) ExtrudeFunc

                                                                                                                                                                                                                                              ScaleTwistExtrude returns an extrusion function that scales and twists with z.

                                                                                                                                                                                                                                              func TwistExtrude

                                                                                                                                                                                                                                              func TwistExtrude(height, twist float64) ExtrudeFunc

                                                                                                                                                                                                                                                TwistExtrude returns an extrusion function that twists with z.

                                                                                                                                                                                                                                                type ExtrudeRoundedSDF3

                                                                                                                                                                                                                                                type ExtrudeRoundedSDF3 struct {
                                                                                                                                                                                                                                                	// contains filtered or unexported fields
                                                                                                                                                                                                                                                }

                                                                                                                                                                                                                                                  ExtrudeRoundedSDF3 extrudes an SDF2 to an SDF3 with rounded edges.

                                                                                                                                                                                                                                                  func (*ExtrudeRoundedSDF3) BoundingBox

                                                                                                                                                                                                                                                  func (s *ExtrudeRoundedSDF3) BoundingBox() Box3

                                                                                                                                                                                                                                                    BoundingBox returns the bounding box for a rounded extrusion.

                                                                                                                                                                                                                                                    func (*ExtrudeRoundedSDF3) Evaluate

                                                                                                                                                                                                                                                    func (s *ExtrudeRoundedSDF3) Evaluate(p V3) float64

                                                                                                                                                                                                                                                      Evaluate returns the minimum distance to a rounded extrusion.

                                                                                                                                                                                                                                                      type ExtrudeSDF3

                                                                                                                                                                                                                                                      type ExtrudeSDF3 struct {
                                                                                                                                                                                                                                                      	// contains filtered or unexported fields
                                                                                                                                                                                                                                                      }

                                                                                                                                                                                                                                                        ExtrudeSDF3 extrudes an SDF2 to an SDF3.

                                                                                                                                                                                                                                                        func (*ExtrudeSDF3) BoundingBox

                                                                                                                                                                                                                                                        func (s *ExtrudeSDF3) BoundingBox() Box3

                                                                                                                                                                                                                                                          BoundingBox returns the bounding box for an extrusion.

                                                                                                                                                                                                                                                          func (*ExtrudeSDF3) Evaluate

                                                                                                                                                                                                                                                          func (s *ExtrudeSDF3) Evaluate(p V3) float64

                                                                                                                                                                                                                                                            Evaluate returns the minimum distance to an extrusion.

                                                                                                                                                                                                                                                            func (*ExtrudeSDF3) SetExtrude

                                                                                                                                                                                                                                                            func (s *ExtrudeSDF3) SetExtrude(extrude ExtrudeFunc)

                                                                                                                                                                                                                                                              SetExtrude sets the extrusion control function.

                                                                                                                                                                                                                                                              type Flange1

                                                                                                                                                                                                                                                              type Flange1 struct {
                                                                                                                                                                                                                                                              	// contains filtered or unexported fields
                                                                                                                                                                                                                                                              }

                                                                                                                                                                                                                                                                Flange1 is a flange shape made from a center circle with two side circles.

                                                                                                                                                                                                                                                                func (*Flange1) BoundingBox

                                                                                                                                                                                                                                                                func (s *Flange1) BoundingBox() Box2

                                                                                                                                                                                                                                                                  BoundingBox returns the bounding box for the flange.

                                                                                                                                                                                                                                                                  func (*Flange1) Evaluate

                                                                                                                                                                                                                                                                  func (s *Flange1) Evaluate(p V2) float64

                                                                                                                                                                                                                                                                    Evaluate returns the minimum distance to the flange.

                                                                                                                                                                                                                                                                    type FlatFlankCamSDF2

                                                                                                                                                                                                                                                                    type FlatFlankCamSDF2 struct {
                                                                                                                                                                                                                                                                    	// contains filtered or unexported fields
                                                                                                                                                                                                                                                                    }

                                                                                                                                                                                                                                                                      FlatFlankCamSDF2 is 2d cam profile. The profile is made from a base circle, a smaller nose circle and flat, tangential flanks.

                                                                                                                                                                                                                                                                      func (*FlatFlankCamSDF2) BoundingBox

                                                                                                                                                                                                                                                                      func (s *FlatFlankCamSDF2) BoundingBox() Box2

                                                                                                                                                                                                                                                                        BoundingBox returns the bounding box for the cam.

                                                                                                                                                                                                                                                                        func (*FlatFlankCamSDF2) Evaluate

                                                                                                                                                                                                                                                                        func (s *FlatFlankCamSDF2) Evaluate(p V2) float64

                                                                                                                                                                                                                                                                          Evaluate returns the minimum distance to the cam.

                                                                                                                                                                                                                                                                          type GearRackParms

                                                                                                                                                                                                                                                                          type GearRackParms struct {
                                                                                                                                                                                                                                                                          	NumberTeeth   int     // number of rack teeth
                                                                                                                                                                                                                                                                          	Module        float64 // pitch circle diameter / number of gear teeth
                                                                                                                                                                                                                                                                          	PressureAngle float64 // gear pressure angle (radians)
                                                                                                                                                                                                                                                                          	Backlash      float64 // backlash expressed as units of pitch circumference
                                                                                                                                                                                                                                                                          	BaseHeight    float64 // height of rack base
                                                                                                                                                                                                                                                                          }

                                                                                                                                                                                                                                                                            GearRackParms defines the parameters for a gear rack.

                                                                                                                                                                                                                                                                            type GearRackSDF2

                                                                                                                                                                                                                                                                            type GearRackSDF2 struct {
                                                                                                                                                                                                                                                                            	// contains filtered or unexported fields
                                                                                                                                                                                                                                                                            }

                                                                                                                                                                                                                                                                              GearRackSDF2 is a 2d linear gear rack.

                                                                                                                                                                                                                                                                              func (*GearRackSDF2) BoundingBox

                                                                                                                                                                                                                                                                              func (s *GearRackSDF2) BoundingBox() Box2

                                                                                                                                                                                                                                                                                BoundingBox returns the bounding box for the gear rack.

                                                                                                                                                                                                                                                                                func (*GearRackSDF2) Evaluate

                                                                                                                                                                                                                                                                                func (s *GearRackSDF2) Evaluate(p V2) float64

                                                                                                                                                                                                                                                                                  Evaluate returns the minimum distance to the gear rack.

                                                                                                                                                                                                                                                                                  type IntersectionSDF2

                                                                                                                                                                                                                                                                                  type IntersectionSDF2 struct {
                                                                                                                                                                                                                                                                                  	// contains filtered or unexported fields
                                                                                                                                                                                                                                                                                  }

                                                                                                                                                                                                                                                                                    IntersectionSDF2 is the intersection of two SDF2s.

                                                                                                                                                                                                                                                                                    func (*IntersectionSDF2) BoundingBox

                                                                                                                                                                                                                                                                                    func (s *IntersectionSDF2) BoundingBox() Box2

                                                                                                                                                                                                                                                                                      BoundingBox returns the bounding box of an SDF2 intersection.

                                                                                                                                                                                                                                                                                      func (*IntersectionSDF2) Evaluate

                                                                                                                                                                                                                                                                                      func (s *IntersectionSDF2) Evaluate(p V2) float64

                                                                                                                                                                                                                                                                                        Evaluate returns the minimum distance to the SDF2 intersection.

                                                                                                                                                                                                                                                                                        func (*IntersectionSDF2) SetMax

                                                                                                                                                                                                                                                                                        func (s *IntersectionSDF2) SetMax(max MaxFunc)

                                                                                                                                                                                                                                                                                          SetMax sets the maximum function to control blending.

                                                                                                                                                                                                                                                                                          type IntersectionSDF3

                                                                                                                                                                                                                                                                                          type IntersectionSDF3 struct {
                                                                                                                                                                                                                                                                                          	// contains filtered or unexported fields
                                                                                                                                                                                                                                                                                          }

                                                                                                                                                                                                                                                                                            IntersectionSDF3 is the intersection of two SDF3s.

                                                                                                                                                                                                                                                                                            func (*IntersectionSDF3) BoundingBox

                                                                                                                                                                                                                                                                                            func (s *IntersectionSDF3) BoundingBox() Box3

                                                                                                                                                                                                                                                                                              BoundingBox returns the bounding box of an SDF3 intersection.

                                                                                                                                                                                                                                                                                              func (*IntersectionSDF3) Evaluate

                                                                                                                                                                                                                                                                                              func (s *IntersectionSDF3) Evaluate(p V3) float64

                                                                                                                                                                                                                                                                                                Evaluate returns the minimum distance to the SDF3 intersection.

                                                                                                                                                                                                                                                                                                func (*IntersectionSDF3) SetMax

                                                                                                                                                                                                                                                                                                func (s *IntersectionSDF3) SetMax(max MaxFunc)

                                                                                                                                                                                                                                                                                                  SetMax sets the maximum function to control blending.

                                                                                                                                                                                                                                                                                                  type Line2

                                                                                                                                                                                                                                                                                                  type Line2 struct {
                                                                                                                                                                                                                                                                                                  	// contains filtered or unexported fields
                                                                                                                                                                                                                                                                                                  }

                                                                                                                                                                                                                                                                                                    Line2 is a 2d line defined as either point/point or point/vector.

                                                                                                                                                                                                                                                                                                    func (Line2) Distance

                                                                                                                                                                                                                                                                                                    func (l Line2) Distance(p V2) float64

                                                                                                                                                                                                                                                                                                      Distance returns the distance to the line. Greater than 0 implies to the right of the line vector.

                                                                                                                                                                                                                                                                                                      func (Line2) Intersect

                                                                                                                                                                                                                                                                                                      func (l Line2) Intersect(lx Line2) (float64, float64, error)

                                                                                                                                                                                                                                                                                                        Intersect returns the t parameters for the intersection between lines l and lx

                                                                                                                                                                                                                                                                                                        func (Line2) Position

                                                                                                                                                                                                                                                                                                        func (l Line2) Position(t float64) V2

                                                                                                                                                                                                                                                                                                          Position returns the position on the line given the t value.

                                                                                                                                                                                                                                                                                                          type LineSDF2

                                                                                                                                                                                                                                                                                                          type LineSDF2 struct {
                                                                                                                                                                                                                                                                                                          	// contains filtered or unexported fields
                                                                                                                                                                                                                                                                                                          }

                                                                                                                                                                                                                                                                                                            LineSDF2 is the 2d signed distance object for a line.

                                                                                                                                                                                                                                                                                                            func (*LineSDF2) BoundingBox

                                                                                                                                                                                                                                                                                                            func (s *LineSDF2) BoundingBox() Box2

                                                                                                                                                                                                                                                                                                              BoundingBox returns the bounding box for a 2d line.

                                                                                                                                                                                                                                                                                                              func (*LineSDF2) Evaluate

                                                                                                                                                                                                                                                                                                              func (s *LineSDF2) Evaluate(p V2) float64

                                                                                                                                                                                                                                                                                                                Evaluate returns the minimum distance to a 2d line.

                                                                                                                                                                                                                                                                                                                type LoftSDF3

                                                                                                                                                                                                                                                                                                                type LoftSDF3 struct {
                                                                                                                                                                                                                                                                                                                	// contains filtered or unexported fields
                                                                                                                                                                                                                                                                                                                }

                                                                                                                                                                                                                                                                                                                  LoftSDF3 is an extrusion between two SDF2s.

                                                                                                                                                                                                                                                                                                                  func (*LoftSDF3) BoundingBox

                                                                                                                                                                                                                                                                                                                  func (s *LoftSDF3) BoundingBox() Box3

                                                                                                                                                                                                                                                                                                                    BoundingBox returns the bounding box for a loft extrusion.

                                                                                                                                                                                                                                                                                                                    func (*LoftSDF3) Evaluate

                                                                                                                                                                                                                                                                                                                    func (s *LoftSDF3) Evaluate(p V3) float64

                                                                                                                                                                                                                                                                                                                      Evaluate returns the minimum distance to a loft extrusion.

                                                                                                                                                                                                                                                                                                                      type M22

                                                                                                                                                                                                                                                                                                                      type M22 struct {
                                                                                                                                                                                                                                                                                                                      	// contains filtered or unexported fields
                                                                                                                                                                                                                                                                                                                      }

                                                                                                                                                                                                                                                                                                                        M22 is a 2x2 matrix.

                                                                                                                                                                                                                                                                                                                        func Identity

                                                                                                                                                                                                                                                                                                                        func Identity() M22

                                                                                                                                                                                                                                                                                                                          Identity returns a 2x2 identity matrix.

                                                                                                                                                                                                                                                                                                                          func RandomM22

                                                                                                                                                                                                                                                                                                                          func RandomM22(a, b float64) M22

                                                                                                                                                                                                                                                                                                                            RandomM22 returns a 2x2 matrix with random elements.

                                                                                                                                                                                                                                                                                                                            func Rotate

                                                                                                                                                                                                                                                                                                                            func Rotate(a float64) M22

                                                                                                                                                                                                                                                                                                                              Rotate returns an orthographic 2x2 rotation matrix (right hand rule).

                                                                                                                                                                                                                                                                                                                              func (M22) Determinant

                                                                                                                                                                                                                                                                                                                              func (a M22) Determinant() float64

                                                                                                                                                                                                                                                                                                                                Determinant returns the determinant of a 2x2 matrix.

                                                                                                                                                                                                                                                                                                                                func (M22) Equals

                                                                                                                                                                                                                                                                                                                                func (a M22) Equals(b M22, tolerance float64) bool

                                                                                                                                                                                                                                                                                                                                  Equals tests the equality of 2x2 matrices.

                                                                                                                                                                                                                                                                                                                                  func (M22) Inverse

                                                                                                                                                                                                                                                                                                                                  func (a M22) Inverse() M22

                                                                                                                                                                                                                                                                                                                                    Inverse returns the inverse of a 2x2 matrix.

                                                                                                                                                                                                                                                                                                                                    func (M22) Mul

                                                                                                                                                                                                                                                                                                                                    func (a M22) Mul(b M22) M22

                                                                                                                                                                                                                                                                                                                                      Mul multiplies 2x2 matrices.

                                                                                                                                                                                                                                                                                                                                      func (M22) MulPosition

                                                                                                                                                                                                                                                                                                                                      func (a M22) MulPosition(b V2) V2

                                                                                                                                                                                                                                                                                                                                        MulPosition multiplies a V2 position with a rotate matrix.

                                                                                                                                                                                                                                                                                                                                        type M33

                                                                                                                                                                                                                                                                                                                                        type M33 struct {
                                                                                                                                                                                                                                                                                                                                        	// contains filtered or unexported fields
                                                                                                                                                                                                                                                                                                                                        }

                                                                                                                                                                                                                                                                                                                                          M33 is a 3x3 matrix.

                                                                                                                                                                                                                                                                                                                                          func Identity2d

                                                                                                                                                                                                                                                                                                                                          func Identity2d() M33

                                                                                                                                                                                                                                                                                                                                            Identity2d returns a 3x3 identity matrix.

                                                                                                                                                                                                                                                                                                                                            func MirrorX

                                                                                                                                                                                                                                                                                                                                            func MirrorX() M33

                                                                                                                                                                                                                                                                                                                                              MirrorX returns a 3x3 matrix with mirroring across the X axis.

                                                                                                                                                                                                                                                                                                                                              func MirrorY

                                                                                                                                                                                                                                                                                                                                              func MirrorY() M33

                                                                                                                                                                                                                                                                                                                                                MirrorY returns a 3x3 matrix with mirroring across the Y axis.

                                                                                                                                                                                                                                                                                                                                                func RandomM33

                                                                                                                                                                                                                                                                                                                                                func RandomM33(a, b float64) M33

                                                                                                                                                                                                                                                                                                                                                  RandomM33 returns a 3x3 matrix with random elements.

                                                                                                                                                                                                                                                                                                                                                  func Rotate2d

                                                                                                                                                                                                                                                                                                                                                  func Rotate2d(a float64) M33

                                                                                                                                                                                                                                                                                                                                                    Rotate2d returns an orthographic 3x3 rotation matrix (right hand rule).

                                                                                                                                                                                                                                                                                                                                                    func Scale2d

                                                                                                                                                                                                                                                                                                                                                    func Scale2d(v V2) M33

                                                                                                                                                                                                                                                                                                                                                      Scale2d returns a 3x3 scaling matrix. Scaling does not preserve distance. See: ScaleUniform2D().

                                                                                                                                                                                                                                                                                                                                                      func Translate2d

                                                                                                                                                                                                                                                                                                                                                      func Translate2d(v V2) M33

                                                                                                                                                                                                                                                                                                                                                        Translate2d returns a 3x3 translation matrix.

                                                                                                                                                                                                                                                                                                                                                        func (M33) Add

                                                                                                                                                                                                                                                                                                                                                        func (a M33) Add(b M33) M33

                                                                                                                                                                                                                                                                                                                                                          Add two 3x3 matrices.

                                                                                                                                                                                                                                                                                                                                                          func (M33) Determinant

                                                                                                                                                                                                                                                                                                                                                          func (a M33) Determinant() float64

                                                                                                                                                                                                                                                                                                                                                            Determinant returns the determinant of a 3x3 matrix.

                                                                                                                                                                                                                                                                                                                                                            func (M33) Equals

                                                                                                                                                                                                                                                                                                                                                            func (a M33) Equals(b M33, tolerance float64) bool

                                                                                                                                                                                                                                                                                                                                                              Equals tests the equality of 3x3 matrices.

                                                                                                                                                                                                                                                                                                                                                              func (M33) Inverse

                                                                                                                                                                                                                                                                                                                                                              func (a M33) Inverse() M33

                                                                                                                                                                                                                                                                                                                                                                Inverse returns the inverse of a 3x3 matrix.

                                                                                                                                                                                                                                                                                                                                                                func (M33) Mul

                                                                                                                                                                                                                                                                                                                                                                func (a M33) Mul(b M33) M33

                                                                                                                                                                                                                                                                                                                                                                  Mul multiplies 3x3 matrices.

                                                                                                                                                                                                                                                                                                                                                                  func (M33) MulBox

                                                                                                                                                                                                                                                                                                                                                                  func (a M33) MulBox(box Box2) Box2

                                                                                                                                                                                                                                                                                                                                                                    MulBox rotates/translates a 2d bounding box and resizes for axis-alignment.

                                                                                                                                                                                                                                                                                                                                                                    func (M33) MulPosition

                                                                                                                                                                                                                                                                                                                                                                    func (a M33) MulPosition(b V2) V2

                                                                                                                                                                                                                                                                                                                                                                      MulPosition multiplies a V2 position with a rotate/translate matrix.

                                                                                                                                                                                                                                                                                                                                                                      func (M33) MulScalar

                                                                                                                                                                                                                                                                                                                                                                      func (a M33) MulScalar(k float64) M33

                                                                                                                                                                                                                                                                                                                                                                        MulScalar multiplies each 3x3 matrix component by a scalar.

                                                                                                                                                                                                                                                                                                                                                                        type M44

                                                                                                                                                                                                                                                                                                                                                                        type M44 struct {
                                                                                                                                                                                                                                                                                                                                                                        	// contains filtered or unexported fields
                                                                                                                                                                                                                                                                                                                                                                        }

                                                                                                                                                                                                                                                                                                                                                                          M44 is a 4x4 matrix.

                                                                                                                                                                                                                                                                                                                                                                          func Identity3d

                                                                                                                                                                                                                                                                                                                                                                          func Identity3d() M44

                                                                                                                                                                                                                                                                                                                                                                            Identity3d returns a 4x4 identity matrix.

                                                                                                                                                                                                                                                                                                                                                                            func MirrorXY

                                                                                                                                                                                                                                                                                                                                                                            func MirrorXY() M44

                                                                                                                                                                                                                                                                                                                                                                              MirrorXY returns a 4x4 matrix with mirroring across the XY plane.

                                                                                                                                                                                                                                                                                                                                                                              func MirrorXZ

                                                                                                                                                                                                                                                                                                                                                                              func MirrorXZ() M44

                                                                                                                                                                                                                                                                                                                                                                                MirrorXZ returns a 4x4 matrix with mirroring across the XZ plane.

                                                                                                                                                                                                                                                                                                                                                                                func MirrorYZ

                                                                                                                                                                                                                                                                                                                                                                                func MirrorYZ() M44

                                                                                                                                                                                                                                                                                                                                                                                  MirrorYZ returns a 4x4 matrix with mirroring across the YZ plane.

                                                                                                                                                                                                                                                                                                                                                                                  func RandomM44

                                                                                                                                                                                                                                                                                                                                                                                  func RandomM44(a, b float64) M44

                                                                                                                                                                                                                                                                                                                                                                                    RandomM44 returns a 4x4 matrix with random elements.

                                                                                                                                                                                                                                                                                                                                                                                    func Rotate3d

                                                                                                                                                                                                                                                                                                                                                                                    func Rotate3d(v V3, a float64) M44

                                                                                                                                                                                                                                                                                                                                                                                      Rotate3d returns an orthographic 4x4 rotation matrix (right hand rule).

                                                                                                                                                                                                                                                                                                                                                                                      func RotateX

                                                                                                                                                                                                                                                                                                                                                                                      func RotateX(a float64) M44

                                                                                                                                                                                                                                                                                                                                                                                        RotateX returns a 4x4 matrix with rotation about the X axis.

                                                                                                                                                                                                                                                                                                                                                                                        func RotateY

                                                                                                                                                                                                                                                                                                                                                                                        func RotateY(a float64) M44

                                                                                                                                                                                                                                                                                                                                                                                          RotateY returns a 4x4 matrix with rotation about the Y axis.

                                                                                                                                                                                                                                                                                                                                                                                          func RotateZ

                                                                                                                                                                                                                                                                                                                                                                                          func RotateZ(a float64) M44

                                                                                                                                                                                                                                                                                                                                                                                            RotateZ returns a 4x4 matrix with rotation about the Z axis.

                                                                                                                                                                                                                                                                                                                                                                                            func Scale3d

                                                                                                                                                                                                                                                                                                                                                                                            func Scale3d(v V3) M44

                                                                                                                                                                                                                                                                                                                                                                                              Scale3d returns a 4x4 scaling matrix. Scaling does not preserve distance. See: ScaleUniform3D()

                                                                                                                                                                                                                                                                                                                                                                                              func Translate3d

                                                                                                                                                                                                                                                                                                                                                                                              func Translate3d(v V3) M44

                                                                                                                                                                                                                                                                                                                                                                                                Translate3d returns a 4x4 translation matrix.

                                                                                                                                                                                                                                                                                                                                                                                                func (M44) Determinant

                                                                                                                                                                                                                                                                                                                                                                                                func (a M44) Determinant() float64

                                                                                                                                                                                                                                                                                                                                                                                                  Determinant returns the determinant of a 4x4 matrix.

                                                                                                                                                                                                                                                                                                                                                                                                  func (M44) Equals

                                                                                                                                                                                                                                                                                                                                                                                                  func (a M44) Equals(b M44, tolerance float64) bool

                                                                                                                                                                                                                                                                                                                                                                                                    Equals tests the equality of 4x4 matrices.

                                                                                                                                                                                                                                                                                                                                                                                                    func (M44) Inverse

                                                                                                                                                                                                                                                                                                                                                                                                    func (a M44) Inverse() M44

                                                                                                                                                                                                                                                                                                                                                                                                      Inverse returns the inverse of a 4x4 matrix.

                                                                                                                                                                                                                                                                                                                                                                                                      func (M44) Mul

                                                                                                                                                                                                                                                                                                                                                                                                      func (a M44) Mul(b M44) M44

                                                                                                                                                                                                                                                                                                                                                                                                        Mul multiplies 4x4 matrices.

                                                                                                                                                                                                                                                                                                                                                                                                        func (M44) MulBox

                                                                                                                                                                                                                                                                                                                                                                                                        func (a M44) MulBox(box Box3) Box3

                                                                                                                                                                                                                                                                                                                                                                                                          MulBox rotates/translates a 3d bounding box and resizes for axis-alignment.

                                                                                                                                                                                                                                                                                                                                                                                                          func (M44) MulPosition

                                                                                                                                                                                                                                                                                                                                                                                                          func (a M44) MulPosition(b V3) V3

                                                                                                                                                                                                                                                                                                                                                                                                            MulPosition multiplies a V3 position with a rotate/translate matrix.

                                                                                                                                                                                                                                                                                                                                                                                                            type Map2

                                                                                                                                                                                                                                                                                                                                                                                                            type Map2 struct {
                                                                                                                                                                                                                                                                                                                                                                                                            	// contains filtered or unexported fields
                                                                                                                                                                                                                                                                                                                                                                                                            }

                                                                                                                                                                                                                                                                                                                                                                                                              Map2 maps a 2d region to integer grid coordinates.

                                                                                                                                                                                                                                                                                                                                                                                                              func NewMap2

                                                                                                                                                                                                                                                                                                                                                                                                              func NewMap2(bb Box2, grid V2i, flipy bool) (*Map2, error)

                                                                                                                                                                                                                                                                                                                                                                                                                NewMap2 returns a 2d region to grid coordinates map.

                                                                                                                                                                                                                                                                                                                                                                                                                func (*Map2) ToV2

                                                                                                                                                                                                                                                                                                                                                                                                                func (m *Map2) ToV2(p V2i) V2

                                                                                                                                                                                                                                                                                                                                                                                                                  ToV2 converts grid integer coordinates to 2d region float coordinates.

                                                                                                                                                                                                                                                                                                                                                                                                                  func (*Map2) ToV2i

                                                                                                                                                                                                                                                                                                                                                                                                                  func (m *Map2) ToV2i(p V2) V2i

                                                                                                                                                                                                                                                                                                                                                                                                                    ToV2i converts 2d region float coordinates to grid integer coordinates.

                                                                                                                                                                                                                                                                                                                                                                                                                    type MaxFunc

                                                                                                                                                                                                                                                                                                                                                                                                                    type MaxFunc func(a, b float64) float64

                                                                                                                                                                                                                                                                                                                                                                                                                      MaxFunc is a maximum function for SDF blending.

                                                                                                                                                                                                                                                                                                                                                                                                                      func PolyMax

                                                                                                                                                                                                                                                                                                                                                                                                                      func PolyMax(k float64) MaxFunc

                                                                                                                                                                                                                                                                                                                                                                                                                        PolyMax returns a maximum function (Try k = 0.1, a bigger k gives a bigger fillet).

                                                                                                                                                                                                                                                                                                                                                                                                                        type MinFunc

                                                                                                                                                                                                                                                                                                                                                                                                                        type MinFunc func(a, b float64) float64

                                                                                                                                                                                                                                                                                                                                                                                                                          MinFunc is a minimum functions for SDF blending.

                                                                                                                                                                                                                                                                                                                                                                                                                          func ChamferMin

                                                                                                                                                                                                                                                                                                                                                                                                                          func ChamferMin(k float64) MinFunc

                                                                                                                                                                                                                                                                                                                                                                                                                            ChamferMin returns a minimum function that makes a 45-degree chamfered edge (the diagonal of a square of size <r>). TODO: why the holes in the rendering?

                                                                                                                                                                                                                                                                                                                                                                                                                            func ExpMin

                                                                                                                                                                                                                                                                                                                                                                                                                            func ExpMin(k float64) MinFunc

                                                                                                                                                                                                                                                                                                                                                                                                                              ExpMin returns a minimum function with exponential smoothing (k = 32).

                                                                                                                                                                                                                                                                                                                                                                                                                              func PolyMin

                                                                                                                                                                                                                                                                                                                                                                                                                              func PolyMin(k float64) MinFunc

                                                                                                                                                                                                                                                                                                                                                                                                                                PolyMin returns a minimum function (Try k = 0.1, a bigger k gives a bigger fillet).

                                                                                                                                                                                                                                                                                                                                                                                                                                func PowMin

                                                                                                                                                                                                                                                                                                                                                                                                                                func PowMin(k float64) MinFunc

                                                                                                                                                                                                                                                                                                                                                                                                                                  PowMin returns a minimum function (k = 8). TODO - weird results, is this correct?

                                                                                                                                                                                                                                                                                                                                                                                                                                  func RoundMin

                                                                                                                                                                                                                                                                                                                                                                                                                                  func RoundMin(k float64) MinFunc

                                                                                                                                                                                                                                                                                                                                                                                                                                    RoundMin returns a minimum function that uses a quarter-circle to join the two objects smoothly.

                                                                                                                                                                                                                                                                                                                                                                                                                                    type OffsetSDF2

                                                                                                                                                                                                                                                                                                                                                                                                                                    type OffsetSDF2 struct {
                                                                                                                                                                                                                                                                                                                                                                                                                                    	// contains filtered or unexported fields
                                                                                                                                                                                                                                                                                                                                                                                                                                    }

                                                                                                                                                                                                                                                                                                                                                                                                                                      OffsetSDF2 offsets the distance function of an existing SDF2.

                                                                                                                                                                                                                                                                                                                                                                                                                                      func (*OffsetSDF2) BoundingBox

                                                                                                                                                                                                                                                                                                                                                                                                                                      func (s *OffsetSDF2) BoundingBox() Box2

                                                                                                                                                                                                                                                                                                                                                                                                                                        BoundingBox returns the bounding box of an offset SDF2.

                                                                                                                                                                                                                                                                                                                                                                                                                                        func (*OffsetSDF2) Evaluate

                                                                                                                                                                                                                                                                                                                                                                                                                                        func (s *OffsetSDF2) Evaluate(p V2) float64

                                                                                                                                                                                                                                                                                                                                                                                                                                          Evaluate returns the minimum distance to an offset SDF2.

                                                                                                                                                                                                                                                                                                                                                                                                                                          type OffsetSDF3

                                                                                                                                                                                                                                                                                                                                                                                                                                          type OffsetSDF3 struct {
                                                                                                                                                                                                                                                                                                                                                                                                                                          	// contains filtered or unexported fields
                                                                                                                                                                                                                                                                                                                                                                                                                                          }

                                                                                                                                                                                                                                                                                                                                                                                                                                            OffsetSDF3 offsets the distance function of an existing SDF3.

                                                                                                                                                                                                                                                                                                                                                                                                                                            func (*OffsetSDF3) BoundingBox

                                                                                                                                                                                                                                                                                                                                                                                                                                            func (s *OffsetSDF3) BoundingBox() Box3

                                                                                                                                                                                                                                                                                                                                                                                                                                              BoundingBox returns the bounding box of an offset SDF3.

                                                                                                                                                                                                                                                                                                                                                                                                                                              func (*OffsetSDF3) Evaluate

                                                                                                                                                                                                                                                                                                                                                                                                                                              func (s *OffsetSDF3) Evaluate(p V3) float64

                                                                                                                                                                                                                                                                                                                                                                                                                                                Evaluate returns the minimum distance to an offset SDF3.

                                                                                                                                                                                                                                                                                                                                                                                                                                                type P2

                                                                                                                                                                                                                                                                                                                                                                                                                                                type P2 struct {
                                                                                                                                                                                                                                                                                                                                                                                                                                                	R, Theta float64
                                                                                                                                                                                                                                                                                                                                                                                                                                                }

                                                                                                                                                                                                                                                                                                                                                                                                                                                  P2 is a 2d float64 polar vector.

                                                                                                                                                                                                                                                                                                                                                                                                                                                  func (P2) PolarToCartesian

                                                                                                                                                                                                                                                                                                                                                                                                                                                  func (a P2) PolarToCartesian() V2

                                                                                                                                                                                                                                                                                                                                                                                                                                                    PolarToCartesian converts a polar to a cartesian coordinate.

                                                                                                                                                                                                                                                                                                                                                                                                                                                    type PolySDF2

                                                                                                                                                                                                                                                                                                                                                                                                                                                    type PolySDF2 struct {
                                                                                                                                                                                                                                                                                                                                                                                                                                                    	// contains filtered or unexported fields
                                                                                                                                                                                                                                                                                                                                                                                                                                                    }

                                                                                                                                                                                                                                                                                                                                                                                                                                                      PolySDF2 is an SDF2 made from a closed set of line segments.

                                                                                                                                                                                                                                                                                                                                                                                                                                                      func (*PolySDF2) BoundingBox

                                                                                                                                                                                                                                                                                                                                                                                                                                                      func (s *PolySDF2) BoundingBox() Box2

                                                                                                                                                                                                                                                                                                                                                                                                                                                        BoundingBox returns the bounding box of a 2d polygon.

                                                                                                                                                                                                                                                                                                                                                                                                                                                        func (*PolySDF2) Evaluate

                                                                                                                                                                                                                                                                                                                                                                                                                                                        func (s *PolySDF2) Evaluate(p V2) float64

                                                                                                                                                                                                                                                                                                                                                                                                                                                          Evaluate returns the minimum distance for a 2d polygon.

                                                                                                                                                                                                                                                                                                                                                                                                                                                          type Polygon

                                                                                                                                                                                                                                                                                                                                                                                                                                                          type Polygon struct {
                                                                                                                                                                                                                                                                                                                                                                                                                                                          	// contains filtered or unexported fields
                                                                                                                                                                                                                                                                                                                                                                                                                                                          }

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Polygon stores a set of 2d polygon vertices.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            func NewPolygon

                                                                                                                                                                                                                                                                                                                                                                                                                                                            func NewPolygon() *Polygon

                                                                                                                                                                                                                                                                                                                                                                                                                                                              NewPolygon returns an empty polygon.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              func (*Polygon) Add

                                                                                                                                                                                                                                                                                                                                                                                                                                                              func (p *Polygon) Add(x, y float64) *PolygonVertex

                                                                                                                                                                                                                                                                                                                                                                                                                                                                Add an x,y vertex to a polygon.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                func (*Polygon) AddV2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                func (p *Polygon) AddV2(x V2) *PolygonVertex

                                                                                                                                                                                                                                                                                                                                                                                                                                                                  AddV2 adds a V2 vertex to a polygon.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func (*Polygon) AddV2Set

                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func (p *Polygon) AddV2Set(x []V2)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                    AddV2Set adds a set of V2 vertices to a polygon.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func (*Polygon) Close

                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func (p *Polygon) Close()

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Close closes the polygon.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      func (*Polygon) Closed

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      func (p *Polygon) Closed() bool

                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Closed returns true/fale if the polygon is closed/open.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func (*Polygon) Drop

                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func (p *Polygon) Drop()

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Drop the last vertex from the list.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func (*Polygon) Reverse

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func (p *Polygon) Reverse()

                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Reverse reverses the order the vertices are returned.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func (*Polygon) Vertices

                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func (p *Polygon) Vertices() []V2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Vertices returns the vertices of the polygon.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                              type PolygonVertex

                                                                                                                                                                                                                                                                                                                                                                                                                                                                              type PolygonVertex struct {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                              	// contains filtered or unexported fields
                                                                                                                                                                                                                                                                                                                                                                                                                                                                              }

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                PolygonVertex is a polygon vertex.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func (*PolygonVertex) Arc

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func (v *PolygonVertex) Arc(radius float64, facets int) *PolygonVertex

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Arc replaces a line segment with a circular arc.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func (*PolygonVertex) Chamfer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func (v *PolygonVertex) Chamfer(size float64) *PolygonVertex

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Chamfer marks the polygon vertex for chamfering.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func (*PolygonVertex) Polar

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func (v *PolygonVertex) Polar() *PolygonVertex

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Polar treats the polygon vertex values as polar coordinates (r, theta).

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      func (*PolygonVertex) Rel

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      func (v *PolygonVertex) Rel() *PolygonVertex

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Rel positions the polygon vertex relative to the prior vertex.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func (*PolygonVertex) Smooth

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func (v *PolygonVertex) Smooth(radius float64, facets int) *PolygonVertex

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Smooth marks the polygon vertex for smoothing.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          type RotateCopySDF2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          type RotateCopySDF2 struct {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          	// contains filtered or unexported fields
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          }

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            RotateCopySDF2 copies an SDF2 n times in a full circle.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func (*RotateCopySDF2) BoundingBox

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func (s *RotateCopySDF2) BoundingBox() Box2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              BoundingBox returns the bounding box of a rotate/copy SDF2.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func (*RotateCopySDF2) Evaluate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func (s *RotateCopySDF2) Evaluate(p V2) float64

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Evaluate returns the minimum distance to a rotate/copy SDF2.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                type RotateCopySDF3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                type RotateCopySDF3 struct {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                	// contains filtered or unexported fields
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                }

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  RotateCopySDF3 rotates and creates N copies of an SDF3 about the z-axis.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func (*RotateCopySDF3) BoundingBox

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func (s *RotateCopySDF3) BoundingBox() Box3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    BoundingBox returns the bounding box of a rotate/copy SDF3.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func (*RotateCopySDF3) Evaluate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func (s *RotateCopySDF3) Evaluate(p V3) float64

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Evaluate returns the minimum distance to a rotate/copy SDF3.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      type RotateUnionSDF2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      type RotateUnionSDF2 struct {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      	// contains filtered or unexported fields
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      }

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        RotateUnionSDF2 defines a union of rotated SDF2s.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func (*RotateUnionSDF2) BoundingBox

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func (s *RotateUnionSDF2) BoundingBox() Box2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          BoundingBox returns the bounding box of a union of rotated SDF2s.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func (*RotateUnionSDF2) Evaluate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func (s *RotateUnionSDF2) Evaluate(p V2) float64

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Evaluate returns the minimum distance to a union of rotated SDF2s.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func (*RotateUnionSDF2) SetMin

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func (s *RotateUnionSDF2) SetMin(min MinFunc)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              SetMin sets the minimum function to control blending.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              type RotateUnionSDF3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              type RotateUnionSDF3 struct {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              	// contains filtered or unexported fields
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              }

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                RotateUnionSDF3 creates a union of SDF3s rotated about the z-axis.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func (*RotateUnionSDF3) BoundingBox

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func (s *RotateUnionSDF3) BoundingBox() Box3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  BoundingBox returns the bounding box of a rotate/union object.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func (*RotateUnionSDF3) Evaluate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func (s *RotateUnionSDF3) Evaluate(p V3) float64

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Evaluate returns the minimum distance to a rotate/union object.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func (*RotateUnionSDF3) SetMin

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func (s *RotateUnionSDF3) SetMin(min MinFunc)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      SetMin sets the minimum function to control blending.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      type SDF2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      type SDF2 interface {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      	Evaluate(p V2) float64
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      	BoundingBox() Box2
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      }

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        SDF2 is the interface to a 2d signed distance function object.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func ANSIButtressThread

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func ANSIButtressThread(
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        	radius float64,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        	pitch float64,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ) (SDF2, error)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ANSIButtressThread returns the 2d profile for an ANSI 45/7 buttress thread. https://en.wikipedia.org/wiki/Buttress_thread AMSE B1.9-1973

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func AcmeThread

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func AcmeThread(
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          	radius float64,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          	pitch float64,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ) (SDF2, error)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            AcmeThread returns the 2d profile for an acme thread.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func ArcSpiral2D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func ArcSpiral2D(
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            	a, k float64,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            	start, end float64,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            	d float64,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ) (SDF2, error)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ArcSpiral2D returns a 2d Archimedean spiral (r = m*theta + b).

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func Array2D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func Array2D(sdf SDF2, num V2i, step V2) SDF2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Array2D returns an XY grid array of an existing SDF2.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func Box2D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func Box2D(size V2, round float64) SDF2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Box2D returns a 2d box.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func Center2D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func Center2D(s SDF2) SDF2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Center2D centers the origin of an SDF2 on it's bounding box.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func CenterAndScale2D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func CenterAndScale2D(s SDF2, k float64) SDF2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      CenterAndScale2D centers the origin of an SDF2 on it's bounding box, and then scales it. Distance is correct with scaling.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      func Circle2D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      func Circle2D(radius float64) (SDF2, error)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Circle2D returns the SDF2 for a 2d circle.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func CubicSpline2D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func CubicSpline2D(knot []V2) (SDF2, error)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          CubicSpline2D returns an SDF2 made from a set of cubic splines.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func Cut2D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func Cut2D(sdf SDF2, a, v V2) SDF2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Cut2D cuts the SDF2 along a line from a in direction v. The SDF2 to the right of the line remains.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func Difference2D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func Difference2D(s0, s1 SDF2) SDF2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Difference2D returns the difference of two SDF2 objects, s0 - s1.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func Elongate2D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func Elongate2D(sdf SDF2, h V2) SDF2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Elongate2D returns the elongation of an SDF2.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func FlatFlankCam2D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func FlatFlankCam2D(
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                	distance float64,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                	baseRadius float64,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                	noseRadius float64,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ) (SDF2, error)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  FlatFlankCam2D creates a 2D cam profile. The profile is made from a base circle, a smaller nose circle and flat, tangential flanks. The base circle is centered on the origin. The nose circle is located on the positive y axis.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func GearRack2D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func GearRack2D(k *GearRackParms) (SDF2, error)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    GearRack2D returns the 2D profile for a gear rack.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func ISOThread

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func ISOThread(
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    	radius float64,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    	pitch float64,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    	external bool,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ) (SDF2, error)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      ISOThread returns the 2d profile for an ISO/UTS thread. https://en.wikipedia.org/wiki/ISO_metric_screw_thread https://en.wikipedia.org/wiki/Unified_Thread_Standard

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      func Intersect2D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      func Intersect2D(s0, s1 SDF2) SDF2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Intersect2D returns the intersection of two SDF2s.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func Line2D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func Line2D(l, round float64) SDF2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Line2D returns a line from (-l/2,0) to (l/2,0).

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func LineOf2D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func LineOf2D(s SDF2, p0, p1 V2, pattern string) SDF2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            LineOf2D returns a union of 2D objects positioned along a line from p0 to p1.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func MakeFlatFlankCam

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func MakeFlatFlankCam(
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            	lift float64,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            	duration float64,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            	maxDiameter float64,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ) (SDF2, error)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              MakeFlatFlankCam makes a flat flank cam profile from design parameters.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func MakeThreeArcCam

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func MakeThreeArcCam(
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              	lift float64,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              	duration float64,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              	maxDiameter float64,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              	k float64,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ) (SDF2, error)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                MakeThreeArcCam makes a three arc cam profile from design parameters.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func Multi2D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func Multi2D(s SDF2, positions V2Set) SDF2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Multi2D creates a union of an SDF2 at a set of 2D positions.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func NewFlange1

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func NewFlange1(
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  	distance float64,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  	centerRadius float64,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  	sideRadius float64,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  ) SDF2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    NewFlange1 returns a flange shape made from a center circle with two side circles.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func Offset2D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func Offset2D(sdf SDF2, offset float64) SDF2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Offset2D returns an SDF2 that offsets the distance function of another SDF2.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      func PlasticButtressThread

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      func PlasticButtressThread(
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      	radius float64,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      	pitch float64,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      ) (SDF2, error)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        PlasticButtressThread returns the 2d profile for a screw top style plastic buttress thread. Similar to ANSI 45/7 - but with more corner rounding

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func Polygon2D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func Polygon2D(vertex []V2) (SDF2, error)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Polygon2D returns an SDF2 made from a closed set of line segments.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func RotateCopy2D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func RotateCopy2D(sdf SDF2, n int) SDF2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            RotateCopy2D rotates and copies an SDF2 n times in a full circle.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func RotateUnion2D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func RotateUnion2D(sdf SDF2, num int, step M33) SDF2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              RotateUnion2D returns a union of rotated SDF2s.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func ScaleUniform2D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func ScaleUniform2D(sdf SDF2, k float64) SDF2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ScaleUniform2D scales an SDF2 by k on each axis. Distance is correct with scaling.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func Slice2D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func Slice2D(
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                	sdf SDF3,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                	a V3,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                	n V3,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ) SDF2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Slice2D returns an SDF2 created from a planar slice through an SDF3.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func TextSDF2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func TextSDF2(f *truetype.Font, t *Text, h float64) (SDF2, error)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    TextSDF2 returns a sized SDF2 for a text object.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func ThreeArcCam2D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func ThreeArcCam2D(
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    	distance float64,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    	baseRadius float64,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    	noseRadius float64,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    	flankRadius float64,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ) (SDF2, error)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      ThreeArcCam2D creates a 2D cam profile. The profile is made from a base circle, a smaller nose circle and circular flank arcs. The base circle is centered on the origin. The nose circle is located on the positive y axis. The flank arcs are tangential to the base and nose circles.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      func Transform2D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      func Transform2D(sdf SDF2, m M33) SDF2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Transform2D applies a transformation matrix to an SDF2. Distance is *not* preserved with scaling.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func Union2D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func Union2D(sdf ...SDF2) SDF2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Union2D returns the union of multiple SDF2 objects.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          type SDF3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          type SDF3 interface {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          	Evaluate(p V3) float64
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          	BoundingBox() Box3
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          }

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            SDF3 is the interface to a 3d signed distance function object.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func Array3D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func Array3D(sdf SDF3, num V3i, step V3) SDF3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Array3D returns an XYZ array of a given SDF3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func Box3D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func Box3D(size V3, round float64) (SDF3, error)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Box3D return an SDF3 for a 3d box (rounded corners with round > 0).

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func Capsule3D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func Capsule3D(height, radius float64) (SDF3, error)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Capsule3D return an SDF3 for a capsule.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func Cone3D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func Cone3D(height, r0, r1, round float64) (SDF3, error)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Cone3D returns the SDF3 for a trucated cone (round > 0 gives rounded edges).

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func Cut3D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func Cut3D(sdf SDF3, a, n V3) SDF3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Cut3D cuts an SDF3 along a plane passing through a with normal n. The SDF3 on the same side as the normal remains.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      func Cylinder3D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      func Cylinder3D(height, radius, round float64) (SDF3, error)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Cylinder3D return an SDF3 for a cylinder (rounded edges with round > 0).

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func Difference3D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func Difference3D(s0, s1 SDF3) SDF3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Difference3D returns the difference of two SDF3s, s0 - s1.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func Elongate3D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func Elongate3D(sdf SDF3, h V3) SDF3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Elongate3D returns the elongation of an SDF3.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func Extrude3D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func Extrude3D(sdf SDF2, height float64) SDF3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Extrude3D does a linear extrude on an SDF3.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func ExtrudeRounded3D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func ExtrudeRounded3D(sdf SDF2, height, round float64) (SDF3, error)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ExtrudeRounded3D extrudes an SDF2 to an SDF3 with rounded edges.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func Intersect3D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func Intersect3D(s0, s1 SDF3) SDF3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Intersect3D returns the intersection of two SDF3s.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func LineOf3D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func LineOf3D(s SDF3, p0, p1 V3, pattern string) SDF3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    LineOf3D returns a union of 3D objects positioned along a line from p0 to p1.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func Loft3D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func Loft3D(sdf0, sdf1 SDF2, height, round float64) (SDF3, error)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Loft3D extrudes an SDF3 that transitions between two SDF2 shapes.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      func Multi3D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      func Multi3D(s SDF3, positions V3Set) SDF3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Multi3D creates a union of an SDF3 at translated positions.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func Offset3D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func Offset3D(sdf SDF3, offset float64) SDF3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Offset3D returns an SDF3 that offsets the distance function of another SDF3.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func Orient3D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func Orient3D(s SDF3, base V3, directions V3Set) SDF3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Orient3D creates a union of an SDF3 at oriented directions.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func Revolve3D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func Revolve3D(sdf SDF2) (SDF3, error)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Revolve3D returns an SDF3 for a solid of revolution.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func RevolveTheta3D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func RevolveTheta3D(sdf SDF2, theta float64) (SDF3, error)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                RevolveTheta3D returns an SDF3 for a solid of revolution.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func RotateCopy3D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func RotateCopy3D(
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                	sdf SDF3,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                	num int,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ) SDF3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  RotateCopy3D rotates and creates N copies of an SDF3 about the z-axis.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func RotateUnion3D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func RotateUnion3D(sdf SDF3, num int, step M44) SDF3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    RotateUnion3D creates a union of SDF3s rotated about the z-axis.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func ScaleExtrude3D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func ScaleExtrude3D(sdf SDF2, height float64, scale V2) SDF3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      ScaleExtrude3D extrudes an SDF2 and scales it over the height of the extrusion.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      func ScaleTwistExtrude3D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      func ScaleTwistExtrude3D(sdf SDF2, height, twist float64, scale V2) SDF3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ScaleTwistExtrude3D extrudes an SDF2 and scales and twists it over the height of the extrusion.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func ScaleUniform3D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func ScaleUniform3D(sdf SDF3, k float64) SDF3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ScaleUniform3D uniformly scales an SDF3 on all axes.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func Screw3D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func Screw3D(
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          	thread SDF2,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          	length float64,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          	pitch float64,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          	starts int,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ) (SDF3, error)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Screw3D returns a screw SDF3.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func Sphere3D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func Sphere3D(radius float64) (SDF3, error)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Sphere3D return an SDF3 for a sphere.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func Transform3D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func Transform3D(sdf SDF3, matrix M44) SDF3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Transform3D applies a transformation matrix to an SDF3.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func TwistExtrude3D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func TwistExtrude3D(sdf SDF2, height, twist float64) SDF3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  TwistExtrude3D extrudes an SDF2 while rotating by twist radians over the height of the extrusion.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func Union3D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func Union3D(sdf ...SDF3) SDF3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Union3D returns the union of multiple SDF3 objects.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    type ScaleUniformSDF2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    type ScaleUniformSDF2 struct {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    	// contains filtered or unexported fields
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    }

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      ScaleUniformSDF2 scales another SDF2 on each axis.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      func (*ScaleUniformSDF2) BoundingBox

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      func (s *ScaleUniformSDF2) BoundingBox() Box2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        BoundingBox returns the bounding box of an SDF2 with uniform scaling.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func (*ScaleUniformSDF2) Evaluate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func (s *ScaleUniformSDF2) Evaluate(p V2) float64

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Evaluate returns the minimum distance to an SDF2 with uniform scaling.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          type ScaleUniformSDF3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          type ScaleUniformSDF3 struct {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          	// contains filtered or unexported fields
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          }

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ScaleUniformSDF3 is an SDF3 scaled uniformly in XYZ directions.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func (*ScaleUniformSDF3) BoundingBox

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func (s *ScaleUniformSDF3) BoundingBox() Box3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              BoundingBox returns the bounding box of a uniformly scaled SDF3.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func (*ScaleUniformSDF3) Evaluate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func (s *ScaleUniformSDF3) Evaluate(p V3) float64

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Evaluate returns the minimum distance to a uniformly scaled SDF3. The distance is correct with scaling.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                type ScrewSDF3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                type ScrewSDF3 struct {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                	// contains filtered or unexported fields
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                }

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  ScrewSDF3 is a 3d screw form.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func (*ScrewSDF3) BoundingBox

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func (s *ScrewSDF3) BoundingBox() Box3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    BoundingBox returns the bounding box for a 3d screw form.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func (*ScrewSDF3) Evaluate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func (s *ScrewSDF3) Evaluate(p V3) float64

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Evaluate returns the minimum distance to a 3d screw form.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      type SliceSDF2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      type SliceSDF2 struct {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      	// contains filtered or unexported fields
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      }

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        SliceSDF2 creates an SDF2 from a planar slice through an SDF3.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func (*SliceSDF2) BoundingBox

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func (s *SliceSDF2) BoundingBox() Box2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          BoundingBox returns the bounding box of the sliced SDF2.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func (*SliceSDF2) Evaluate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func (s *SliceSDF2) Evaluate(p V2) float64

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Evaluate returns the minimum distance to the sliced SDF2.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            type SorSDF3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            type SorSDF3 struct {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            	// contains filtered or unexported fields
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            }

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              SorSDF3 solid of revolution, SDF2 to SDF3.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func (*SorSDF3) BoundingBox

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func (s *SorSDF3) BoundingBox() Box3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                BoundingBox returns the bounding box for a solid of revolution.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func (*SorSDF3) Evaluate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func (s *SorSDF3) Evaluate(p V3) float64

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Evaluate returns the minimum distance to a solid of revolution.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  type SphereSDF3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  type SphereSDF3 struct {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  	// contains filtered or unexported fields
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  }

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    SphereSDF3 is a sphere.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func (*SphereSDF3) BoundingBox

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func (s *SphereSDF3) BoundingBox() Box3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      BoundingBox returns the bounding box for a sphere.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      func (*SphereSDF3) Evaluate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      func (s *SphereSDF3) Evaluate(p V3) float64

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Evaluate returns the minimum distance to a sphere.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        type Text

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        type Text struct {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        	// contains filtered or unexported fields
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        }

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Text stores a UTF8 string and it's rendering parameters.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func NewText

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func NewText(s string) *Text

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            NewText returns a text object (text and alignment).

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            type ThreadParameters

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            type ThreadParameters struct {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            	Name         string  // name of screw thread
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            	Radius       float64 // nominal major radius of screw
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            	Pitch        float64 // thread to thread distance of screw
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            	HexFlat2Flat float64 // hex head flat to flat distance
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            	Units        string  // "inch" or "mm"
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            }

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ThreadParameters stores the values that define a thread.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func ThreadLookup

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func ThreadLookup(name string) (*ThreadParameters, error)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ThreadLookup lookups the parameters for a thread by name.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func (*ThreadParameters) HexHeight

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func (t *ThreadParameters) HexHeight() float64

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  HexHeight returns the hex head height (empirical).

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func (*ThreadParameters) HexRadius

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func (t *ThreadParameters) HexRadius() float64

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    HexRadius returns the hex head radius.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    type ThreeArcCamSDF2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    type ThreeArcCamSDF2 struct {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    	// contains filtered or unexported fields
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    }

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      ThreeArcCamSDF2 is 2d cam profile. The profile is made from a base circle, a smaller nose circle and circular flank arcs.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      func (*ThreeArcCamSDF2) BoundingBox

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      func (s *ThreeArcCamSDF2) BoundingBox() Box2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        BoundingBox returns the bounding box for the cam.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func (*ThreeArcCamSDF2) Evaluate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func (s *ThreeArcCamSDF2) Evaluate(p V2) float64

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Evaluate returns the minimum distance to the cam.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          type TransformSDF2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          type TransformSDF2 struct {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          	// contains filtered or unexported fields
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          }

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            TransformSDF2 transorms an SDF2 with rotation, translation and scaling.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func (*TransformSDF2) BoundingBox

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func (s *TransformSDF2) BoundingBox() Box2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              BoundingBox returns the bounding box of a transformed SDF2.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func (*TransformSDF2) Evaluate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func (s *TransformSDF2) Evaluate(p V2) float64

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Evaluate returns the minimum distance to a transformed SDF2. Distance is *not* preserved with scaling.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                type TransformSDF3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                type TransformSDF3 struct {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                	// contains filtered or unexported fields
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                }

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  TransformSDF3 is an SDF3 transformed with a 4x4 transformation matrix.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func (*TransformSDF3) BoundingBox

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func (s *TransformSDF3) BoundingBox() Box3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    BoundingBox returns the bounding box of a transformed SDF3.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func (*TransformSDF3) Evaluate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func (s *TransformSDF3) Evaluate(p V3) float64

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Evaluate returns the minimum distance to a transformed SDF3. Distance is *not* preserved with scaling.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      type UnionSDF2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      type UnionSDF2 struct {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      	// contains filtered or unexported fields
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      }

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        UnionSDF2 is a union of multiple SDF2 objects.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func (*UnionSDF2) BoundingBox

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func (s *UnionSDF2) BoundingBox() Box2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          BoundingBox returns the bounding box of an SDF2 union.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func (*UnionSDF2) Evaluate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func (s *UnionSDF2) Evaluate(p V2) float64

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Evaluate returns the minimum distance to the SDF2 union.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func (*UnionSDF2) EvaluateSlow

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func (s *UnionSDF2) EvaluateSlow(p V2) float64

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              EvaluateSlow returns the minimum distance to the SDF2 union.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func (*UnionSDF2) SetMin

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func (s *UnionSDF2) SetMin(min MinFunc)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                SetMin sets the minimum function to control SDF2 blending.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                type UnionSDF3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                type UnionSDF3 struct {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                	// contains filtered or unexported fields
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                }

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  UnionSDF3 is a union of SDF3s.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func (*UnionSDF3) BoundingBox

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func (s *UnionSDF3) BoundingBox() Box3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    BoundingBox returns the bounding box of an SDF3 union.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func (*UnionSDF3) Evaluate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func (s *UnionSDF3) Evaluate(p V3) float64

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Evaluate returns the minimum distance to an SDF3 union.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      func (*UnionSDF3) SetMin

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      func (s *UnionSDF3) SetMin(min MinFunc)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        SetMin sets the minimum function to control blending.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        type V2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        type V2 struct {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        	X, Y float64
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        }

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          V2 is a 2d float64 cartesian vector.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func NormalExtrude

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func NormalExtrude(p V3) V2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            NormalExtrude returns an extrusion function.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func PolarToXY

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func PolarToXY(r, theta float64) V2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              PolarToXY converts polar to cartesian coordinates. (TODO remove)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func (V2) Abs

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func (a V2) Abs() V2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Abs takes the absolute value of each vector component.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func (V2) Add

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func (a V2) Add(b V2) V2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Add adds two vectors. Returns a + b.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func (V2) AddScalar

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func (a V2) AddScalar(b float64) V2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    AddScalar adds a scalar to each vector component.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func (V2) CartesianToPolar

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func (a V2) CartesianToPolar() P2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      CartesianToPolar converts a cartesian to a polar coordinate.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      func (V2) Ceil

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      func (a V2) Ceil() V2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Ceil takes the ceiling value of each vector component.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func (V2) Clamp

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func (a V2) Clamp(b, c V2) V2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Clamp clamps a vector between 2 other vectors.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func (V2) Cross

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func (a V2) Cross(b V2) float64

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Cross returns the cross product of a and b.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func (V2) Div

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func (a V2) Div(b V2) V2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Div divides two vectors by component.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func (V2) DivScalar

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func (a V2) DivScalar(b float64) V2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                DivScalar divides each vector component by a scalar.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func (V2) Dot

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func (a V2) Dot(b V2) float64

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Dot returns the dot product of a and b.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func (V2) Equals

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func (a V2) Equals(b V2, tolerance float64) bool

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Equals returns true if a == b within the tolerance limit.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func (V2) LTEZero

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func (a V2) LTEZero() bool

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      LTEZero returns true if any vector components are < 0.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      func (V2) LTZero

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      func (a V2) LTZero() bool

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        LTZero returns true if any vector components are < 0.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func (V2) Length

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func (a V2) Length() float64

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Length returns the vector length.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func (V2) Length2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func (a V2) Length2() float64

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Length2 returns the vector length * length.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func (V2) Max

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func (a V2) Max(b V2) V2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Max return a vector with the maximum components of two vectors.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func (V2) MaxComponent

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func (a V2) MaxComponent() float64

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                MaxComponent returns the maximum component of the vector.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func (V2) Min

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func (a V2) Min(b V2) V2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Min return a vector with the minimum components of two vectors.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func (V2) MinComponent

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func (a V2) MinComponent() float64

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    MinComponent returns the minimum component of the vector.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func (V2) Mul

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func (a V2) Mul(b V2) V2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Mul multiplies two vectors by component.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      func (V2) MulScalar

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      func (a V2) MulScalar(b float64) V2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        MulScalar multiplies each vector component by a scalar.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func (V2) Neg

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func (a V2) Neg() V2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Neg negates a vector.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func (V2) Normalize

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func (a V2) Normalize() V2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Normalize scales a vector to unit length.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func (V2) Overlap

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func (a V2) Overlap(b V2) bool

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Overlap returns true if 1D line segments a and b overlap.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func (V2) Sub

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func (a V2) Sub(b V2) V2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Sub subtracts two vectors. Returns a - b.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func (V2) SubScalar

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func (a V2) SubScalar(b float64) V2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  SubScalar subtracts a scalar from each vector component.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func (V2) ToV2i

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func (a V2) ToV2i() V2i

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ToV2i convert V2 (float) to V2i (integer).

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func (V2) ToV3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func (a V2) ToV3(z float64) V3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      ToV3 converts a V2 to a V3 with a specified Z value.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      type V2Set

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      type V2Set []V2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        V2Set is a set of 2d float64 vectors.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func GenerateMesh2D

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func GenerateMesh2D(s SDF2, grid V2i) (V2Set, error)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          GenerateMesh2D generates a set of internal mesh points for an SDF2.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func Nagon

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func Nagon(n int, radius float64) V2Set

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Nagon return the vertices of a N sided regular polygon.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func (V2Set) Max

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func (a V2Set) Max() V2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Max return the maximum components of a set of vectors.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func (V2Set) Min

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func (a V2Set) Min() V2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Min return the minimum components of a set of vectors.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func (V2Set) MulVertices

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func (v V2Set) MulVertices(a M33)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  MulVertices multiples a set of V2 vertices by a rotate/translate matrix.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  type V2SetByX

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  type V2SetByX V2Set

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    V2SetByX used to sort V2Set by X-value.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func (V2SetByX) Len

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func (a V2SetByX) Len() int

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func (V2SetByX) Less

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func (a V2SetByX) Less(i, j int) bool

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func (V2SetByX) Swap

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func (a V2SetByX) Swap(i, j int)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    type V2i

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    type V2i [2]int

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      V2i is a 2D integer vector.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      func (V2i) Add

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      func (a V2i) Add(b V2i) V2i

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Add adds two vectors. Return v = a + b.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func (V2i) AddScalar

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func (a V2i) AddScalar(b int) V2i

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          AddScalar adds a scalar to each component of the vector.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func (V2i) SubScalar

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func (a V2i) SubScalar(b int) V2i

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            SubScalar subtracts a scalar from each component of the vector.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func (V2i) ToV2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func (a V2i) ToV2() V2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ToV2 converts V2i (integer) to V2 (float).

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              type V3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              type V3 struct {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              	X, Y, Z float64
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              }

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                V3 is a 3d float64 cartesian vector.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func (V3) Abs

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func (a V3) Abs() V3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Abs takes the absolute value of each vector component.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func (V3) Add

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func (a V3) Add(b V3) V3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Add adds two vectors. Returns a + b.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func (V3) AddScalar

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func (a V3) AddScalar(b float64) V3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      AddScalar adds a scalar to each vector component.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      func (V3) Ceil

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      func (a V3) Ceil() V3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Ceil takes the ceiling value of each vector component.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func (V3) Clamp

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func (a V3) Clamp(b, c V3) V3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Clamp clamps a vector between 2 other vectors.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func (V3) Cross

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func (a V3) Cross(b V3) V3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Cross returns the cross product of a and b.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func (V3) Div

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func (a V3) Div(b V3) V3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Div divides two vectors by component.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func (V3) DivScalar

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func (a V3) DivScalar(b float64) V3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                DivScalar divides each vector component by a scalar.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func (V3) Dot

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func (a V3) Dot(b V3) float64

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Dot returns the dot product of a and b.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func (V3) Equals

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func (a V3) Equals(b V3, tolerance float64) bool

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Equals returns true if a == b within the tolerance limit.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func (V3) LTEZero

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func (a V3) LTEZero() bool

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      LTEZero returns true if any vector components are <= 0.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      func (V3) LTZero

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      func (a V3) LTZero() bool

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        LTZero returns true if any vector components are < 0.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func (V3) Length

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func (a V3) Length() float64

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Length returns the vector length.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func (V3) Length2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func (a V3) Length2() float64

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Length2 returns the vector length * length.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func (V3) Max

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func (a V3) Max(b V3) V3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Max return a vector with the maximum components of two vectors.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func (V3) MaxComponent

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func (a V3) MaxComponent() float64

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                MaxComponent returns the maximum component of the vector.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func (V3) Min

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func (a V3) Min(b V3) V3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Min return a vector with the minimum components of two vectors.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func (V3) MinComponent

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func (a V3) MinComponent() float64

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    MinComponent returns the minimum component of the vector.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func (V3) Mul

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func (a V3) Mul(b V3) V3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Mul multiplies two vectors by component.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      func (V3) MulScalar

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      func (a V3) MulScalar(b float64) V3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        MulScalar multiplies each vector component by a scalar.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func (V3) Neg

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func (a V3) Neg() V3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Neg negates a vector.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func (V3) Normalize

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func (a V3) Normalize() V3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Normalize scales a vector to unit length.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func (V3) RotateToVector

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            func (a V3) RotateToVector(b V3) M44

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              RotateToVector returns the rotation matrix that transforms a onto the same direction as b.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func (V3) Sub

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func (a V3) Sub(b V3) V3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Sub subtracts two vectors. Returns a - b.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func (V3) SubScalar

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func (a V3) SubScalar(b float64) V3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  SubScalar subtracts a scalar from each vector component.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func (V3) ToV3i

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func (a V3) ToV3i() V3i

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ToV3i convert V3 (float) to V3i (integer).

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    type V3Set

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    type V3Set []V3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      V3Set is a set of 3d float64 vectors.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      func (V3Set) Max

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      func (a V3Set) Max() V3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Max return the maximum components of a set of vectors.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func (V3Set) Min

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        func (a V3Set) Min() V3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Min return the minimum components of a set of vectors.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func (V3Set) MulVertices

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          func (v V3Set) MulVertices(a M44)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            MulVertices multiples a set of V3 vertices by a rotate/translate matrix.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            type V3i

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            type V3i [3]int

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              V3i is a 3D integer vector.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func (V3i) Add

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              func (a V3i) Add(b V3i) V3i

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Add adds two vectors. Return v = a + b.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func (V3i) AddScalar

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                func (a V3i) AddScalar(b int) V3i

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  AddScalar adds a scalar to each component of the vector.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func (V3i) SubScalar

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  func (a V3i) SubScalar(b int) V3i

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    SubScalar subtracts a scalar from each component of the vector.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func (V3i) ToV3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    func (a V3i) ToV3() V3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      ToV3 converts V3i (integer) to V3 (float).