halfedge

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

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

Go to latest
Published: Feb 25, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Face

type Face struct {
	HalfEdge int
	Patch    int
}

type HalfEdge

type HalfEdge struct {
	Origin    int
	Face      int
	Next      int
	Prev      int
	Twin      int
	IsFeature bool
}

func (HalfEdge) IsBoundary

func (h HalfEdge) IsBoundary() bool

Return true if the half edge is on the boundary (no twin).

type HalfEdgeMesh

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

Index-based half edge mesh data structure for manifold polygonal meshes.

func NewHalfEdgeMesh

func NewHalfEdgeMesh(source meshx.MeshReader) (*HalfEdgeMesh, error)

Construct a HalfEdgeMesh from a MeshReader.

func NewHalfEdgeMeshFromOBJ

func NewHalfEdgeMeshFromOBJ(reader io.Reader) (*HalfEdgeMesh, error)

Construct a HalfEdgeMesh from an OBJ file reader.

func NewHalfEdgeMeshFromOBJPath

func NewHalfEdgeMeshFromOBJPath(path string) (*HalfEdgeMesh, error)

Construct a HalfEdgeMesh from an OBJ file path.

func (*HalfEdgeMesh) ClearFeatureEdges

func (m *HalfEdgeMesh) ClearFeatureEdges()

Mark all half edges as non-feature edges.

func (*HalfEdgeMesh) ComputeFeatureEdges

func (m *HalfEdgeMesh) ComputeFeatureEdges(threshold float64)

Mark the half edges exceeding the angle threshold between faces. The angle threshold is specified in radians.

func (*HalfEdgeMesh) Extract

func (m *HalfEdgeMesh) Extract(faces []int) *HalfEdgeMesh

Extract the faces into a new mesh.

func (*HalfEdgeMesh) ExtractPatches

func (m *HalfEdgeMesh) ExtractPatches(patches []int) *HalfEdgeMesh

Extract the patches into a new mesh.

func (*HalfEdgeMesh) GetAABB

func (m *HalfEdgeMesh) GetAABB() meshx.AABB

Get the axis-aligned bounding box.

func (*HalfEdgeMesh) GetComponents

func (m *HalfEdgeMesh) GetComponents() [][]int

Get the isolated components (faces).

func (*HalfEdgeMesh) GetFace

func (m *HalfEdgeMesh) GetFace(index int) Face

Get a face by index.

func (*HalfEdgeMesh) GetFaceHalfEdges

func (m *HalfEdgeMesh) GetFaceHalfEdges(index int) []int

Get the half edges of a face.

func (*HalfEdgeMesh) GetFaceNeighbors

func (m *HalfEdgeMesh) GetFaceNeighbors(index int) []int

Get the neighboring faces of a face.

func (*HalfEdgeMesh) GetFaceNormal

func (m *HalfEdgeMesh) GetFaceNormal(index int) meshx.Vector

Get the normal vector of a face.

func (*HalfEdgeMesh) GetFaceVertices

func (m *HalfEdgeMesh) GetFaceVertices(index int) []int

Get the vertices of a face.

func (*HalfEdgeMesh) GetFeatureEdges

func (m *HalfEdgeMesh) GetFeatureEdges() []int

Get the the half edges marked as a feature.

func (*HalfEdgeMesh) GetHalfEdge

func (m *HalfEdgeMesh) GetHalfEdge(index int) HalfEdge

Get a half edge by index.

func (*HalfEdgeMesh) GetHalfEdgeFaceAngle

func (m *HalfEdgeMesh) GetHalfEdgeFaceAngle(index int) float64

Get the face angle between two faces sharing a half edge.

func (*HalfEdgeMesh) GetNumberOfFaces

func (m *HalfEdgeMesh) GetNumberOfFaces() int

Get the number of faces.

func (*HalfEdgeMesh) GetNumberOfHalfEdges

func (m *HalfEdgeMesh) GetNumberOfHalfEdges() int

