qhull

package
v0.0.0-...-9c08f4d Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2017 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateEpsilon

func CalculateEpsilon(extremums [6]glm.Vec3) float32

CalculateEpsilon calculates the epsilon the algorithm should use given the extremums of the point cloud [minx, miny, minz, maxx, maxy, maxz]

func CleanVisited

func CleanVisited(faces []*Face)

CleanVisited clears the visited field of all the faces of the convex hull.

func FindExtremums

func FindExtremums(points []glm.Vec3) (extremumIndices [6]int, extremums [6]glm.Vec3)

FindExtremums returns the 6 indices and 6 vec3 of the extremums for each axis fomatted [minx, miny, minz, maxx, maxy, maxz]

func NextConflict

func NextConflict(faces []*Face) (int, int)

NextConflict returns the index of the face and conflict of the conflict with the highest distance from it's associated plane. or -1,-1 if nothing else is left

Types

type Conflict

type Conflict struct {
	Distance float32
	Index    int
}

Conflict is a vertex that isn't inside the convex hull yet

type Edge

type Edge struct {
	Tail             int
	Prev, Next, Twin *Edge
	Face             *Face
}

Edge is a quickhull utility struct for edges

func FindHorizon

func FindHorizon(face *Face, point *glm.Vec3) []*Edge

FindHorizon finds the horizon of the conflict

type Face

type Face struct {
	Edges     [3]*Edge
	Faces     [3]*Face
	Vertices  [3]int
	Conflicts []Conflict

	// tmp variables
	Visited bool
	Normal  glm.Vec3
	Point   glm.Vec3
}

Face is a quickhull utility struct for faces

func BuildInitialTetrahedron

func BuildInitialTetrahedron(a, b, c, d int, points []glm.Vec3) []*Face

BuildInitialTetrahedron builds the initial tetrahedron from the given 4 indices

Jump to

Keyboard shortcuts

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