Documentation ¶
Index ¶
- Constants
- func ANSIButtressThread(radius float64, pitch float64) sdf.SDF2
- func AcmeThread(radius float64, pitch float64) sdf.SDF2
- func Box(size r2.Vec, round float64) *box
- func Circle(radius float64) *circle
- func ErrMsg(msg string) error
- func ISOThread(radius float64, pitch float64, external bool) sdf.SDF2
- func Line(l, round float64) *line
- func Nagon(n int, radius float64) d2.Set
- func PlasticButtressThread(radius float64, pitch float64) sdf.SDF2
- func Polygon(vertex []r2.Vec) sdf.SDF2
- func Sign(f float64) float64
- type PolygonBuilder
- func (p *PolygonBuilder) Add(x, y float64) *polygonVertex
- func (p *PolygonBuilder) AddV2(x r2.Vec) *polygonVertex
- func (p *PolygonBuilder) AddV2Set(x []r2.Vec)
- func (p *PolygonBuilder) Close()
- func (p *PolygonBuilder) Closed() bool
- func (p *PolygonBuilder) Drop()
- func (p *PolygonBuilder) Reverse()
- func (p *PolygonBuilder) Vertices() []r2.Vec
- type ThreadParameters
Constants ¶
const (
InchesPerMillimetre = 1. / 25.4
)
Variables ¶
This section is empty.
Functions ¶
func ANSIButtressThread ¶
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 ¶
AcmeThread returns the 2d profile for an acme thread. radius is radius of thread. pitch is thread-to-thread distance.
func ISOThread ¶
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 PlasticButtressThread ¶
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.
Types ¶
type PolygonBuilder ¶
type PolygonBuilder struct {
// contains filtered or unexported fields
}
PolygonBuilder stores a set of 2d polygon vertices.
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) Closed ¶
func (p *PolygonBuilder) Closed() bool
Closed returns true/fale if the polygon is closed/open.
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.