Pewarta Proxy

πŸ“‹ Server Request & Proxy Logs

Loading active proxy settings...
Developed by Khairul Adha (adhexa.id)
Mengambil log server...

βš™οΈ Pengaturan Proxy Target

Help us shape the future of Go! Take the 2026 Go Developer Survey

ln

package
v0.0.0-...-12e6c6e Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2017 License: MIT Imports: 11 Imported by: 18

Documentation ΒΆ

Index ΒΆ

Constants ΒΆ

View Source
const EPS = 1e-9
View Source
const INF = 1e9

Variables ΒΆ

View Source
var ClipBox = Box{Vector{-1, -1, -1}, Vector{1, 1, 1}}
View Source
var NoHit = Hit{nil, INF}

Functions ΒΆ

func Degrees ΒΆ

func Degrees(radians float64) float64

func Median ΒΆ

func Median(items []float64) float64

func ParseFloats ΒΆ

func ParseFloats(items []string) []float64

func Radians ΒΆ

func Radians(degrees float64) float64

func SaveBinarySTL ΒΆ

func SaveBinarySTL(path string, mesh *Mesh) error

Types ΒΆ

type Axis ΒΆ

type Axis uint8
const (
	AxisNone Axis = iota
	AxisX
	AxisY
	AxisZ
)

type BooleanShape ΒΆ

type BooleanShape struct {
	Op   Op
	A, B Shape
}

func (*BooleanShape) BoundingBox ΒΆ

func (s *BooleanShape) BoundingBox() Box

func (*BooleanShape) Compile ΒΆ

func (s *BooleanShape) Compile()

func (*BooleanShape) Contains ΒΆ

func (s *BooleanShape) Contains(v Vector, f float64) bool

func (*BooleanShape) Filter ΒΆ

func (s *BooleanShape) Filter(v Vector) (Vector, bool)

func (*BooleanShape) Intersect ΒΆ

func (s *BooleanShape) Intersect(r Ray) Hit

func (*BooleanShape) Paths ΒΆ

func (s *BooleanShape) Paths() Paths

type Box ΒΆ

type Box struct {
	Min, Max Vector
}

func BoxForShapes ΒΆ

func BoxForShapes(shapes []Shape) Box

func BoxForTriangles ΒΆ

func BoxForTriangles(shapes []*Triangle) Box

func BoxForVectors ΒΆ

func BoxForVectors(vectors []Vector) Box

func (Box) Anchor ΒΆ

func (a Box) Anchor(anchor Vector) Vector

func (Box) Center ΒΆ

func (a Box) Center() Vector

func (Box) Contains ΒΆ

func (a Box) Contains(b Vector) bool

func (Box) Extend ΒΆ

func (a Box) Extend(b Box) Box

func (*Box) Intersect ΒΆ

func (b *Box) Intersect(r Ray) (float64, float64)

func (*Box) Partition ΒΆ

func (b *Box) Partition(axis Axis, point float64) (left, right bool)

func (Box) Size ΒΆ

func (a Box) Size() Vector

type ClipFilter ΒΆ

type ClipFilter struct {
	Matrix Matrix
	Eye    Vector
	Scene  *Scene
}

func (*ClipFilter) Filter ΒΆ

func (f *ClipFilter) Filter(v Vector) (Vector, bool)

type Cone ΒΆ

type Cone struct {
	Radius float64
	Height float64
}

func NewCone ΒΆ

func NewCone(radius, height float64) *Cone

func (*Cone) BoundingBox ΒΆ

func (c *Cone) BoundingBox() Box

func (*Cone) Compile ΒΆ

func (c *Cone) Compile()

func (*Cone) Contains ΒΆ

func (c *Cone) Contains(v Vector, f float64) bool

func (*Cone) Intersect ΒΆ

func (shape *Cone) Intersect(ray Ray) Hit

func (*Cone) Paths ΒΆ

func (c *Cone) Paths() Paths

type Cube ΒΆ

type Cube struct {
	Min Vector
	Max Vector
	Box Box
}

func NewCube ΒΆ

func NewCube(min, max Vector) *Cube

func (*Cube) BoundingBox ΒΆ

func (c *Cube) BoundingBox() Box

func (*Cube) Compile ΒΆ

func (c *Cube) Compile()

func (*Cube) Contains ΒΆ

func (c *Cube) Contains(v Vector, f float64) bool

func (*Cube) Intersect ΒΆ

func (c *Cube) Intersect(r Ray) Hit

