Documentation ¶
Index ¶
- func Bolt(k BoltParms) (s sdf.SDF3, err error)
- func HexHead(radius float64, height float64, round string) (s sdf.SDF3, err error)
- func Knurl(k KnurlParams) (s sdf.SDF3, err error)
- func KnurledHead(radius float64, height float64, pitch float64) (s sdf.SDF3, err error)
- func Nut(k NutParms) (s sdf.SDF3, err error)
- func Screw(length float64, thread Threader) (sdf.SDF3, error)
- type ANSIButtress
- type Acme
- type BoltParms
- type ISO
- type KnurlParams
- type NPT
- type NutParms
- type NutStyle
- type Parameters
- type PlasticButtress
- type ScrewParameters
- type Threader
- type UTS
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HexHead ¶
HexHead3D returns the rounded hex head for a nut or bolt. - round rounding control (t)top, (b)bottom, (tb)top/bottom
func KnurledHead ¶
KnurledHead returns a generic cylindrical knurled head.
Types ¶
type ANSIButtress ¶
type ANSIButtress struct { // D is the thread nominal diameter. D float64 // P is the thread pitch. P float64 }
func (ANSIButtress) Thread ¶
func (ansi ANSIButtress) Thread() (sdf.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 radius is radius of thread. pitch is thread-to-thread distance.
func (ANSIButtress) ThreadParams ¶
func (butt ANSIButtress) ThreadParams() Parameters
type Acme ¶
type Acme struct { // D is the thread nominal diameter. D float64 // P is the thread pitch. P float64 }
Acme is a trapezoidal thread form. https://en.wikipedia.org/wiki/Trapezoidal_thread_form
func (Acme) Thread ¶
AcmeThread returns the 2d profile for an acme thread. radius is radius of thread. pitch is thread-to-thread distance.
func (Acme) ThreadParams ¶
func (acme Acme) ThreadParams() Parameters
type BoltParms ¶
type BoltParms struct { Thread Threader Style NutStyle // head style "hex" or "knurl" Tolerance float64 // subtract from external thread radius TotalLength float64 // threaded length + shank length ShankLength float64 // non threaded length }
BoltParms defines the parameters for a bolt.
type ISO ¶
type ISO struct { // D is the thread nominal diameter [mm]. D float64 // P is the thread pitch [mm]. P float64 // Is external or internal thread. Ext set to true means external thread. Ext bool }
ISO is a standardized thread. Pitch is usually the number following the diameter i.e: for M16x2 the pitch is 2mm
func (ISO) ThreadParams ¶
func (iso ISO) ThreadParams() Parameters
type KnurlParams ¶
type KnurlParams struct { Length float64 // length of cylinder Radius float64 // radius of cylinder Pitch float64 // knurl pitch Height float64 // knurl height Theta float64 // knurl helix angle // contains filtered or unexported fields }
KnurlParams specifies the knurl parameters.
func (KnurlParams) Thread ¶
func (k KnurlParams) Thread() (sdf.SDF2, error)
Thread implements the Threader interface.
func (KnurlParams) ThreadParams ¶
func (k KnurlParams) ThreadParams() Parameters
Parameters implements the Threader interface.
type NPT ¶
type NPT struct { // D is the thread nominal diameter. D float64 // threads per inch. 1.0/TPI gives pitch. TPI float64 // Flat-to-flat hex distance. // Can be set by SetFromNominal with a standard value. F2F float64 }
func (*NPT) SetFromNominal ¶
SetFromNominal sets NPT thread dimensions from a nominal measurement which usually takes the form of inch fractions. i.e:
npt.SetFromNominal(1.0/8.0) // sets NPT 1/8
func (NPT) ThreadParams ¶
func (npt NPT) ThreadParams() Parameters
type NutParms ¶
type NutParms struct { Thread Threader Style NutStyle Tolerance float64 // add to internal thread radius }
NutParms defines the parameters for a nut.
type Parameters ¶
type Parameters struct { Name string // name of screw thread Radius float64 // nominal major radius of screw Pitch float64 // thread to thread distance of screw Starts int // number of threads Taper float64 // thread taper (radians) HexF2F float64 // hex head flat to flat distance }
func (Parameters) HexHeight ¶
func (t Parameters) HexHeight() float64
HexHeight returns the hex head height (empirical).
func (Parameters) HexRadius ¶
func (t Parameters) HexRadius() float64
HexRadius returns the hex head radius.
type PlasticButtress ¶
type PlasticButtress struct { // D is the thread nominal diameter. D float64 // P is the thread pitch. P float64 }
func (PlasticButtress) Thread ¶
func (butt PlasticButtress) Thread() (sdf.SDF2, error)
Thread 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 (PlasticButtress) ThreadParams ¶
func (butt PlasticButtress) ThreadParams() Parameters
type ScrewParameters ¶
type UTS ¶
Unified thread standard. Example: UNC 1/4 with external threading would be
UTS{D:1.0/4.0, TPI:20, Ext: true}
func (UTS) ThreadParams ¶
func (uts UTS) ThreadParams() Parameters