sdfexp

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

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

Go to latest
Published: Feb 13, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LEAF = iota
	X_CLIP
	Y_CLIP
	Z_CLIP
)
View Source
const (
	FACE   = 0
	EDGE   = 1 << 30
	VERTEX = 2 << 30
)

Variables

This section is empty.

Functions

func UniformTetrahedronMesh

func UniformTetrahedronMesh(resolution float64, s sdf.SDF3) (nodes []r3.Vec, tetras [][4]int)

UniformTetrahedronMesh assembles a volumetric tetrahedron mesh that tries its very best to encapsulate the sdf model. For best results mesh smooth parts that make good use of rounding, MinFunc and MaxFunc in Union, Difference and Intersect operations.

Types

type BIH

type BIH struct {
	Mesh
	// contains filtered or unexported fields
}

TODO figure out what to make public

func ImportModelV2

func ImportModelV2(model []r3.Triangle, tol float64) (*BIH, error)

func (*BIH) Bounds

func (b *BIH) Bounds() r3.Box

func (*BIH) DistNearestTri

func (b *BIH) DistNearestTri(target r3.Vec) float64

func (*BIH) Evaluate

func (b *BIH) Evaluate(p r3.Vec) float64

type ImportedSDF3

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

func ImportModel

func ImportModel(model []r3.Triangle, vertexTolOrZero float64) (ImportedSDF3, error)

ImportModel instantiates an SDF3 from a set of triangles defining a manifold surface. It can be used to import SDFs from triangle files such as STL and 3MF files. It will choose shared vertices among triangles using vertexTol. vertexTol should be of the order of 1/1000th of the size of the smallest triangle in the model. If set to 0 then it is inferred automatically.

func (ImportedSDF3) Bounds

func (s ImportedSDF3) Bounds() r3.Box

func (ImportedSDF3) Evaluate

func (s ImportedSDF3) Evaluate(q r3.Vec) float64

type Mesh

type Mesh struct {
	Edge_adj map[[2]int]int // edge to triangles mapping for adjacency
	Indices  [][3]int       // indices into the vertex list
	Vertices []r3.Vec
	Bb       r3.Box
}

Jump to

Keyboard shortcuts

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