func (*Cube) Paths ΒΆ

func (c *Cube) Paths() Paths

type Cylinder ΒΆ

type Cylinder struct {
	Radius float64
	Z0, Z1 float64
}

func NewCylinder ΒΆ

func NewCylinder(radius, z0, z1 float64) *Cylinder

func (*Cylinder) BoundingBox ΒΆ

func (c *Cylinder) BoundingBox() Box

func (*Cylinder) Compile ΒΆ

func (c *Cylinder) Compile()

func (*Cylinder) Contains ΒΆ

func (c *Cylinder) Contains(v Vector, f float64) bool

func (*Cylinder) Intersect ΒΆ

func (shape *Cylinder) Intersect(ray Ray) Hit

func (*Cylinder) Paths ΒΆ

func (c *Cylinder) Paths() Paths

type Direction ΒΆ

type Direction int
const (
	Above Direction = iota
	Below
)

type EmptyShape ΒΆ

type EmptyShape struct {
}

func (*EmptyShape) BoundingBox ΒΆ

func (s *EmptyShape) BoundingBox() Box

func (*EmptyShape) Compile ΒΆ

func (s *EmptyShape) Compile()

func (*EmptyShape) Contains ΒΆ

func (s *EmptyShape) Contains(v Vector, f float64) bool

func (*EmptyShape) Intersect ΒΆ

func (s *EmptyShape) Intersect(r Ray) Hit

func (*EmptyShape) Paths ΒΆ

func (s *EmptyShape) Paths() Paths

type Filter ΒΆ

type Filter interface {
	Filter(v Vector) (Vector, bool)
}

type Function ΒΆ

type Function struct {
	Function  func(x, y float64) float64
	Box       Box
	Direction Direction
}

func (*Function) BoundingBox ΒΆ

func (f *Function) BoundingBox() Box

func (*Function) Compile ΒΆ

func (f *Function) Compile()

func (*Function) Contains ΒΆ

func (f *Function) Contains(v Vector, eps float64) bool

func (*Function) Intersect ΒΆ

func (f *Function) Intersect(ray Ray) Hit

func (*Function) Paths ΒΆ

func (f *Function) Paths() Paths

func (*Function) Paths1 ΒΆ

func (f *Function) Paths1() Paths

func (*Function) Paths3 ΒΆ

func (f *Function) Paths3() Paths

type Hit ΒΆ

type Hit struct {
	Shape Shape
	T     float64
}

func (Hit) Max ΒΆ

func (a Hit) Max(b Hit) Hit

func (Hit) Min ΒΆ

func (a Hit) Min(b Hit) Hit

func (Hit) Ok ΒΆ

func (hit Hit) Ok() bool

type Matrix ΒΆ

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

func Frustum ΒΆ

func Frustum(l, r, b, t, n, f float64) Matrix

func Identity ΒΆ

func Identity() Matrix

func LookAt ΒΆ

func LookAt(eye, center, up Vector) Matrix

func Orthographic ΒΆ

func Orthographic(l, r, b, t, n, f float64) Matrix

func Perspective ΒΆ

func Perspective(fovy, aspect, near, far float64) Matrix

func Rotate ΒΆ

func Rotate(v Vector, a float64) Matrix

func Scale ΒΆ

func Scale(v Vector) Matrix

func Translate ΒΆ

func Translate(v Vector) Matrix

func (Matrix) Determinant ΒΆ

func (a Matrix) Determinant() float64

func (Matrix) Frustum ΒΆ

func (m Matrix) Frustum(l, r, b, t, n, f float64) Matrix

func (Matrix) Inverse ΒΆ

func (a Matrix) Inverse() Matrix

func (Matrix) Mul ΒΆ

func (a Matrix) Mul(b Matrix) Matrix

func (Matrix) MulBox ΒΆ

func (a Matrix) MulBox(box Box) Box

func (Matrix) MulDirection ΒΆ

func (a Matrix) MulDirection(b Vector) Vector

func (Matrix) MulPosition ΒΆ

func (a Matrix) MulPosition(b Vector) Vector

func (Matrix) MulPositionW ΒΆ

func (a Matrix) MulPositionW(b Vector) Vector

func (Matrix) MulRay ΒΆ

func (a Matrix) MulRay(b Ray) Ray

func (Matrix) Orthographic ΒΆ

func (m Matrix) Orthographic(l, r, b, t, n, f float64) Matrix

func (Matrix) Perspective ΒΆ

func (m Matrix) Perspective(fovy, aspect, near, far float64) Matrix

