bounding

package
v0.0.0-...-1a87af9 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: CC0-1.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Box

type Box struct {
	X, Y interval.In
}

Box with axis aligned edges.

func NewBox

func NewBox(vp []maf.Vec2) Box

NewBox creates a new bounding Box around the given vertices.

func (Box) Centre

func (b Box) Centre() maf.Vec2

Centre of the box.

func (Box) Corners

func (b Box) Corners() Corners

Corners of the box.

func (Box) Expand

func (b Box) Expand(l float64) Box

Expand the width and height of the box by the given length.

The expansion occurs symmetrically about its centre.

type BoxWithZ

type BoxWithZ struct {
	X, Y interval.In
	Z    float64
}

BoxWithZ is a box with axis aligned edges that contains points which have a constant z value.

func NewBoxWithZ

func NewBoxWithZ(vp []maf.Vec) BoxWithZ

NewBoxWithZ creates a new bounding Box around the given vertices which shall be in a plane parallel to the Z=0 plane.

func (BoxWithZ) Corners

func (b BoxWithZ) Corners() [4]maf.Vec

Corners of the box in anticlockwise order around the centre starting with the top right corner.

func (BoxWithZ) Expand

func (b BoxWithZ) Expand(l float64) BoxWithZ

Expand the box in both axis directions by the given positive length.

type Corners

type Corners struct {
	TopRight, TopLeft, BottomLeft, BottomRight maf.Vec2
}

Corners of a box.

Jump to

Keyboard shortcuts

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