obj2

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: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// InchesPerMillimetre is inches per millimetre
	InchesPerMillimetre = 1.0 / millimetresPerInch
)

2D Panel with rounded corners and edge holes.

Note: The hole pattern is used to layout multiple holes along an edge.

Examples:

"x" - single hole on edge "xx" - two holes on edge "x.x" = two holes on edge with spacing "xx.x.xx" = five holes on edge with spacing etc.

Variables

This section is empty.

Functions

func EuroRackPanel

func EuroRackPanel(k EuroRackParams) (s sdf.SDF2, err error)

EuroRackPanel returns a 2d eurorack synthesizer module panel (in mm).

func Panel

func Panel(k PanelParams) (s sdf.SDF2, err error)

Panel returns a 2d panel with holes on the edges.

Types

type EuroRackParams

type EuroRackParams struct {
	U            float64 // U-size (vertical)
	HP           float64 // HP-size (horizontal)
	CornerRadius float64 // radius of panel corners
	HoleDiameter float64 // panel holes (0 for default)
	Thickness    float64 // panel thickness (3d only)
	Ridge        bool    // add side ridges for reinforcing (3d only)
}

EuroRackParams defines the parameters for a eurorack panel.

func (EuroRackParams) HPSize

func (k EuroRackParams) HPSize() float64

func (EuroRackParams) USize

func (k EuroRackParams) USize() float64

type PanelParams

type PanelParams struct {
	Size         r2.Vec     // size of the panel
	CornerRadius float64    // radius of rounded corners
	HoleDiameter float64    // diameter of panel holes
	HoleMargin   [4]float64 // hole margins for top, right, bottom, left
	HolePattern  [4]string  // hole pattern for top, right, bottom, left
	Thickness    float64    // panel thickness (3d only)
}

PanelParams defines the parameters for a 2D panel.

Jump to

Keyboard shortcuts

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