func (Matrix) Rotate ΒΆ

func (m Matrix) Rotate(v Vector, a float64) Matrix

func (Matrix) Scale ΒΆ

func (m Matrix) Scale(v Vector) Matrix

func (Matrix) Translate ΒΆ

func (m Matrix) Translate(v Vector) Matrix

func (Matrix) Transpose ΒΆ

func (a Matrix) Transpose() Matrix

type Mesh ΒΆ

type Mesh struct {
	Box       Box
	Triangles []*Triangle
	Tree      *Tree
}

func LoadBinarySTL ΒΆ

func LoadBinarySTL(path string) (*Mesh, error)

func LoadOBJ ΒΆ

func LoadOBJ(path string) (*Mesh, error)

func LoadSTL ΒΆ

func LoadSTL(path string) (*Mesh, error)

func NewMesh ΒΆ

func NewMesh(triangles []*Triangle) *Mesh

func (*Mesh) BoundingBox ΒΆ

func (m *Mesh) BoundingBox() Box

func (*Mesh) Compile ΒΆ

func (m *Mesh) Compile()

func (*Mesh) Contains ΒΆ

func (m *Mesh) Contains(v Vector, f float64) bool

func (*Mesh) FitInside ΒΆ

func (m *Mesh) FitInside(box Box, anchor Vector)

func (*Mesh) Intersect ΒΆ

func (m *Mesh) Intersect(r Ray) Hit

func (*Mesh) MoveTo ΒΆ

func (m *Mesh) MoveTo(position, anchor Vector)

func (*Mesh) Paths ΒΆ

func (m *Mesh) Paths() Paths

func (*Mesh) SaveBinarySTL ΒΆ

func (m *Mesh) SaveBinarySTL(path string) error

func (*Mesh) Transform ΒΆ

func (m *Mesh) Transform(matrix Matrix)

func (*Mesh) UnitCube ΒΆ

func (m *Mesh) UnitCube()

func (*Mesh) UpdateBoundingBox ΒΆ

func (m *Mesh) UpdateBoundingBox()

func (*Mesh) Voxelize ΒΆ

func (m *Mesh) Voxelize(size float64) []*Cube

type Node ΒΆ

type Node struct {
	Axis   Axis
	Point  float64
	Shapes []Shape
	Left   *Node
	Right  *Node
}

func NewNode ΒΆ

func NewNode(shapes []Shape) *Node

func (*Node) Intersect ΒΆ

func (node *Node) Intersect(r Ray, tmin, tmax float64) Hit

func (*Node) IntersectShapes ΒΆ

func (node *Node) IntersectShapes(r Ray) Hit

func (*Node) Partition ΒΆ

func (node *Node) Partition(size int, axis Axis, point float64) (left, right []Shape)

func (*Node) PartitionScore ΒΆ

func (node *Node) PartitionScore(axis Axis, point float64) int

func (*Node) Split ΒΆ

func (node *Node) Split(depth int)

type Op ΒΆ

type Op int
const (
	Intersection Op = iota
	Difference
)

type OutlineCone ΒΆ

type OutlineCone struct {
	Cone
	Eye Vector
	Up  Vector
}

func NewOutlineCone ΒΆ

func NewOutlineCone(eye, up Vector, radius, height float64) *OutlineCone

func (*OutlineCone) Paths ΒΆ

func (c *OutlineCone) Paths() Paths

type OutlineCylinder ΒΆ

type OutlineCylinder struct {
	Cylinder
	Eye Vector
	Up  Vector
}

func NewOutlineCylinder ΒΆ

func NewOutlineCylinder(eye, up Vector, radius, z0, z1 float64) *OutlineCylinder

func (*OutlineCylinder) Paths ΒΆ

func (c *OutlineCylinder) Paths() Paths

type OutlineSphere ΒΆ

type OutlineSphere struct {
	Sphere
	Eye Vector
	Up  Vector
}

func NewOutlineSphere ΒΆ

func NewOutlineSphere(eye, up, center Vector, radius float64) *OutlineSphere

func (*OutlineSphere) Paths ΒΆ

func (s *OutlineSphere) Paths() Paths

type Path ΒΆ

type Path []Vector

func (Path) BoundingBox ΒΆ

func (p Path) BoundingBox() Box

func (Path) Chop ΒΆ

func (p Path) Chop(step float64) Path

func (Path) Filter ΒΆ

func (p Path) Filter(f Filter) Paths

func (Path) Print ΒΆ

