primitives

package
v0.36.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func QuadSphere added in v0.35.0

func QuadSphere(radius float64, cube Cube, welded bool, dewarpUVs bool) modeling.Mesh

func SinArcLength added in v0.35.0

func SinArcLength(t1, t2 float64) float64

SinArcLength computes the arc length of y = sin(x) between x = t1 and x = t2 using numerical integration.

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 CircleNode added in v0.21.1

type CircleNode struct {
	Radius nodes.Output[float64]
	Sides  nodes.Output[int]
	UVs    nodes.Output[CircleUVs]
}

func (CircleNode) Out added in v0.32.0

func (c CircleNode) Out(out *nodes.StructOutput[modeling.Mesh])

type CircleUVs added in v0.9.0

type CircleUVs struct {
	Center vector2.Float64
	Radius float64
}

type CircleUVsNode added in v0.21.1

type CircleUVsNode struct {
	Center nodes.Output[vector2.Float64]
	Radius nodes.Output[float64]
}

func (CircleUVsNode) Out added in v0.32.0

type Cone added in v0.21.2

type Cone struct {
	Height float64
	Radius float64
	Sides  int
}

func (Cone) ToMesh added in v0.21.2

func (c Cone) ToMesh() modeling.Mesh

type ConeNode added in v0.21.2

type ConeNode struct {
	Height nodes.Output[float64]
	Radius nodes.Output[float64]
	Sides  nodes.Output[int]
}

func (ConeNode) Out added in v0.32.0

func (r ConeNode) Out(out *nodes.StructOutput[modeling.Mesh])

type Cube

