must2

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 7, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InchesPerMillimetre = 1. / 25.4
)

Variables

This section is empty.

Functions

func ANSIButtressThread

func ANSIButtressThread(radius float64, pitch float64) sdf.SDF2

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

func AcmeThread

func AcmeThread(radius float64, pitch float64) sdf.SDF2

AcmeThread returns the 2d profile for an acme thread. radius is radius of thread. pitch is thread-to-thread distance.

func Box

func Box(size r2.Vec, round float64) *box

Box returns a 2d box.

func Circle

func Circle(radius float64) *circle

Circle returns the SDF2 for a 2d circle.

func ErrMsg

func ErrMsg(msg string) error

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

func ISOThread

func ISOThread(radius float64, pitch float64, external bool) sdf.SDF2

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 radius is radius of thread. pitch is thread-to-thread distance. external (or internal) thread

func Line

func Line(l, round float64) *line

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

func Nagon

func Nagon(n int, radius float64) d2.Set

Nagon return the vertices of a N sided regular polygon.

func PlasticButtressThread

func PlasticButtressThread(radius float64, pitch float64) sdf.SDF2

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

func Polygon

func Polygon(vertex []r2.Vec) sdf.SDF2

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

func Sign

func Sign(f float64) float64

Sign do not use function Deprecated: do not use.

Types

type PolygonBuilder

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

PolygonBuilder stores a set of 2d polygon vertices.

func NewPolygon

func NewPolygon() *PolygonBuilder

NewPolygon returns an empty polygon.

func (*PolygonBuilder) Add

func (p *PolygonBuilder) Add(x, y float64) *polygonVertex

Add an x,y vertex to a polygon.

func (*PolygonBuilder) AddV2

func (p *PolygonBuilder) AddV2(x r2.Vec) *polygonVertex

AddV2 adds a V2 vertex to a polygon.

func (*PolygonBuilder) AddV2Set

func (p *PolygonBuilder) AddV2Set(x []r2.Vec)

AddV2Set adds a set of V2 vertices to a polygon.

func (*PolygonBuilder) Close

func (p *PolygonBuilder) Close()

Close closes the polygon.

func (*PolygonBuilder) Closed

func (p *PolygonBuilder) Closed() bool

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

func (*PolygonBuilder) Drop

func (p *PolygonBuilder) Drop()

Drop the last vertex from the list.

func (*PolygonBuilder) Reverse

func (p *PolygonBuilder) Reverse()

Reverse reverses the order the vertices are returned.

func (*PolygonBuilder) Vertices

func (p *PolygonBuilder) Vertices() []r2.Vec

Vertices returns the vertices of the polygon.

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
	Taper        float64 // thread taper (radians)
	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.

Jump to

Keyboard shortcuts

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