summaryrefslogtreecommitdiff
path: root/geometry.go
diff options
context:
space:
mode:
authorxengineering <mail2xengineering@protonmail.com>2021-05-25 11:40:23 +0200
committerxengineering <mail2xengineering@protonmail.com>2021-05-25 11:40:23 +0200
commite03455a979abf4444d4362dacbbf55c6915d3b69 (patch)
tree9aacd6948a4ab86d7ff2ecfb71dc17a1a9260cc4 /geometry.go
parentd6828f4039352a44a1389313ba856369932732e4 (diff)
downloadstlscope-e03455a979abf4444d4362dacbbf55c6915d3b69.tar
stlscope-e03455a979abf4444d4362dacbbf55c6915d3b69.tar.zst
stlscope-e03455a979abf4444d4362dacbbf55c6915d3b69.zip
Make Geometry Types iterable
Diffstat (limited to 'geometry.go')
-rw-r--r--geometry.go8
1 files changed, 2 insertions, 6 deletions
diff --git a/geometry.go b/geometry.go
index 3c3ba83..04896dc 100644
--- a/geometry.go
+++ b/geometry.go
@@ -4,16 +4,12 @@ package main
// representation of a three-dimensional point in space
type Point struct {
- x float32
- y float32
- z float32
+ scalars [3]float32 // x = scalars[0], y = scalars[1], z = scalars[2]
}
// a triangle consists of three points
type Triangle struct {
- a *Point
- b *Point
- c *Point
+ points [3]*Point
}
// a surface is made of a slice of triangles