quickhull

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FastRand

func FastRand(min, max int) int

func FastRandFloat64

func FastRandFloat64(precision, min, max float64) float64

Types

type ConvexHull

type ConvexHull struct {
	Vertices []shapes.Point
	Indices  []int
	// contains filtered or unexported fields
}

ConvexHull describe convex hull

func (ConvexHull) Triangles

func (hull ConvexHull) Triangles() [][3]shapes.Point

Triangles return triangles

type Face

type Face struct {
	HalfEdge int // Index of a bounding HalfEdge
}

Face of a half edge. See: https://www.openmesh.org/media/Documentations/OpenMesh-6.3-Documentation/a00010.html

type HalfEdge

type HalfEdge struct {
	EndVertex int // Index of end vertex
	Opp       int // Index of opposite HalfEdge
	Face      int // Index of Face it belongs to
	Next      int // Index of next HalfEdge
}

HalfEdge is a half edge. See: https://www.openmesh.org/media/Documentations/OpenMesh-6.3-Documentation/a00010.html

type HalfEdgeMesh

type HalfEdgeMesh struct {
	Vertices  []shapes.Point
	Faces     []Face
	HalfEdges []HalfEdge
}

HalfEdgeMesh is a mesh consisting of half edges. See: https://www.openmesh.org/media/Documentations/OpenMesh-6.3-Documentation/a00010.html

type QuickHull

type QuickHull struct {
	// contains filtered or unexported fields
}

QuickHull can be used to calculate the convex hull of a point cloud. See: https://en.wikipedia.org/wiki/Quickhull

func (*QuickHull) ConvexHull

func (qh *QuickHull) ConvexHull(
	pointCloud []shapes.Point,
	ccw bool,
	useOriginalIndices bool,
	epsilon float64,
) ConvexHull

ConvexHull calculates the convex hull of the given point cloud using the Quickhull algorithm. If epsilon is <= 0 a default value will be used.

func (*QuickHull) ConvexHullAsMesh

func (qh *QuickHull) ConvexHullAsMesh(pointCloud []shapes.Point, epsilon float64) HalfEdgeMesh

ConvexHullAsMesh calculates the convex hull of the given point cloud using the Quickhull algorithm and returns it as a HalfEdgeMesh. If epsilon is <= 0 a default value will be used.

Jump to

Keyboard shortcuts

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