Skip to content

Commit d4eb535

Browse files
authored
Procjam 2025 (#127)
* Procjam 2025 * Torus bug fix * Snow globe * lil fixes
1 parent 7fb3c72 commit d4eb535

File tree

13 files changed

+685
-845
lines changed

13 files changed

+685
-845
lines changed

drawing/texturing/noise.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ func texture(
2222
Seed nodes.Output[float64],
2323
Polar nodes.Output[bool],
2424
) {
25-
width := nodes.TryGetOutputValue(out, Width, 1)
26-
height := nodes.TryGetOutputValue(out, Height, 1)
25+
width := nodes.TryGetOutputValue(out, Width, 64)
26+
height := nodes.TryGetOutputValue(out, Height, 64)
2727

2828
if width <= 0 {
2929
out.CaptureError(fmt.Errorf("invalid width dimension: %d", width))

examples/chill/main.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package main
33
import (
44
"encoding/json"
55
"fmt"
6-
"io/ioutil"
76
"log"
87
"math"
98
"math/rand"
@@ -425,7 +424,7 @@ func main() {
425424

426425
if ctx.IsSet("trail") {
427426

428-
trailFileData, err := ioutil.ReadFile(ctx.String("trail"))
427+
trailFileData, err := os.ReadFile(ctx.String("trail"))
429428
if err != nil {
430429
return err
431430
}

generator/edit/examples/snowglobe.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

modeling/marching/canvas.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,14 @@ func interpolateVerts(v1, v2 vector3.Float64, v1v, v2v, cutoff float64) vector3.
3737

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

41-
if foundIndex, ok := data.vertLookup[distritized]; ok {
42+
if foundIndex, ok := data.vertLookup[key]; ok {
4243
return foundIndex
4344
}
4445

4546
index := len(data.verts)
46-
data.vertLookup[distritized] = index
47+
data.vertLookup[key] = index
4748
data.verts = append(data.verts, vert)
4849
return index
4950
}
@@ -430,7 +431,7 @@ func (d *MarchingCanvas) AddFieldParallel2(field Field) {
430431
type workingData struct {
431432
tris []int
432433
verts []vector3.Float64
433-
vertLookup map[vector3.Int]int
434+
vertLookup map[vector3.Int32]int
434435
}
435436

436437
func (d *MarchingCanvas) marchFloat1BlockPosition(
@@ -464,7 +465,7 @@ func (d *MarchingCanvas) marchFloat1BlockPosition(
464465
marchingWorkingData := &workingData{
465466
tris: make([]int, 0),
466467
verts: make([]vector3.Float64, 0),
467-
vertLookup: make(map[vector3.Int]int),
468+
vertLookup: make(map[vector3.Int32]int),
468469
}
469470
blockIndex := section.positions[blockPosition]
470471

0 commit comments

Comments
 (0)