geometry

package
v0.0.0-...-88a5242 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GenerateMeshOpt

type GenerateMeshOpt func(*Mesh)

func MeshHScaleOpt

func MeshHScaleOpt(hscale float64) GenerateMeshOpt

func MeshTextureCoordsOpt

func MeshTextureCoordsOpt(tc [][][2]float64) GenerateMeshOpt

func MeshVScaleOpt

func MeshVScaleOpt(vscale float64) GenerateMeshOpt

func MeshWindingOpt

func MeshWindingOpt(ccw bool) GenerateMeshOpt

type GenerateSurfaceOpt

type GenerateSurfaceOpt func(*Surface)

func SurfaceNorthToSouthOpt

func SurfaceNorthToSouthOpt(n2s bool) GenerateSurfaceOpt

func SurfaceResolutionOpt

func SurfaceResolutionOpt(res osgrid.Distance) GenerateSurfaceOpt

type Mesh

type Mesh struct {
	Vertices   [][3]float64
	TexCoords  [][2]float64
	Triangles  [][3]uint
	WindingCCW bool
	HScale     float64
	VScale     float64
	// contains filtered or unexported fields
}

func GenerateMesh

func GenerateMesh(s *Surface, opts ...GenerateMeshOpt) Mesh

type Surface

type Surface struct {
	Data       [][]float64
	Max, Min   float64
	Resolution osgrid.Distance
	// NorthToSouth is true if Data[0][0] is the North-West corner.
	// Otherwise, Data[0][0] is the South-West corner
	NorthToSouth bool
}

func GenerateSurface

func GenerateSurface(db osdata.Float64Database, centre osgrid.GridRef,
	width, height osgrid.Distance, opts ...GenerateSurfaceOpt) (Surface, error)

Note that this will generate one more row/column than you might expect, as points form the corners of regions of the surface, not the centres

func (*Surface) AdjustMax

func (s *Surface) AdjustMax(max float64)

Adjust the surface points so that 'max' becomes the new Max value

func (*Surface) Scale

func (s *Surface) Scale(scale float64)

Multiply all the points in the surface by scale

Jump to

Keyboard shortcuts

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