tool

package
v0.0.0-...-752f67b Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanLibraryCache

func CleanLibraryCache() error

CleanLibraryCache compares the libraries on disk to the ones we have configured. It then removes any on disk from the cache that aren't present in the config.

If there are any libaries in the config that don't exist on disk, they are removed from the config.

func ImportLibrary

func ImportLibrary(name, path string) error

func IsValidLibrary

func IsValidLibrary(path string) bool

Types

type CuttingData

type CuttingData struct {
	GUID              string
	Name              string
	FeedPerRevolution float64 `json:"f_n"`
	FeedPerTooth      float64 `json:"f_z"`
	SpindleSpeed      float64 `json:"n"`
	RampSpindleSpeed  float64 `json:"n_ramp"`
	ToolCoolant       string  `json:"tool-coolant"`
	UseStepdown       bool    `json:"use-stepdown"`
	UseStepover       bool    `json:"use-stepover"`
	SurfaceSpeed      float64 `json:"v_c"`
	CuttingFeedrate   float64 `json:"v_f"`
	LeadInFeedrate    float64 `json:"v_f_leadIn"`
	LeadOutFeedrate   float64 `json:"v_f_leadOut"`
	PlungeFeedrate    float64 `json:"v_f_plunge"`
	RampFeedrate      float64 `json:"v_f_ramp"`
}

type Endmill

type Endmill int
const (
	EndmillUnknown        Endmill = iota
	EndmillBall                   // Ball end mill
	EndmillBullNose               // Bull nose end mill
	EndmillEngraveChamfer         // Engrave/Chamfer mill
	EndmillDovetail               // Dovetail mill
	EndmillFace                   // Face mill
	EndmillFlat                   // Flat end mill
	EndmillForm                   // Form mill
	EndmillLollipop               // Lollipop mill
	EndmillRadius                 // Radius mill
	EndmillSlot                   // Slot mill
	EndmillTapered                // Tapered mill
	EndmillThread                 // Thread mill
)

func (*Endmill) FromString

func (t *Endmill) FromString(value string) Endmill

func (Endmill) MarshalJSON

func (t Endmill) MarshalJSON() ([]byte, error)

func (Endmill) String

func (i Endmill) String() string

func (*Endmill) UnmarshalJSON

func (t *Endmill) UnmarshalJSON(b []byte) error

type Library

type Library struct {
	Tools   []Tool `json:"data"`
	Version int    `json:"version"`
}

func LoadLibrary

func LoadLibrary(path string) (Library, error)

func (Library) FindByNumber

func (l Library) FindByNumber(n int) (Tool, error)

type Material

type Material int
const (
	MaterialUnknown  Material = iota // Unspecified
	MaterialHSS                      // HSS
	MaterialCarbide                  // Carbide
	MaterialTICoated                 // TI Coated
	MaterialCeramics                 // Ceramics
)

func (*Material) FromString

func (t *Material) FromString(value string) Material

func (Material) MarshalJSON

func (t Material) MarshalJSON() ([]byte, error)

func (Material) String

func (i Material) String() string

func (*Material) UnmarshalJSON

func (t *Material) UnmarshalJSON(b []byte) error

type Tool

type Tool struct {
	Material     Material `json:"BMC"`
	Description  string   `json:"description"`
	GUID         string   `json:"guid"`
	LastModified int      `json:"last_modified"`
	PostProcess  struct {
		BreakControl     bool   `json:"break-control"`
		Comment          string `json:"comment"`
		DiameterOffset   int    `json:"diameter-offset"`
		LengthOffset     int    `json:"length-offset"`
		Live             bool   `json:"live"`
		ManualToolChange bool   `json:"manual-tool-change"`
		Number           int    `json:"number"`
		Turret           int    `json:"turret"`
	} `json:"post-process"`
	ProductID     string `json:"product-id"`
	ProductLink   string `json:"product-link"`
	ReferenceGUID string `json:"reference_guid"`
	StartValues   struct {
		Presets []CuttingData `json:"presets"`
	} `json:"start-values"`
	Vendor   string  `json:"vendor"`
	Type     Endmill `json:"type"`
	Unit     string  `json:"unit"`
	Geometry struct {
		Diameter                 float64 `json:"DC"`
		ShaftDiameter            float64 `json:"SFDM"`
		OverallLength            float64 `json:"OAL"`
		LengthBelowHolder        float64 `json:"LB"`
		ShoulderLength           float64 `json:"shoulder-length"`
		FluteLength              float64 `json:"LCF"`
		FluteCount               int     `json:"NOF"`
		CounterClockwiseRotation bool    `json:"HAND"`
	} `json:"geometry"`
	Shaft struct {
		Segments []struct {
			Height        float64 `json:"height"`
			UpperDiamater float64 `json:"upper-diamater"`
			LowerDiameter float64 `json:"lower-diameter"`
		} `json:"segments"`
		Type string `json:"type"`
	} `json:"shaft"`
}

func (Tool) Number

func (t Tool) Number() int

Jump to

Keyboard shortcuts

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