func (p Path) Print()

func (Path) Simplify ΒΆ

func (p Path) Simplify(threshold float64) Path

func (Path) String ΒΆ

func (p Path) String() string

func (Path) ToSVG ΒΆ

func (p Path) ToSVG() string

func (Path) Transform ΒΆ

func (p Path) Transform(matrix Matrix) Path

type Paths ΒΆ

type Paths []Path

func (Paths) BoundingBox ΒΆ

func (p Paths) BoundingBox() Box

func (Paths) Chop ΒΆ

func (p Paths) Chop(step float64) Paths

func (Paths) Filter ΒΆ

func (p Paths) Filter(f Filter) Paths

func (Paths) Print ΒΆ

func (p Paths) Print()

func (Paths) Simplify ΒΆ

func (p Paths) Simplify(threshold float64) Paths

func (Paths) String ΒΆ

func (p Paths) String() string

func (Paths) ToSVG ΒΆ

func (p Paths) ToSVG(width, height float64) string

func (Paths) Transform ΒΆ

func (p Paths) Transform(matrix Matrix) Paths

func (Paths) WriteToPNG ΒΆ

func (p Paths) WriteToPNG(path string, width, height float64)

func (Paths) WriteToSVG ΒΆ

func (p Paths) WriteToSVG(path string, width, height float64) error

func (Paths) WriteToTXT ΒΆ

func (p Paths) WriteToTXT(path string) error

type Plane ΒΆ

type Plane struct {
	Point  Vector
	Normal Vector
}

func (*Plane) IntersectMesh ΒΆ

func (p *Plane) IntersectMesh(m *Mesh) Paths

func (*Plane) IntersectSegment ΒΆ

func (p *Plane) IntersectSegment(v0, v1 Vector) (Vector, bool)

func (*Plane) IntersectTriangle ΒΆ

func (p *Plane) IntersectTriangle(t *Triangle) (Vector, Vector, bool)

type Ray ΒΆ

type Ray struct {
	Origin, Direction Vector
}

func (Ray) Position ΒΆ

func (r Ray) Position(t float64) Vector

type STLHeader ΒΆ

type STLHeader struct {
	Count uint32
	// contains filtered or unexported fields
}

type STLTriangle ΒΆ

type STLTriangle struct {
	V1, V2, V3 [3]float32
	// contains filtered or unexported fields
}

type Scene ΒΆ

type Scene struct {
	Shapes []Shape
	Tree   *Tree
}

func (*Scene) Add ΒΆ

func (s *Scene) Add(shape Shape)

func (*Scene) Compile ΒΆ

func (s *Scene) Compile()

func (*Scene) Intersect ΒΆ

func (s *Scene) Intersect(r Ray) Hit

func (*Scene) Paths ΒΆ

func (s *Scene) Paths() Paths

func (*Scene) Render ΒΆ

func (s *Scene) Render(eye, center, up Vector, width, height, fovy, near, far, step float64) Paths

func (*Scene) RenderWithMatrix ΒΆ

func (s *Scene) RenderWithMatrix(matrix Matrix, eye Vector, width, height, step float64) Paths

func (*Scene) Visible ΒΆ

func (s *Scene) Visible(eye, point Vector) bool

type Shape ΒΆ

type Shape interface {
	Compile()
	BoundingBox() Box
	Contains(Vector, float64) bool
	Intersect(Ray) Hit
	Paths() Paths
}

func NewBooleanShape ΒΆ

func NewBooleanShape(op Op, shapes ...Shape) Shape

func NewDifference ΒΆ

func NewDifference(shapes ...Shape) Shape

func NewFunction ΒΆ

func NewFunction(function func(x, y float64) float64, box Box, direction Direction) Shape

func NewIntersection ΒΆ

func NewIntersection(shapes ...Shape) Shape

func NewTransformedOutlineCone ΒΆ

func NewTransformedOutlineCone(eye, up, v0, v1 Vector, radius float64) Shape

func NewTransformedOutlineCylinder ΒΆ

func NewTransformedOutlineCylinder(eye, up, v0, v1 Vector, radius float64) Shape

func NewTransformedShape ΒΆ

func NewTransformedShape(s Shape, m Matrix) Shape

type Sphere ΒΆ

type Sphere struct {
	Center Vector
	Radius float64
	Box    Box
}

func NewSphere ΒΆ

func NewSphere(center Vector, radius float64) *Sphere

func (*Sphere) BoundingBox ΒΆ

func (s *Sphere) BoundingBox() Box

