Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Algorithm ¶
type Algorithm struct {
// contains filtered or unexported fields
}
Algorithm builds a surface by moving along it's border and making lines as long as possible.
PARAMETERS: - minAngle limits the angle between tangents to generate a new vertex (maximum value is 90º, expressed in radians). - step is the distance between surface checks and is useful for avoiding skipping small features that return to the original tangent. Keep it as close to 0, as possible (as long as performance is good enough). - normalEps should generally be as close to 0 as possible (considering numerical inaccuracies). - numNeighbors is used for duplicate surface detection and vertex merging (should be as high as possible as long as performance allows it). - scanSurfaceCells is required when there are multiple surfaces, as the algorithm needs to find each one of them to properly generate them. - scanSurfaceDistSq is the minimum distance between surfaces to consider them as different (keep as high as your surfaces allow in order to avoid double surfaces) - surf* see fallToSurface. - rng is only used for fallToSurface (to solve 0 gradient by pushing in a random direction).
func New ¶
func New(minAngle float64, step float64, normalEps float64, scanSurfaceCells sdf.V2i, scanSurfaceDistSq float64, numNeighbors int, surfHitEps float64, surfStepSize float64, surfMaxSteps int, randSource rand.Source) *Algorithm
New see Algorithm.
func NewDefault ¶
func NewDefault() *Algorithm
NewDefault values may change at any time. See NewSimple.
Click to show internal directories.
Click to hide internal directories.