diff options
author | xengineering <me@xengineering.eu> | 2022-03-16 20:54:19 +0100 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2022-03-17 09:38:08 +0100 |
commit | 77901bb05dbf75e92dd8974ccb23053bb3b2dabf (patch) | |
tree | 386cfb941cb338d82ea607f28334705ce4c9d83e /geometry.go | |
parent | 8742e1207eb12091eeb061485072dcc2d70c0a52 (diff) | |
download | stlscope-77901bb05dbf75e92dd8974ccb23053bb3b2dabf.tar stlscope-77901bb05dbf75e92dd8974ccb23053bb3b2dabf.tar.zst stlscope-77901bb05dbf75e92dd8974ccb23053bb3b2dabf.zip |
Add docstrings
Diffstat (limited to 'geometry.go')
-rw-r--r-- | geometry.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/geometry.go b/geometry.go index 80420a6..fdbbcef 100644 --- a/geometry.go +++ b/geometry.go @@ -6,22 +6,23 @@ import ( "github.com/go-gl/mathgl/mgl32" ) -// representation of a three-dimensional point in space +// Point represents a three-dimensional point in space. type Point struct { scalars [3]float32 // x = scalars[0], y = scalars[1], z = scalars[2] } -// a triangle consists of three points +// Triangle is a geometrical triangle defined by three points. type Triangle struct { points [3]*Point } -// a surface is made of a slice of triangles +// Surface is a slice of triangles. type Surface struct { triangles []*Triangle } -// return a transformation to view the whole centered surface +// getHomeView returns a transformation which shows the given Surface in the +// center of the window. func (s Surface) getHomeView() mgl32.Mat4 { // evaluating the smallest and biggest values for x,y,z of the surface |