func (*Sphere) Compile ΒΆ

func (s *Sphere) Compile()

func (*Sphere) Contains ΒΆ

func (s *Sphere) Contains(v Vector, f float64) bool

func (*Sphere) Intersect ΒΆ

func (s *Sphere) Intersect(r Ray) Hit

func (*Sphere) Paths ΒΆ

func (s *Sphere) Paths() Paths

func (*Sphere) Paths2 ΒΆ

func (s *Sphere) Paths2() Paths

func (*Sphere) Paths3 ΒΆ

func (s *Sphere) Paths3() Paths

func (*Sphere) Paths4 ΒΆ

func (s *Sphere) Paths4() Paths

type TransformedShape ΒΆ

type TransformedShape struct {
	Shape
	Matrix  Matrix
	Inverse Matrix
}

func (*TransformedShape) BoundingBox ΒΆ

func (s *TransformedShape) BoundingBox() Box

func (*TransformedShape) Contains ΒΆ

func (s *TransformedShape) Contains(v Vector, f float64) bool

func (*TransformedShape) Intersect ΒΆ

func (s *TransformedShape) Intersect(r Ray) Hit

func (*TransformedShape) Paths ΒΆ

func (s *TransformedShape) Paths() Paths

type Tree ΒΆ

type Tree struct {
	Box  Box
	Root *Node
}

func NewTree ΒΆ

func NewTree(shapes []Shape) *Tree

func (*Tree) Intersect ΒΆ

func (tree *Tree) Intersect(r Ray) Hit

type Triangle ΒΆ

type Triangle struct {
	V1, V2, V3 Vector
	Box        Box
}

func NewTriangle ΒΆ

func NewTriangle(v1, v2, v3 Vector) *Triangle

func (*Triangle) BoundingBox ΒΆ

func (t *Triangle) BoundingBox() Box

func (*Triangle) Compile ΒΆ

func (t *Triangle) Compile()

func (*Triangle) Contains ΒΆ

func (t *Triangle) Contains(v Vector, f float64) bool

func (*Triangle) Intersect ΒΆ

func (t *Triangle) Intersect(r Ray) Hit

func (*Triangle) Paths ΒΆ

func (t *Triangle) Paths() Paths

func (*Triangle) UpdateBoundingBox ΒΆ

func (t *Triangle) UpdateBoundingBox()

type Vector ΒΆ

type Vector struct {
	X, Y, Z float64
}

func LatLngToXYZ ΒΆ

func LatLngToXYZ(lat, lng, radius float64) Vector

func RandomUnitVector ΒΆ

func RandomUnitVector() Vector

func (Vector) Add ΒΆ

func (a Vector) Add(b Vector) Vector

func (Vector) AddScalar ΒΆ

func (a Vector) AddScalar(b float64) Vector

func (Vector) Cross ΒΆ

func (a Vector) Cross(b Vector) Vector

func (Vector) Distance ΒΆ

func (a Vector) Distance(b Vector) float64

func (Vector) DistanceSquared ΒΆ

func (a Vector) DistanceSquared(b Vector) float64

func (Vector) Div ΒΆ

func (a Vector) Div(b Vector) Vector

func (Vector) DivScalar ΒΆ

func (a Vector) DivScalar(b float64) Vector

func (Vector) Dot ΒΆ

func (a Vector) Dot(b Vector) float64

func (Vector) Length ΒΆ

func (a Vector) Length() float64

func (Vector) LengthSquared ΒΆ

func (a Vector) LengthSquared() float64

func (Vector) Max ΒΆ

func (a Vector) Max(b Vector) Vector

func (Vector) Min ΒΆ

func (a Vector) Min(b Vector) Vector

func (Vector) MinAxis ΒΆ

func (a Vector) MinAxis() Vector

func (Vector) MinComponent ΒΆ

func (a Vector) MinComponent() float64

func (Vector) Mul ΒΆ

func (a Vector) Mul(b Vector) Vector

func (Vector) MulScalar ΒΆ

func (a Vector) MulScalar(b float64) Vector

func (Vector) Normalize ΒΆ

func (a Vector) Normalize() Vector

func (Vector) SegmentDistance ΒΆ

func (p Vector) SegmentDistance(v Vector, w Vector) float64

func (Vector) Sub ΒΆ

func (a Vector) Sub(b Vector) Vector

func (Vector) SubScalar ΒΆ

func (a Vector) SubScalar(b float64) Vector

Jump to

Keyboard shortcuts

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