Get the number of half edges.

func (*HalfEdgeMesh) GetNumberOfPatches

func (m *HalfEdgeMesh) GetNumberOfPatches() int

Get the number of patches.

func (*HalfEdgeMesh) GetNumberOfVertices

func (m *HalfEdgeMesh) GetNumberOfVertices() int

Get the number of vertices.

func (*HalfEdgeMesh) GetPatch

func (m *HalfEdgeMesh) GetPatch(index int) Patch

Get a patch by index.

func (*HalfEdgeMesh) GetPatchFaces

func (m *HalfEdgeMesh) GetPatchFaces(index int) []int

Get the faces of a patch.

func (*HalfEdgeMesh) GetVertex

func (m *HalfEdgeMesh) GetVertex(index int) Vertex

Get a vertex by index.

func (*HalfEdgeMesh) GetVertexFaces

func (m *HalfEdgeMesh) GetVertexFaces(index int) []int

Get the faces using a vertex.

func (*HalfEdgeMesh) GetVertexIncomingHalfEdges

func (m *HalfEdgeMesh) GetVertexIncomingHalfEdges(index int) []int

Get the incoming half edges of a vertex.

func (*HalfEdgeMesh) GetVertexOutgoingHalfEdges

func (m *HalfEdgeMesh) GetVertexOutgoingHalfEdges(index int) []int

Get the outgoing half edges of a vertex.

func (*HalfEdgeMesh) IsClosed

func (m *HalfEdgeMesh) IsClosed() bool

Return true if there are no open edges.

func (*HalfEdgeMesh) IsConsistent

func (m *HalfEdgeMesh) IsConsistent() bool

Return true if all neighboring faces share the same orientation.

func (*HalfEdgeMesh) IsConsistentWithReference

func (m *HalfEdgeMesh) IsConsistentWithReference(reference meshx.Vector) bool

Return true if all neighboring faces share the same orientation for each component relative to the reference.

func (*HalfEdgeMesh) Merge

func (m *HalfEdgeMesh) Merge(n *HalfEdgeMesh)

Merge two meshes together (in place).

func (*HalfEdgeMesh) Orient

func (m *HalfEdgeMesh) Orient()

Orient the mesh such that the faces of each component are consistent.

func (*HalfEdgeMesh) OrientWithReference

func (m *HalfEdgeMesh) OrientWithReference(reference meshx.Vector) error

Orient the mesh such that all the faces are consistently oriented relative to a reference point considered inside the domain.

func (*HalfEdgeMesh) SetFeatureEdge

func (m *HalfEdgeMesh) SetFeatureEdge(index int, isFeature bool)

Set a half edge as a feature (or not) manually.

func (*HalfEdgeMesh) Translate

func (m *HalfEdgeMesh) Translate(offset meshx.Vector)

Translate the mesh by a Vector.

func (*HalfEdgeMesh) WriteOBJ

func (m *HalfEdgeMesh) WriteOBJ(writer io.Writer) error

Write the HalfEdgeMesh to an OBJ file.

func (*HalfEdgeMesh) WriteOBJFeatureEdges

func (m *HalfEdgeMesh) WriteOBJFeatureEdges(writer io.Writer) error

Write the HalfEdgeMesh feature edges to an OBJ file.

func (*HalfEdgeMesh) WriteOBJFeatureEdgesToPath

func (m *HalfEdgeMesh) WriteOBJFeatureEdgesToPath(path string) error

Write the HalfEdgeMesh feature edges to an OBJ file path.

func (*HalfEdgeMesh) WriteOBJToPath

func (m *HalfEdgeMesh) WriteOBJToPath(path string) error

Write the HalfEdgeMesh to an OBJ file path.

type Patch

type Patch struct {
	Name string
}

type Vertex

type Vertex struct {
	Point    meshx.Vector
	HalfEdge int
}

Jump to

Keyboard shortcuts

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