primitives

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UVSphere

func UVSphere(radius float64, rows, columns int) modeling.Mesh

func UVSphereUnwelded added in v0.9.0

func UVSphereUnwelded(radius float64, rows, columns int) modeling.Mesh

func UnitCube added in v0.9.0

func UnitCube() modeling.Mesh

Types

type Circle added in v0.9.0

type Circle struct {
	Sides  int
	Radius float64
	UVs    *CircleUVs
}

func (Circle) ToMesh added in v0.9.0

func (c Circle) ToMesh() modeling.Mesh

type CircleUVs added in v0.9.0

type CircleUVs struct {
	Center vector2.Float64
	Radius float64
}

type Cube

type Cube struct {
	Height float64
	Width  float64
	Depth  float64
	UVs    *CubeUVs
}

func (Cube) UnweldedQuads added in v0.9.0

func (c Cube) UnweldedQuads() modeling.Mesh

Builds a cube

The Cube Indices:

  3 ------- 7
/ |      /  |

2 | 6 | | 1 | 5 | / | / 0 ------ 4

func (Cube) Welded added in v0.9.0

func (c Cube) Welded() modeling.Mesh

type CubeNode added in v0.18.0

type CubeNodeData added in v0.18.0

type CubeNodeData struct {
	Width  nodes.NodeOutput[float64]
	Height nodes.NodeOutput[float64]
	Depth  nodes.NodeOutput[float64]
}

func (CubeNodeData) Process added in v0.18.0

func (c CubeNodeData) Process() (modeling.Mesh, error)

type CubeUVs added in v0.9.0

type CubeUVs struct {
	Top    *StripUVs
	Bottom *StripUVs
	Left   *StripUVs
	Right  *StripUVs
	Front  *StripUVs
	Back   *StripUVs
}

func DefaultCubeUVs added in v0.9.0

func DefaultCubeUVs() *CubeUVs

type Cylinder

type Cylinder struct {
	Sides           int
	Height          float64
	Radius          float64
	NoTop, NoBottom bool // Optionally turn off generation of top and/or bottom and turn the cylinder into pipe
	UVs             *CylinderUVs
}

func (Cylinder) ToMesh added in v0.9.0

func (c Cylinder) ToMesh() modeling.Mesh

type CylinderNode added in v0.17.0

type CylinderNodeData added in v0.17.0

type CylinderNodeData struct {
	Sides  nodes.NodeOutput[int]
	Height nodes.NodeOutput[float64]
	Radius nodes.NodeOutput[float64]
	Top    nodes.NodeOutput[bool]
	Bottom nodes.NodeOutput[bool]
}

func (CylinderNodeData) Process added in v0.17.0

func (hnd CylinderNodeData) Process() (modeling.Mesh, error)

type CylinderUVs added in v0.9.0

type CylinderUVs struct {
	Top    *CircleUVs
	Bottom *CircleUVs
	Side   *StripUVs
}

type Hemisphere added in v0.17.0

type Hemisphere struct {
	Radius float64
	Capped bool
}

func (Hemisphere) UV added in v0.17.0

func (h Hemisphere) UV(rows, columns int) modeling.Mesh

type HemisphereNode added in v0.17.0

type HemisphereNode = nodes.StructNode[modeling.Mesh, HemisphereNodeData]

type HemisphereNodeData added in v0.17.0

type HemisphereNodeData struct {
	Rows    nodes.NodeOutput[int]
	Columns nodes.NodeOutput[int]
	Radius  nodes.NodeOutput[float64]
	Capped  nodes.NodeOutput[bool]
}

func (HemisphereNodeData) Process added in v0.17.0

func (hnd HemisphereNodeData) Process() (modeling.Mesh, error)

type Quad added in v0.9.0

type Quad struct {
	Width float64
	Depth float64
	UVs   *StripUVs
}

func (Quad) ToMesh added in v0.9.0

func (q Quad) ToMesh() modeling.Mesh

type StripUVs added in v0.9.0

type StripUVs struct {
	Start vector2.Float64
	End   vector2.Float64
	Width float64
}

func (StripUVs) Dir added in v0.9.0

func (suv StripUVs) Dir() vector2.Float64

func (StripUVs) EndLeft added in v0.9.0

func (suv StripUVs) EndLeft() vector2.Float64

func (StripUVs) EndRight added in v0.9.0

func (suv StripUVs) EndRight() vector2.Float64

func (StripUVs) LeftToRight added in v0.17.0

func (suv StripUVs) LeftToRight() vector2.Float64

func (StripUVs) StartLeft added in v0.9.0

func (suv StripUVs) StartLeft() vector2.Float64

func (StripUVs) StartRight added in v0.9.0

func (suv StripUVs) StartRight() vector2.Float64

type StripUVsNode added in v0.17.0

type StripUVsNode = nodes.StructNode[StripUVs, StripUVsNodeData]

type StripUVsNodeData added in v0.17.0

type StripUVsNodeData struct {
	Width nodes.NodeOutput[float64]
	Start nodes.NodeOutput[vector2.Float64]
	End   nodes.NodeOutput[vector2.Float64]
}

func (StripUVsNodeData) Process added in v0.17.0

func (sund StripUVsNodeData) Process() (StripUVs, error)

Jump to

Keyboard shortcuts

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