type Cube struct {
	Height     float64
	Width      float64
	Depth      float64
	Dimensions int
	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 CubeNode struct {
	Width      nodes.Output[float64]
	Height     nodes.Output[float64]
	Depth      nodes.Output[float64]
	Dimensions nodes.Output[int]
	UVs        nodes.Output[CubeUVs]
}

func (CubeNode) Out added in v0.32.0

func (c CubeNode) Out(out *nodes.StructOutput[modeling.Mesh])

type CubeUVs added in v0.9.0

type CubeUVs struct {
	Top    EuclideanUVSpace
	Bottom EuclideanUVSpace
	Left   EuclideanUVSpace
	Right  EuclideanUVSpace
	Front  EuclideanUVSpace
	Back   EuclideanUVSpace
}

func DefaultCubeUVs added in v0.9.0

func DefaultCubeUVs() *CubeUVs

type CubeUVsNode added in v0.24.0

type CubeUVsNode struct {
	Top    nodes.Output[StripUVs]
	Bottom nodes.Output[StripUVs]
	Left   nodes.Output[StripUVs]
	Right  nodes.Output[StripUVs]
	Front  nodes.Output[StripUVs]
	Back   nodes.Output[StripUVs]
}

func (CubeUVsNode) Uv added in v0.32.0

func (cnd CubeUVsNode) Uv(out *nodes.StructOutput[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 CylinderNode struct {
	Sides   nodes.Output[int]
	Height  nodes.Output[float64]
	Radius  nodes.Output[float64]
	Radius2 nodes.Output[float64]
	Top     nodes.Output[bool]
	Bottom  nodes.Output[bool]
	UVs     nodes.Output[CylinderUVs]
}

func (CylinderNode) Out added in v0.32.0

func (hnd CylinderNode) Out(out *nodes.StructOutput[modeling.Mesh])

type CylinderUVs added in v0.9.0

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

type CylinderUVsNode added in v0.36.0

type CylinderUVsNode struct {
	Top    nodes.Output[CircleUVs]
	Bottom nodes.Output[CircleUVs]
	Side   nodes.Output[StripUVs]
}

func (CylinderUVsNode) Out added in v0.36.0

type EuclideanUVSpace added in v0.35.0

type EuclideanUVSpace interface {
	AtXY(p vector2.Float64) vector2.Float64
	AtXYs(xys []vector2.Float64) []vector2.Float64
}

type Hemisphere added in v0.17.0

type Hemisphere struct {
	Radius float64
	Height 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 struct {
	Rows    nodes.Output[int]
	Columns nodes.Output[int]
	Radius  nodes.Output[float64]
	Height  nodes.Output[float64]
	Capped  nodes.Output[bool]
}

func (HemisphereNode) Out added in v0.32.0

type PolarUVSpace added in v0.35.0

type PolarUVSpace interface {
	AtRt(radius, theta float64) vector2.Float64
	AtRts(rts []vector2.Float64) []vector2.Float64
}

type Quad added in v0.9.0

type Quad struct {
	Width   float64
	Depth   float64
	Columns int
	Rows    int
	UVs     EuclideanUVSpace
}

func (Quad) ToMesh added in v0.9.0

func (q Quad) ToMesh() modeling.Mesh

type QuadNode added in v0.21.1

type QuadNode struct {
	Width   nodes.Output[float64]
	Depth   nodes.Output[float64]
	Columns nodes.Output[int]
	Rows    nodes.Output[int]
	UVs     nodes.Output[StripUVs]
}

func (QuadNode) Out added in v0.32.0

func (c QuadNode) Out(out *nodes.StructOutput[modeling.Mesh])

type QuadSphereNode added in v0.35.0

type QuadSphereNode struct {
	Radius     nodes.Output[float64]
	Weld       nodes.Output[bool]
	DewarpUVs  nodes.Output[bool]
	Resolution nodes.Output[int]
	UVs        nodes.Output[CubeUVs]
}

func (QuadSphereNode) Out added in v0.35.0

type QuadSphereWarpUV added in v0.35.0

type QuadSphereWarpUV struct {
	// contains filtered or unexported fields
}

func (QuadSphereWarpUV) AtXY added in v0.35.0

func (QuadSphereWarpUV) AtXYs added in v0.35.0

type StanfordBunny added in v0.32.1

type StanfordBunny struct {
}

func (StanfordBunny) Bunny added in v0.32.1

func (c StanfordBunny) Bunny(out *nodes.StructOutput[modeling.Mesh])

type StripUVs added in v0.9.0

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

func (StripUVs) At added in v0.24.0

func (suv StripUVs) At(time float64) vector2.Float64

func (StripUVs) AtXY added in v0.26.0

func (suv StripUVs) AtXY(p vector2.Float64) vector2.Float64

This is slow, shouldn't really use it if you're gonna be calling it a bunch

func (StripUVs) AtXYs added in v0.33.0

func (suv StripUVs) AtXYs(xys []vector2.Float64) []vector2.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 struct {
	Width nodes.Output[float64]
	Start nodes.Output[vector2.Float64]
	End   nodes.Output[vector2.Float64]
}

func (StripUVsNode) Out added in v0.32.0

func (sund StripUVsNode) Out(out *nodes.StructOutput[StripUVs])

type Torus added in v0.33.0

type Torus struct {
	MajorRadius     float64
	MinorRadius     float64
	MajorResolution int
	MinorResolution int
	UVs             *TorusUVs
}

func (Torus) ToMesh added in v0.33.0

func (c Torus) ToMesh() modeling.Mesh

type TorusNode added in v0.33.0

type TorusNode struct {
	MajorRadius     nodes.Output[float64]
	MinorRadius     nodes.Output[float64]
	MajorResolution nodes.Output[int]
	MinorResolution nodes.Output[int]
	UVs             nodes.Output[TorusUVs]
}

func (TorusNode) Out added in v0.33.0

func (c TorusNode) Out(out *nodes.StructOutput[modeling.Mesh])

type TorusUVNode added in v0.33.0

type TorusUVNode struct {
	MajorOffset nodes.Output[float64]
	MinorOffset nodes.Output[float64]
	Strip       nodes.Output[StripUVs]
}

func (TorusUVNode) Out added in v0.33.0

func (c TorusUVNode) Out(out *nodes.StructOutput[TorusUVs])

type TorusUVs added in v0.33.0

type TorusUVs struct {
	MajorOffset float64
	MinorOffset float64
	Strip       EuclideanUVSpace
}

type TruncatedCone added in v0.36.0

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

func (TruncatedCone) ToMesh added in v0.36.0

func (c TruncatedCone) ToMesh() modeling.Mesh

type UvSphereNode added in v0.21.1

type UvSphereNode struct {
	Radius  nodes.Output[float64]
	Rows    nodes.Output[int]
	Columns nodes.Output[int]
	Weld    nodes.Output[bool]
}

func (UvSphereNode) Description added in v0.32.0

func (c UvSphereNode) Description() string

func (UvSphereNode) Out added in v0.32.0

Jump to

Keyboard shortcuts

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