Documentation
¶
Overview ¶
Implementation of OpenSCAD primitives. Everything here mostly follows the naming and defaults as defined here: https://openscad.org/cheatsheet/ Additionally, the following new primitives have been added: Anchor, Custom, List, Nothing. These are documented here.
Index ¶
- type Anchor
- type Circular
- type Color
- type Cube
- type Custom
- type Cylinder
- func (o *Cylinder) Disable() Primitive
- func (o *Cylinder) Highlight() Primitive
- func (o *Cylinder) Prefix() string
- func (o *Cylinder) Render(w *bufio.Writer)
- func (o *Cylinder) SetCenter(val bool) *Cylinder
- func (o *Cylinder) SetFa(val float64) *Cylinder
- func (o *Cylinder) SetFn(val uint16) *Cylinder
- func (o *Cylinder) SetFs(val float64) *Cylinder
- func (o *Cylinder) SetRBottom(val float64) *Cylinder
- func (o *Cylinder) ShowOnly() Primitive
- func (o *Cylinder) Transparent() Primitive
- type Import
- func (o *Import) Disable() Primitive
- func (o *Import) Highlight() Primitive
- func (o *Import) Prefix() string
- func (o *Import) Render(w *bufio.Writer)
- func (o *Import) SetConvexity(val int) *Import
- func (o *Import) SetLayer(val string) *Import
- func (o *Import) ShowOnly() Primitive
- func (o *Import) Transparent() Primitive
- type LinearExtrusion
- func (o *LinearExtrusion) Add(items ...Primitive) *LinearExtrusion
- func (o *LinearExtrusion) Disable() Primitive
- func (o *LinearExtrusion) Highlight() Primitive
- func (o *LinearExtrusion) Prefix() string
- func (o *LinearExtrusion) Render(w *bufio.Writer)
- func (o *LinearExtrusion) SetCenter(val bool) *LinearExtrusion
- func (o *LinearExtrusion) SetConvexity(val uint16) *LinearExtrusion
- func (o *LinearExtrusion) SetFn(val uint16) *LinearExtrusion
- func (o *LinearExtrusion) SetScale(val float64) *LinearExtrusion
- func (o *LinearExtrusion) SetSlices(val uint16) *LinearExtrusion
- func (o *LinearExtrusion) SetTwist(val uint16) *LinearExtrusion
- func (o *LinearExtrusion) ShowOnly() Primitive
- func (o *LinearExtrusion) Transparent() Primitive
- type List
- type ListOp
- type Mirror
- type Nothing
- type Offset
- func (o *Offset) Add(items ...Primitive) *Offset
- func (o *Offset) Disable() Primitive
- func (o *Offset) Highlight() Primitive
- func (o *Offset) Prefix() string
- func (o *Offset) Render(w *bufio.Writer)
- func (o *Offset) SetChamfer(val bool) *Offset
- func (o *Offset) SetDelta(val float64) *Offset
- func (o *Offset) SetR(val float64) *Offset
- func (o *Offset) ShowOnly() Primitive
- func (o *Offset) Transparent() Primitive
- type ParentImpl
- type Polygon
- func (o *Polygon) Disable() Primitive
- func (o *Polygon) Highlight() Primitive
- func (o *Polygon) Prefix() string
- func (o *Polygon) Render(w *bufio.Writer)
- func (o *Polygon) SetConvexity(val int) *Polygon
- func (o *Polygon) SetPaths(val [][]int) *Polygon
- func (o *Polygon) ShowOnly() Primitive
- func (o *Polygon) Transparent() Primitive
- type Polyhedron
- func (o *Polyhedron) Disable() Primitive
- func (o *Polyhedron) Highlight() Primitive
- func (o *Polyhedron) Prefix() string
- func (o *Polyhedron) Render(w *bufio.Writer)
- func (o *Polyhedron) SetConvexity(val int) *Polyhedron
- func (o *Polyhedron) ShowOnly() Primitive
- func (o *Polyhedron) Transparent() Primitive
- type Primitive
- type Render
- type RotationExtrusion
- func (o *RotationExtrusion) Add(items ...Primitive) *RotationExtrusion
- func (o *RotationExtrusion) Disable() Primitive
- func (o *RotationExtrusion) Highlight() Primitive
- func (o *RotationExtrusion) Prefix() string
- func (o *RotationExtrusion) Render(w *bufio.Writer)
- func (o *RotationExtrusion) SetAngle(val float64) *RotationExtrusion
- func (o *RotationExtrusion) SetConvexity(val uint16) *RotationExtrusion
- func (o *RotationExtrusion) SetFa(val float64) *RotationExtrusion
- func (o *RotationExtrusion) SetFn(val uint16) *RotationExtrusion
- func (o *RotationExtrusion) SetFs(val float64) *RotationExtrusion
- func (o *RotationExtrusion) ShowOnly() Primitive
- func (o *RotationExtrusion) Transparent() Primitive
- type Scale
- type Sphere
- func (o *Sphere) Disable() Primitive
- func (o *Sphere) Highlight() Primitive
- func (o *Sphere) Prefix() string
- func (o *Sphere) Render(w *bufio.Writer)
- func (o *Sphere) SetFa(val float64) *Sphere
- func (o *Sphere) SetFn(val uint16) *Sphere
- func (o *Sphere) SetFs(val float64) *Sphere
- func (o *Sphere) ShowOnly() Primitive
- func (o *Sphere) Transparent() Primitive
- type Square
- type Surface
- func (o *Surface) Disable() Primitive
- func (o *Surface) Highlight() Primitive
- func (o *Surface) Prefix() string
- func (o *Surface) Render(w *bufio.Writer)
- func (o *Surface) SetCenter(val bool) *Surface
- func (o *Surface) SetConvexity(val int) *Surface
- func (o *Surface) SetInvert(val bool) *Surface
- func (o *Surface) ShowOnly() Primitive
- func (o *Surface) Transparent() Primitive
- type Text
- func (o *Text) Disable() Primitive
- func (o *Text) Highlight() Primitive
- func (o *Text) Prefix() string
- func (o *Text) Render(w *bufio.Writer)
- func (o *Text) SetDirection(val string) *Text
- func (o *Text) SetFn(val uint16) *Text
- func (o *Text) SetFont(val string) *Text
- func (o *Text) SetHalign(val string) *Text
- func (o *Text) SetLanguage(val string) *Text
- func (o *Text) SetScript(val string) *Text
- func (o *Text) SetSize(val uint16) *Text
- func (o *Text) SetSpacing(val uint16) *Text
- func (o *Text) SetValign(val string) *Text
- func (o *Text) ShowOnly() Primitive
- func (o *Text) Transparent() Primitive
- type Transform
- func (o *Transform) Add(items ...Primitive) *Transform
- func (o *Transform) Append(t *Transform)
- func (o *Transform) Disable() Primitive
- func (o *Transform) Highlight() Primitive
- func (o *Transform) Inverse() *Transform
- func (o *Transform) Prefix() string
- func (o *Transform) Render(w *bufio.Writer)
- func (o *Transform) ShowOnly() Primitive
- func (o *Transform) Transparent() Primitive
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Anchor ¶
type Anchor struct { ParentImpl // contains filtered or unexported fields }
Anchor enables easy tracking of transforms and enables the alignment of reference frames. This is useful when you need to create or use complex objects that need to be put together in complex ways.
func (*Anchor) Transparent ¶
type Color ¶
type Color struct { ParentImpl Color string Items *List "forward:Add" // contains filtered or unexported fields }
func (*Color) Transparent ¶
type Cube ¶
type Cube struct { ParentImpl Dims Vec3 Center bool "optional" // contains filtered or unexported fields }
func (*Cube) Transparent ¶
type Custom ¶
type Custom struct { ParentImpl Code string // contains filtered or unexported fields }
Custom allows you to render arbitrary code in the filal SCAD file.
func (*Custom) Transparent ¶
type Cylinder ¶
type Cylinder struct { ParentImpl H float64 RTop float64 RBottom float64 "optional" Center bool "optional" Circular *Circular "forward:SetFa,SetFs,SetFn" // contains filtered or unexported fields }
func NewCylinder ¶
func (*Cylinder) SetRBottom ¶
func (*Cylinder) Transparent ¶
type Import ¶
type Import struct { ParentImpl File string Convexity int "optional" Layer string "optional" // contains filtered or unexported fields }
func (*Import) SetConvexity ¶
func (*Import) Transparent ¶
type LinearExtrusion ¶
type LinearExtrusion struct { ParentImpl Height float64 Center bool "optional" Convexity uint16 "optional" Twist uint16 "optional" Slices uint16 "optional" Scale float64 "optional" Fn uint16 "optional" Items *List "forward:Add" // contains filtered or unexported fields }
func NewLinearExtrusion ¶
func NewLinearExtrusion(height float64, items ...Primitive) *LinearExtrusion
func (*LinearExtrusion) Add ¶
func (o *LinearExtrusion) Add(items ...Primitive) *LinearExtrusion
func (*LinearExtrusion) Disable ¶
func (o *LinearExtrusion) Disable() Primitive
func (*LinearExtrusion) Highlight ¶
func (o *LinearExtrusion) Highlight() Primitive
func (*LinearExtrusion) Prefix ¶
func (o *LinearExtrusion) Prefix() string
func (*LinearExtrusion) Render ¶
func (o *LinearExtrusion) Render(w *bufio.Writer)
func (*LinearExtrusion) SetCenter ¶
func (o *LinearExtrusion) SetCenter(val bool) *LinearExtrusion
func (*LinearExtrusion) SetConvexity ¶
func (o *LinearExtrusion) SetConvexity(val uint16) *LinearExtrusion
func (*LinearExtrusion) SetFn ¶
func (o *LinearExtrusion) SetFn(val uint16) *LinearExtrusion
func (*LinearExtrusion) SetScale ¶
func (o *LinearExtrusion) SetScale(val float64) *LinearExtrusion
func (*LinearExtrusion) SetSlices ¶
func (o *LinearExtrusion) SetSlices(val uint16) *LinearExtrusion
func (*LinearExtrusion) SetTwist ¶
func (o *LinearExtrusion) SetTwist(val uint16) *LinearExtrusion
func (*LinearExtrusion) ShowOnly ¶
func (o *LinearExtrusion) ShowOnly() Primitive
func (*LinearExtrusion) Transparent ¶
func (o *LinearExtrusion) Transparent() Primitive
type List ¶
type List struct { ParentImpl Items []Primitive // contains filtered or unexported fields }
List groups operations. It renders curly brackets in the SCAD file.
func (*List) Transparent ¶
type ListOp ¶
type ListOp struct { ParentImpl Items *List "forward:Add" // contains filtered or unexported fields }
func NewDifference ¶
func NewIntersection ¶
func NewMinkowski ¶
func (*ListOp) Transparent ¶
type Mirror ¶ added in v0.2.2
type Mirror struct { ParentImpl Mirror Vec3 Items *List "forward:Add" // contains filtered or unexported fields }
func (*Mirror) Transparent ¶ added in v0.2.2
type Nothing ¶
type Nothing struct { ParentImpl // contains filtered or unexported fields }
Nothing is a NULL node. It renders a comment in the SCAD file.
func NewNothing ¶
func NewNothing() *Nothing
func (*Nothing) Transparent ¶
type Offset ¶
type Offset struct { ParentImpl R float64 "optional" Delta float64 "optional" Chamfer bool "optional" Items *List "forward:Add" // contains filtered or unexported fields }
func (*Offset) SetChamfer ¶
func (*Offset) Transparent ¶
type ParentImpl ¶
type ParentImpl struct {
// contains filtered or unexported fields
}
func (*ParentImpl) Parent ¶
func (o *ParentImpl) Parent() Primitive
func (*ParentImpl) SetParent ¶
func (o *ParentImpl) SetParent(p Primitive)
type Polygon ¶
type Polygon struct { ParentImpl Points []Vec2 Paths [][]int "optional" Convexity int "optional" // contains filtered or unexported fields }
func NewPolygon ¶
func NewPolygon(points []Vec2) *Polygon
func (*Polygon) SetConvexity ¶
func (*Polygon) Transparent ¶
type Polyhedron ¶
type Polyhedron struct { ParentImpl Points []Vec3 Faces []Vec3 Convexity int "optional" // contains filtered or unexported fields }
func NewPolyhedron ¶
func NewPolyhedron(points []Vec3, faces []Vec3) *Polyhedron
func (*Polyhedron) Disable ¶
func (o *Polyhedron) Disable() Primitive
func (*Polyhedron) Highlight ¶
func (o *Polyhedron) Highlight() Primitive
func (*Polyhedron) Prefix ¶
func (o *Polyhedron) Prefix() string
func (*Polyhedron) Render ¶
func (o *Polyhedron) Render(w *bufio.Writer)
func (*Polyhedron) SetConvexity ¶
func (o *Polyhedron) SetConvexity(val int) *Polyhedron
func (*Polyhedron) ShowOnly ¶
func (o *Polyhedron) ShowOnly() Primitive
func (*Polyhedron) Transparent ¶
func (o *Polyhedron) Transparent() Primitive
type Render ¶
type Render struct { ParentImpl Convexity uint16 Items *List "forward:Add" // contains filtered or unexported fields }
func (*Render) Transparent ¶
type RotationExtrusion ¶
type RotationExtrusion struct { ParentImpl Angle float64 "optional" Convexity uint16 "optional" Circular *Circular "forward:SetFa,SetFs,SetFn" Items *List "forward:Add" // contains filtered or unexported fields }
func NewRotationExtrusion ¶
func NewRotationExtrusion(items ...Primitive) *RotationExtrusion
func (*RotationExtrusion) Add ¶
func (o *RotationExtrusion) Add(items ...Primitive) *RotationExtrusion
func (*RotationExtrusion) Disable ¶
func (o *RotationExtrusion) Disable() Primitive
func (*RotationExtrusion) Highlight ¶
func (o *RotationExtrusion) Highlight() Primitive
func (*RotationExtrusion) Prefix ¶
func (o *RotationExtrusion) Prefix() string
func (*RotationExtrusion) Render ¶
func (o *RotationExtrusion) Render(w *bufio.Writer)
func (*RotationExtrusion) SetAngle ¶
func (o *RotationExtrusion) SetAngle(val float64) *RotationExtrusion
func (*RotationExtrusion) SetConvexity ¶
func (o *RotationExtrusion) SetConvexity(val uint16) *RotationExtrusion
func (*RotationExtrusion) SetFa ¶
func (o *RotationExtrusion) SetFa(val float64) *RotationExtrusion
func (*RotationExtrusion) SetFn ¶
func (o *RotationExtrusion) SetFn(val uint16) *RotationExtrusion
func (*RotationExtrusion) SetFs ¶
func (o *RotationExtrusion) SetFs(val float64) *RotationExtrusion
func (*RotationExtrusion) ShowOnly ¶
func (o *RotationExtrusion) ShowOnly() Primitive
func (*RotationExtrusion) Transparent ¶
func (o *RotationExtrusion) Transparent() Primitive
type Scale ¶
type Scale struct { ParentImpl Scale Vec3 Items *List "forward:Add" // contains filtered or unexported fields }
func (*Scale) Transparent ¶
type Sphere ¶
type Sphere struct { ParentImpl Radius float64 Circular *Circular "forward:SetFa,SetFs,SetFn" // contains filtered or unexported fields }
func (*Sphere) Transparent ¶
type Square ¶
type Square struct { ParentImpl Dims Vec2 Center bool "optional" // contains filtered or unexported fields }
func (*Square) Transparent ¶
type Surface ¶
type Surface struct { ParentImpl File string Center bool "optional" Invert bool "optional" Convexity int "optional" // contains filtered or unexported fields }
func NewSurface ¶
func (*Surface) SetConvexity ¶
func (*Surface) Transparent ¶
type Text ¶
type Text struct { ParentImpl Text string Size uint16 "optional" Font string "optional" Halign string "optional" Valign string "optional" Spacing uint16 "optional" Direction string "optional" Language string "optional" Script string "optional" Fn uint16 "optional" // contains filtered or unexported fields }
func (*Text) SetDirection ¶
func (*Text) SetLanguage ¶
func (*Text) SetSpacing ¶
func (*Text) Transparent ¶
type Transform ¶
type Transform struct { ParentImpl Items *List "forward:Add" // contains filtered or unexported fields }