Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions drawing/texturing/noise.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ func texture(
Seed nodes.Output[float64],
Polar nodes.Output[bool],
) {
width := nodes.TryGetOutputValue(out, Width, 1)
height := nodes.TryGetOutputValue(out, Height, 1)
width := nodes.TryGetOutputValue(out, Width, 64)
height := nodes.TryGetOutputValue(out, Height, 64)

if width <= 0 {
out.CaptureError(fmt.Errorf("invalid width dimension: %d", width))
Expand Down
3 changes: 1 addition & 2 deletions examples/chill/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"math"
"math/rand"
Expand Down Expand Up @@ -425,7 +424,7 @@ func main() {

if ctx.IsSet("trail") {

trailFileData, err := ioutil.ReadFile(ctx.String("trail"))
trailFileData, err := os.ReadFile(ctx.String("trail"))
if err != nil {
return err
}
Expand Down
1 change: 1 addition & 0 deletions generator/edit/examples/snowglobe.json

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions modeling/marching/canvas.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,14 @@ func interpolateVerts(v1, v2 vector3.Float64, v1v, v2v, cutoff float64) vector3.

func lookupOrAdd(data *workingData, vert vector3.Float64) int {
distritized := modeling.Vector3ToInt(vert, 4)
key := vector3.New(int32(distritized.X()), int32(distritized.Y()), int32(distritized.Z()))

if foundIndex, ok := data.vertLookup[distritized]; ok {
if foundIndex, ok := data.vertLookup[key]; ok {
return foundIndex
}

index := len(data.verts)
data.vertLookup[distritized] = index
data.vertLookup[key] = index
data.verts = append(data.verts, vert)
return index
}
Expand Down Expand Up @@ -430,7 +431,7 @@ func (d *MarchingCanvas) AddFieldParallel2(field Field) {
type workingData struct {
tris []int
verts []vector3.Float64
vertLookup map[vector3.Int]int
vertLookup map[vector3.Int32]int
}

func (d *MarchingCanvas) marchFloat1BlockPosition(
Expand Down Expand Up @@ -464,7 +465,7 @@ func (d *MarchingCanvas) marchFloat1BlockPosition(
marchingWorkingData := &workingData{
tris: make([]int, 0),
verts: make([]vector3.Float64, 0),
vertLookup: make(map[vector3.Int]int),
vertLookup: make(map[vector3.Int32]int),
}
blockIndex := section.positions[blockPosition]

Expand Down
Loading
Loading