ImplicitFunc2d
ABSTRACT
Generates a 2D implicit function mesh based on specified parameters. We use the marching squares algorithm.
REMARK
In general, The granularity is not great and I do not recommend using this function in its current state
PARAMETERS
x_min | Minimum x-value for the function's domain |
x_max | Maximum x-value for the function's domain |
y_min | Minimum y-value for the function's domain |
y_max | Maximum y-value for the function's domain |
x_min | Minimum x-value for the function's domain |
x_max | Maximum x-value for the function's domain |
y_min | Minimum y-value for the function's domain |
y_max | Maximum y-value for the function's domain |
x_step | Step size for the x-coordinate. This dictates the granularity in the x direction. |
y_step | Step size for the y-coordinate. This dictates the granularity in the y direction. |
f(x,y) | The function f(x, y) that defines the 2D implicit function. This should a return a scalar. The generated contour is going to be the boundary of the where this function is <= 0. This may be unexpected as in many cases this adds lines along the boundary of the rectangle (even if the function would not actually be approximately zero there). |
tag | A vector of numbers used as the mesh's tag |
default | An enum branch specifying to use the default coloring scheme, white stroke with no fill |
stroke | A 4-vector representing the color of the stroke |
stroke | A 4-vector representing the color of the stroke |
fill | A 4-vector representing the color of the fill. Note that this forces an uprank |
RETURN
Generates a 2D mesh representing the specified implicit function over the given domain
DECLARATION
func ImplicitFunc2d([points] {[main] {x_min, x_max, y_min, y_max}, [step] {x_min, x_max, y_min, y_max, x_step, y_step}}, f(x,y), tag, [color] {[default] {}, [stroke] {stroke}, [solid] {stroke, fill}})