Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DualContouringV1 ¶
type DualContouringV1 struct { // Simplify: how much to simplify (if >=0). // NOTE: Meshing might fail with simplification enabled (FIXME), // but the mesh might can still simplified later using external tools (the main benefit of dual contouring is sharp edges). Simplify float64 // RCond [0, 1) is the parameter that controls the accuracy of sharp edges, with lower being more accurate // but it can cause instability leading to large wrong triangles. Leave the default if unsure. RCond float64 // LockVertices makes sure each vertex stays in its voxel, avoiding small or bad triangles that may be generated // otherwise, but it also may remove some sharp edges. LockVertices bool }
DualContouringV1 renders using dual contouring (octree sampling, sharp edges!, automatic simplification)
func NewDualContouringV1 ¶
func NewDualContouringV1(simplify float64, RCond float64, lockVertices bool) *DualContouringV1
NewDualContouringV1 see DualContouringV1
type DualContouringV2 ¶
type DualContouringV2 struct { // FarAway fixes bad triangles that may be generated by limiting the maximum vertex displacement // from the voxel's center to the specified amount (manhattan distance), and clamping if exceeded. FarAway float64 // CenterPush may generate a better mesh if larger at the cost of less sharp edges. CenterPush float64 // see sdf.Raycast3 RaycastScaleAndSigmoid, RaycastStepScale, RaycastEpsilon float64 // see sdf.Raycast3 RaycastMaxSteps int // contains filtered or unexported fields }
DualContouringV2 renders a SDF using dual contouring (sharp edges!). You may need to test several settings to find the best for your purposes.
func NewDualContouringDefault ¶
func NewDualContouringDefault() *DualContouringV2
NewDualContouringDefault uses somewhat safe defaults that sacrifice performance, you may reduce max steps and fix other parameters if facing errors
func NewDualContouringV2 ¶
func NewDualContouringV2(farAway float64, centerPush float64, raycastScaleAndSigmoid, raycastStepSize float64, raycastEpsilon float64, raycastMaxSteps int) *DualContouringV2
NewDualContouringV2 see DualContouringV2 and its fields
Click to show internal directories.
Click to hide internal directories.