Documentation
¶
Index ¶
- type Face
- type HalfEdge
- type HalfEdgeMesh
- func (m *HalfEdgeMesh) ClearFeatureEdges()
- func (m *HalfEdgeMesh) ComputeFeatureEdges(threshold float64)
- func (m *HalfEdgeMesh) Extract(faces []int) *HalfEdgeMesh
- func (m *HalfEdgeMesh) ExtractPatches(patches []int) *HalfEdgeMesh
- func (m *HalfEdgeMesh) GetAABB() meshx.AABB
- func (m *HalfEdgeMesh) GetComponents() [][]int
- func (m *HalfEdgeMesh) GetFace(index int) Face
- func (m *HalfEdgeMesh) GetFaceHalfEdges(index int) []int
- func (m *HalfEdgeMesh) GetFaceNeighbors(index int) []int
- func (m *HalfEdgeMesh) GetFaceNormal(index int) meshx.Vector
- func (m *HalfEdgeMesh) GetFaceVertices(index int) []int
- func (m *HalfEdgeMesh) GetFeatureEdges() []int
- func (m *HalfEdgeMesh) GetHalfEdge(index int) HalfEdge
- func (m *HalfEdgeMesh) GetHalfEdgeFaceAngle(index int) float64
- func (m *HalfEdgeMesh) GetNumberOfFaces() int
- func (m *HalfEdgeMesh) GetNumberOfHalfEdges() int
- func (m *HalfEdgeMesh) GetNumberOfPatches() int
- func (m *HalfEdgeMesh) GetNumberOfVertices() int
- func (m *HalfEdgeMesh) GetPatch(index int) Patch
- func (m *HalfEdgeMesh) GetPatchFaces(index int) []int
- func (m *HalfEdgeMesh) GetVertex(index int) Vertex
- func (m *HalfEdgeMesh) GetVertexFaces(index int) []int
- func (m *HalfEdgeMesh) GetVertexIncomingHalfEdges(index int) []int
- func (m *HalfEdgeMesh) GetVertexOutgoingHalfEdges(index int) []int
- func (m *HalfEdgeMesh) IsClosed() bool
- func (m *HalfEdgeMesh) IsConsistent() bool
- func (m *HalfEdgeMesh) IsConsistentWithReference(reference meshx.Vector) bool
- func (m *HalfEdgeMesh) Merge(n *HalfEdgeMesh)
- func (m *HalfEdgeMesh) Orient()
- func (m *HalfEdgeMesh) OrientWithReference(reference meshx.Vector) error
- func (m *HalfEdgeMesh) SetFeatureEdge(index int, isFeature bool)
- func (m *HalfEdgeMesh) Translate(offset meshx.Vector)
- func (m *HalfEdgeMesh) WriteOBJ(writer io.Writer) error
- func (m *HalfEdgeMesh) WriteOBJFeatureEdges(writer io.Writer) error
- func (m *HalfEdgeMesh) WriteOBJFeatureEdgesToPath(path string) error
- func (m *HalfEdgeMesh) WriteOBJToPath(path string) error
- type Patch
- type Vertex
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HalfEdge ¶
func (HalfEdge) IsBoundary ¶
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) 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.