Documentation
¶
Index ¶
- Constants
- func Clamp(v, min, max float64) float64
- func LowDiscrepancySample(u float32) (float64, float64)
- func Multiply3x3by3x1(m Matrix, v vector3.Float64) vector3.Float64
- func ToNormal(inEulerAngle vector3.Float64) vector3.Float64
- func Vector3ToInt(v vector3.Float64, power int) vector3.Int
- type AttributeNode
- type Line
- type MapEntry
- type MapEntryNode
- type Matrix
- type Mesh
- func EmptyMesh(topo Topology) Mesh
- func EmptyPointcloud() Mesh
- func NewLineStripMesh(v3Data map[string][]vector3.Float64, v2Data map[string][]vector2.Float64, ...) Mesh
- func NewMesh(topo Topology, indices []int) Mesh
- func NewPointCloud(v4Data map[string][]vector4.Float64, v3Data map[string][]vector3.Float64, ...) Mesh
- func NewTriangleMesh(indices []int) Mesh
- func (m Mesh) Append(other Mesh) Mesh
- func (m Mesh) ApplyTRS(transform trs.TRS) Mesh
- func (m Mesh) AttributeLength() int
- func (m Mesh) BoundingBox(atr string) geometry.AABB
- func (m Mesh) ClearAttributeData() Mesh
- func (m Mesh) CopyFloat1Attribute(src Mesh, attr string) Mesh
- func (m Mesh) CopyFloat2Attribute(src Mesh, attr string) Mesh
- func (m Mesh) CopyFloat3Attribute(src Mesh, attr string) Mesh
- func (m Mesh) CopyFloat4Attribute(src Mesh, attr string) Mesh
- func (m Mesh) Float1Attribute(attr string) *iter.ArrayIterator[float64]
- func (m Mesh) Float1Attributes() []string
- func (m Mesh) Float2Attribute(attr string) *iter.ArrayIterator[vector2.Float64]
- func (m Mesh) Float2Attributes() []string
- func (m Mesh) Float3Attribute(attr string) *iter.ArrayIterator[vector3.Float64]
- func (m Mesh) Float3Attributes() []string
- func (m Mesh) Float4Attribute(attr string) *iter.ArrayIterator[vector4.Float64]
- func (m Mesh) Float4Attributes() []string
- func (m Mesh) HasFloat1Attribute(attribute string) bool
- func (m Mesh) HasFloat2Attribute(attribute string) bool
- func (m Mesh) HasFloat3Attribute(attribute string) bool
- func (m Mesh) HasFloat4Attribute(attribute string) bool
- func (m Mesh) HasVertexAttribute(attribute string) bool
- func (m Mesh) Indices() *iter.ArrayIterator[int]
- func (m Mesh) LineStrip(i int) Line
- func (m Mesh) ModifyFloat1Attribute(atr string, f func(i int, v float64) float64) Mesh
- func (m Mesh) ModifyFloat1AttributeParallel(atr string, f func(i int, v float64) float64) Mesh
- func (m Mesh) ModifyFloat1AttributeParallelWithPoolSize(atr string, size int, f func(i int, v float64) float64) Mesh
- func (m Mesh) ModifyFloat2Attribute(atr string, f func(i int, v vector2.Float64) vector2.Float64) Mesh
- func (m Mesh) ModifyFloat2AttributeParallel(atr string, f func(i int, v vector2.Float64) vector2.Float64) Mesh
- func (m Mesh) ModifyFloat2AttributeParallelWithPoolSize(atr string, size int, f func(i int, v vector2.Float64) vector2.Float64) Mesh
- func (m Mesh) ModifyFloat3Attribute(atr string, f func(i int, v vector3.Float64) vector3.Float64) Mesh
- func (m Mesh) ModifyFloat3AttributeParallel(atr string, f func(i int, v vector3.Float64) vector3.Float64) Mesh
- func (m Mesh) ModifyFloat3AttributeParallelWithPoolSize(atr string, size int, f func(i int, v vector3.Float64) vector3.Float64) Mesh
- func (m Mesh) OctTree() *trees.OctTree
- func (m Mesh) OctTreeDepth(depth int) *trees.OctTree
- func (m Mesh) OctTreeWithAttributeAndDepth(atr string, depth int) *trees.OctTree
- func (m Mesh) PrimitiveCount() int
- func (m Mesh) Rotate(q quaternion.Quaternion) Mesh
- func (m Mesh) Scale(amount vector3.Float64) Mesh
- func (m Mesh) ScanFloat1Attribute(atr string, f func(i int, v float64)) Mesh
- func (m Mesh) ScanFloat1AttributeParallel(atr string, f func(i int, v float64)) Mesh
- func (m Mesh) ScanFloat1AttributeParallelWithPoolSize(atr string, size int, f func(i int, v float64)) Mesh
- func (m Mesh) ScanFloat2Attribute(atr string, f func(i int, v vector2.Float64)) Mesh
- func (m Mesh) ScanFloat2AttributeParallel(atr string, f func(i int, v vector2.Float64)) Mesh
- func (m Mesh) ScanFloat2AttributeParallelWithPoolSize(atr string, size int, f func(i int, v vector2.Float64)) Mesh
- func (m Mesh) ScanFloat3Attribute(atr string, f func(i int, v vector3.Float64)) Mesh
- func (m Mesh) ScanFloat3AttributeParallel(atr string, f func(i int, v vector3.Float64)) Mesh
- func (m Mesh) ScanFloat3AttributeParallelWithPoolSize(atr string, size int, f func(i int, v vector3.Float64)) Mesh
- func (m Mesh) ScanFloat4Attribute(atr string, f func(i int, v vector4.Float64)) Mesh
- func (m Mesh) ScanPrimitives(f func(i int, p Primitive)) Mesh
- func (m Mesh) ScanPrimitivesParallel(f func(i int, p Primitive)) Mesh
- func (m Mesh) ScanPrimitivesParallelWithPoolSize(size int, f func(i int, p Primitive)) Mesh
- func (m Mesh) SetFloat1Attribute(attr string, data []float64) Mesh
- func (m Mesh) SetFloat1Data(data map[string][]float64) Mesh
- func (m Mesh) SetFloat2Attribute(attr string, data []vector2.Float64) Mesh
- func (m Mesh) SetFloat2Data(data map[string][]vector2.Float64) Mesh
- func (m Mesh) SetFloat3Attribute(attr string, data []vector3.Float64) Mesh
- func (m Mesh) SetFloat3Data(data map[string][]vector3.Float64) Mesh
- func (m Mesh) SetFloat4Attribute(attr string, data []vector4.Float64) Mesh
- func (m Mesh) SetFloat4Data(data map[string][]vector4.Float64) Mesh
- func (m Mesh) SetIndices(indices []int) Mesh
- func (m Mesh) ToPointCloud() Mesh
- func (m Mesh) Topology() Topology
- func (m Mesh) Transform(ops ...Transformer) Mesh
- func (m Mesh) Translate(v vector3.Float64) Mesh
- func (m Mesh) Tri(i int) Tri
- func (m Mesh) VertexNeighborTable() VertexLUT
- func (m Mesh) WeldByFloat3Attribute(attribute string, decimalPlace int) Mesh
- type NewMeshNode
- type Point
- type Primitive
- type SelectFromMeshNode
- func (n SelectFromMeshNode) Color() nodes.StructOutput[[]vector3.Float64]
- func (n SelectFromMeshNode) Float2(attr string) []vector2.Float64
- func (n SelectFromMeshNode) Float3(attr string) []vector3.Float64
- func (n SelectFromMeshNode) Indices() nodes.StructOutput[[]int]
- func (n SelectFromMeshNode) Normal() nodes.StructOutput[[]vector3.Float64]
- func (n SelectFromMeshNode) Position() nodes.StructOutput[[]vector3.Float64]
- func (n SelectFromMeshNode) TexCoord() nodes.StructOutput[[]vector2.Float64]
- func (n SelectFromMeshNode) Topology() nodes.StructOutput[Topology]
- type SetAttribute3DNode
- type Topology
- type TopologyNode
- type Transformer
- type Tri
- func (t Tri) Area3D(attr string) float64
- func (t Tri) Average(attr string) vector3.Float64
- func (t Tri) BoundingBox(attr string) geometry.AABB
- func (t Tri) Bounds() geometry.AABB
- func (t Tri) ClosestPoint(attr string, p vector3.Float64) vector3.Float64
- func (t Tri) L1(attr string) geometry.Line3D
- func (t Tri) L2(attr string) geometry.Line3D
- func (t Tri) L3(attr string) geometry.Line3D
- func (t Tri) LineIntersects(line geometry.Line3D) (vector3.Float64, bool)
- func (t Tri) Normal(attr string) vector3.Float64
- func (t Tri) P1() int
- func (t Tri) P1Vec1Attr(attr string) float64
- func (t Tri) P1Vec2Attr(attr string) vector2.Float64
- func (t Tri) P1Vec3Attr(attr string) vector3.Float64
- func (t Tri) P2() int
- func (t Tri) P2Vec1Attr(attr string) float64
- func (t Tri) P2Vec2Attr(attr string) vector2.Float64
- func (t Tri) P2Vec3Attr(attr string) vector3.Float64
- func (t Tri) P3() int
- func (t Tri) P3Vec1Attr(attr string) float64
- func (t Tri) P3Vec2Attr(attr string) vector2.Float64
- func (t Tri) P3Vec3Attr(attr string) vector3.Float64
- func (t Tri) Plane(attr string) geometry.Plane
- func (t Tri) PointInSide(p vector3.Float64) bool
- func (t Tri) RandomSample(attr string, rand *rand.Rand) vector3.Float64
- func (t Tri) RayIntersects(ray geometry.Ray) (vector3.Float64, bool)
- func (t Tri) Scope(attr string) trees.Element
- func (t Tri) UniformSample(attr string, in vector2.Float64) vector3.Float64
- func (t Tri) UniqueVertices() bool
- type VertexLUT
- func (vLUT VertexLUT) AddLookup(from, to int)
- func (vLUT VertexLUT) Count(v int) int
- func (vLUT VertexLUT) Link(v1, v2 int)
- func (vLUT VertexLUT) Lookup(v int) map[int]struct{}
- func (vLUT VertexLUT) Remove(v int) map[int]struct{}
- func (vLUT VertexLUT) RemoveLink(v1, v2 int)
- func (vLUT VertexLUT) RemoveLookup(from, to int)
- func (vLUT VertexLUT) RemoveVertex(v int)
Constants ¶
const ( PositionAttribute = "Position" NormalAttribute = "Normal" ColorAttribute = "Color" TexCoordAttribute = "TexCoord" ClassAttribute = "Class" IntensityAttribute = "Intensity" JointAttribute = "Joint" WeightAttribute = "Weight" ScaleAttribute = "Scale" RotationAttribute = "Rotation" OpacityAttribute = "Opacity" FDCAttribute = "FDC" )
Variables ¶
This section is empty.
Functions ¶
func LowDiscrepancySample ¶ added in v0.27.0
Types ¶
type AttributeNode ¶ added in v0.25.0
type AttributeNode struct{}
func (AttributeNode) Inputs ¶ added in v0.25.0
func (AttributeNode) Inputs() map[string]nodes.InputPort
func (AttributeNode) Name ¶ added in v0.25.0
func (AttributeNode) Name() string
func (*AttributeNode) Outputs ¶ added in v0.25.0
func (p *AttributeNode) Outputs() map[string]nodes.OutputPort
type Line ¶
type Line struct {
// contains filtered or unexported fields
}
func (Line) ClosestPoint ¶
func (Line) P1 ¶ added in v0.2.0
P1 is the first point on our triangle, which is an index to the vertices array of a mesh
type MapEntryNode ¶ added in v0.25.0
func (MapEntryNode[T]) Out ¶ added in v0.25.0
func (men MapEntryNode[T]) Out() nodes.StructOutput[MapEntry[T]]
type Mesh ¶
type Mesh struct {
// contains filtered or unexported fields
}
func EmptyMesh ¶
Creates a new mesh with the specified topology that has no vertices or attribute data
func EmptyPointcloud ¶ added in v0.15.0
func EmptyPointcloud() Mesh
Creates a new mesh with point topology that has no vertices or attribute data
func NewLineStripMesh ¶
func NewMesh ¶
New Mesh creates a new mesh with the specified topology with all empty attribute data arrays stripped.
func NewPointCloud ¶
func NewTriangleMesh ¶ added in v0.8.0
NewTriangleMesh creates a new triangle mesh with all empty attribute data arrays stripped.
func (Mesh) AttributeLength ¶
func (Mesh) ClearAttributeData ¶ added in v0.8.0
func (Mesh) CopyFloat1Attribute ¶ added in v0.7.0
func (Mesh) CopyFloat2Attribute ¶ added in v0.7.0
func (Mesh) CopyFloat3Attribute ¶ added in v0.7.0
func (Mesh) CopyFloat4Attribute ¶ added in v0.7.0
func (Mesh) Float1Attribute ¶ added in v0.8.0
func (m Mesh) Float1Attribute(attr string) *iter.ArrayIterator[float64]
func (Mesh) Float1Attributes ¶
func (Mesh) Float2Attribute ¶ added in v0.8.0
func (Mesh) Float2Attributes ¶
func (Mesh) Float3Attribute ¶ added in v0.8.0
func (Mesh) Float3Attributes ¶
func (Mesh) Float4Attribute ¶ added in v0.8.0
func (Mesh) Float4Attributes ¶ added in v0.5.0
func (Mesh) HasFloat1Attribute ¶
func (Mesh) HasFloat2Attribute ¶
func (Mesh) HasFloat3Attribute ¶
func (Mesh) HasFloat4Attribute ¶ added in v0.5.0
func (Mesh) HasVertexAttribute ¶
func (Mesh) ModifyFloat1Attribute ¶
func (Mesh) ModifyFloat1AttributeParallel ¶
func (Mesh) ModifyFloat1AttributeParallelWithPoolSize ¶
func (Mesh) ModifyFloat2Attribute ¶
func (Mesh) ModifyFloat2AttributeParallel ¶
func (Mesh) ModifyFloat2AttributeParallelWithPoolSize ¶
func (Mesh) ModifyFloat3Attribute ¶
func (Mesh) ModifyFloat3AttributeParallel ¶
func (Mesh) ModifyFloat3AttributeParallelWithPoolSize ¶
func (Mesh) OctTreeWithAttributeAndDepth ¶ added in v0.3.0
func (Mesh) PrimitiveCount ¶
func (Mesh) Rotate ¶
func (m Mesh) Rotate(q quaternion.Quaternion) Mesh
func (Mesh) ScanFloat1Attribute ¶
func (Mesh) ScanFloat1AttributeParallel ¶
func (Mesh) ScanFloat1AttributeParallelWithPoolSize ¶
func (Mesh) ScanFloat2Attribute ¶
func (Mesh) ScanFloat2AttributeParallel ¶
func (Mesh) ScanFloat2AttributeParallelWithPoolSize ¶
func (Mesh) ScanFloat3Attribute ¶
func (Mesh) ScanFloat3AttributeParallel ¶
func (Mesh) ScanFloat3AttributeParallelWithPoolSize ¶
func (Mesh) ScanFloat4Attribute ¶ added in v0.5.0
func (Mesh) ScanPrimitivesParallel ¶
func (Mesh) ScanPrimitivesParallelWithPoolSize ¶
func (Mesh) SetFloat1Data ¶ added in v0.5.0
func (Mesh) SetFloat2Attribute ¶
func (Mesh) SetFloat2Data ¶ added in v0.5.0
func (Mesh) SetFloat3Attribute ¶
func (Mesh) SetFloat3Data ¶ added in v0.5.0
func (Mesh) SetFloat4Attribute ¶ added in v0.5.0
func (Mesh) SetFloat4Data ¶ added in v0.5.0
func (Mesh) SetIndices ¶ added in v0.8.0
func (Mesh) ToPointCloud ¶ added in v0.8.0
Transforms the mesh into having a point topology. All original indice information is dropped and is replaced by a flat reference to all attribute data previously defined
func (Mesh) Transform ¶ added in v0.8.0
func (m Mesh) Transform(ops ...Transformer) Mesh
func (Mesh) VertexNeighborTable ¶
type NewMeshNode ¶ added in v0.25.0
type NewMeshNode struct { Topology nodes.Output[Topology] Indices nodes.Output[[]int] Float1Data []nodes.Output[MapEntry[[]float64]] Float2Data []nodes.Output[MapEntry[[]vector2.Float64]] Float3Data []nodes.Output[MapEntry[[]vector3.Float64]] Float4Data []nodes.Output[MapEntry[[]vector4.Float64]] }
func (NewMeshNode) Mesh ¶ added in v0.25.0
func (nmn NewMeshNode) Mesh() nodes.StructOutput[Mesh]
type Point ¶
type Point struct {
// contains filtered or unexported fields
}
func (Point) ClosestPoint ¶
type SelectFromMeshNode ¶ added in v0.25.0
func (SelectFromMeshNode) Color ¶ added in v0.25.0
func (n SelectFromMeshNode) Color() nodes.StructOutput[[]vector3.Float64]
func (SelectFromMeshNode) Float2 ¶ added in v0.25.0
func (n SelectFromMeshNode) Float2(attr string) []vector2.Float64
func (SelectFromMeshNode) Float3 ¶ added in v0.25.0
func (n SelectFromMeshNode) Float3(attr string) []vector3.Float64
func (SelectFromMeshNode) Indices ¶ added in v0.25.0
func (n SelectFromMeshNode) Indices() nodes.StructOutput[[]int]
func (SelectFromMeshNode) Normal ¶ added in v0.25.0
func (n SelectFromMeshNode) Normal() nodes.StructOutput[[]vector3.Float64]
func (SelectFromMeshNode) Position ¶ added in v0.25.0
func (n SelectFromMeshNode) Position() nodes.StructOutput[[]vector3.Float64]
func (SelectFromMeshNode) TexCoord ¶ added in v0.25.0
func (n SelectFromMeshNode) TexCoord() nodes.StructOutput[[]vector2.Float64]
func (SelectFromMeshNode) Topology ¶ added in v0.25.0
func (n SelectFromMeshNode) Topology() nodes.StructOutput[Topology]
type SetAttribute3DNode ¶ added in v0.30.0
type SetAttribute3DNode struct { Mesh nodes.Output[Mesh] Attribute nodes.Output[string] Data nodes.Output[[]vector3.Float64] }
func (SetAttribute3DNode) Out ¶ added in v0.30.0
func (n SetAttribute3DNode) Out() nodes.StructOutput[Mesh]
type TopologyNode ¶ added in v0.25.0
type TopologyNode struct{}
func (TopologyNode) Inputs ¶ added in v0.25.0
func (TopologyNode) Inputs() map[string]nodes.InputPort
func (TopologyNode) Name ¶ added in v0.25.0
func (TopologyNode) Name() string
func (*TopologyNode) Outputs ¶ added in v0.25.0
func (p *TopologyNode) Outputs() map[string]nodes.OutputPort
type Transformer ¶ added in v0.8.0
type Tri ¶
type Tri struct {
// contains filtered or unexported fields
}
Tri provides utility functions to a specific underlying mesh
func (Tri) LineIntersects ¶ added in v0.3.0
func (Tri) P1 ¶
P1 is the first point on our triangle, which is an index to the vertices array of a mesh
func (Tri) P1Vec1Attr ¶ added in v0.4.0
func (Tri) P2 ¶
P2 is the second point on our triangle, which is an index to the vertices array of a mesh
func (Tri) P2Vec1Attr ¶ added in v0.4.0
func (Tri) P3 ¶
P3 is the third point on our triangle, which is an index to the vertices array of a mesh
func (Tri) P3Vec1Attr ¶ added in v0.4.0
func (Tri) PointInSide ¶
https://gdbooks.gitbooks.io/3dcollisions/content/Chapter4/point_in_triangle.html
func (Tri) RandomSample ¶ added in v0.27.0
func (Tri) RayIntersects ¶ added in v0.3.0
func (Tri) UniformSample ¶ added in v0.27.0
func (Tri) UniqueVertices ¶
Valid determines whether or not the contains 3 unique vertices.