primitives

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2024 License: MIT Imports: 7 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 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
	UVs    *CylinderUVs
}

func (Cylinder) ToMesh added in v0.9.0

func (c Cylinder) ToMesh() modeling.Mesh

type CylinderUVs added in v0.9.0

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

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) 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

Jump to

Keyboard shortcuts

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