marching

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const BLEND_SIZE = 0.05

Variables

This section is empty.

Functions

func FieldIntersection

func FieldIntersection(fields ...sample.Vec3ToFloat) sample.Vec3ToFloat

func LookupOrAdd

func LookupOrAdd(data *workingData, vert vector3.Float64) int

Types

type Axis

type Axis int
const (
	XAxis Axis = iota
	YAxis
	ZAxis
)

type Field

type Field struct {
	Domain          geometry.AABB
	Float1Functions map[string]sample.Vec3ToFloat
	Float2Functions map[string]sample.Vec3ToVec2
	Float3Functions map[string]sample.Vec3ToVec3
}

func Box

func Box(pos vector3.Float64, size vector3.Float64, strength float64) Field

func CombineFields

func CombineFields(fields ...Field) Field

func Line

func Line(start, end vector3.Float64, radius, strength float64) Field

func Mesh

func Mesh(mesh modeling.Mesh, radius, strength float64) Field

func MirrorAxis

func MirrorAxis(field Field, axisToMirror Axis) Field

func MultiSegmentLine

func MultiSegmentLine(linePoints []vector3.Float64, radius, strength float64) Field

func Sphere

func Sphere(pos vector3.Float64, radius, strength float64) Field

func Subtract added in v0.9.0

func Subtract(base, subtraction Field) Field

func VarryingThicknessLine added in v0.9.0

func VarryingThicknessLine(linePoints []sdf.LinePoint, strength float64) Field

func (Field) Combine

func (f Field) Combine(otherFields ...Field) Field

func (Field) March

func (f Field) March(atr string, cubesPerUnit, cutoff float64) modeling.Mesh

func (Field) Modify

func (f Field) Modify(attribute string, other Field, modifier func(a, b sample.Vec3ToFloat) sample.Vec3ToFloat) Field

func (Field) SetFloat3Attribute

func (f Field) SetFloat3Attribute(atr string, f3tf3 sample.Vec3ToVec3) Field

func (Field) Translate

func (f Field) Translate(translation vector3.Float64) Field

func (Field) Voxelize added in v0.5.0

func (f Field) Voxelize(atr string, cubesPerUnit, cutoff float64) []vector3.Float64

func (Field) WithColor

func (f Field) WithColor(c color.RGBA) Field

type MarchingCanvas

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

func NewMarchingCanvas

func NewMarchingCanvas(cubesPerUnit float64) *MarchingCanvas

func (*MarchingCanvas) AddField

func (d *MarchingCanvas) AddField(field Field)

func (*MarchingCanvas) AddFieldParallel

func (d *MarchingCanvas) AddFieldParallel(field Field)

func (MarchingCanvas) March

func (d MarchingCanvas) March(cutoff float64) modeling.Mesh

March is shorthand for MarchOnAttribute(modeling.PositionAttribute, cutoff)

func (MarchingCanvas) MarchOnAttribute

func (d MarchingCanvas) MarchOnAttribute(attribute string, cutoff float64) modeling.Mesh

func (MarchingCanvas) MarchOnAttributeParallel

func (d MarchingCanvas) MarchOnAttributeParallel(attribute string, cutoff float64) modeling.Mesh

func (MarchingCanvas) MarchParallel

func (d MarchingCanvas) MarchParallel(cutoff float64) modeling.Mesh

type MarchingDataType

type MarchingDataType int64
const (
	Float1 MarchingDataType = iota
	Float2
	Float3
)

Jump to

Keyboard shortcuts

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