### Plot Cartesian Function by Number (OpenSCAD) Source: https://github.com/rcolyer/plot-function/blob/master/README.md Use this to plot a Cartesian function defined by its number (e.g., Func1). Ensure plot_function.scad is included and the function is declared at the top level. Plots over the specified x and y domains with a given step size. ```openscad include function Func1(x, y) = 2*(1.5 + cos(x*x + y*y/4)); PlotFunction(1, [-40, 0.4, 40], [-40, 0.4, 40]); ``` -------------------------------- ### PlotAxialFunction API (OpenSCAD) Source: https://github.com/rcolyer/plot-function/blob/master/README.md API for plotting functions of z-height and angle, returning radius in axial coordinates. Accepts a function literal or numbered function (AxialFunc1-AxialFunc9). Defines the z-domain, number of circle steps, and outer radius. Renders only strictly positive r values. ```openscad // Plots either a function literal, or the numbered function AxialFunc1 through // AxialFunc9, where AxialFuncN is either the function literal or the number // 1 through 9. Each function is a function of z-height and angle, and returns // the radius outward in the xy-plane. // max_r is the outer radius, and min_step is the smallest step size between // points. // minz_stepz_maxz should be [minz, stepz, maxz], and likewise for y, // specifying the domain to be plotted. // To guarantee a properly manifold shape, the routine will only render // strictly positive values (r>0) of the defined function. Add an offset if // needed to achieve this. module PlotAxialFunction(AxialFuncN, minz_stepz_maxz, num_circle_steps=360) ``` -------------------------------- ### PlotPolarFunction API (OpenSCAD) Source: https://github.com/rcolyer/plot-function/blob/master/README.md API for plotting functions of radius and angle in polar coordinates. Accepts a function literal or numbered function (PolarFunc1-PolarFunc9). Defines the outer radius and step size. Renders only strictly positive z values. ```openscad // Plots either a function literal or the numbered function PolarFunc1 through // PolarFunc9, where PolarFuncN is either the function literal or the number 1 // through 9. Each function is a function of radius and angle. // max_r is the outer radius, and min_step is the smallest step size between // points. // To guarantee a properly manifold shape, the routine will only render // strictly positive values (z>0) of the defined function. Add an offset if // needed to achieve this. module PlotPolarFunction(PolarFuncN, max_r, min_step=-1) ``` -------------------------------- ### PlotFunction API (OpenSCAD) Source: https://github.com/rcolyer/plot-function/blob/master/README.md API for plotting functions of x and y in Cartesian coordinates. Accepts a function literal or numbered function (Func1-Func9). Defines the plotting domain and step size. Renders only strictly positive z values. ```openscad // Plots either a function literal or the numbered function Func1 through // Func9, where FuncN is either the function literal or the number 1 through 9. // Each function is a function of x and y. // minx_stepx_maxx should be [minx, stepx, maxx], and likewise for y, // specifying the domain to be plotted. // To guarantee a properly manifold shape, the routine will only render // strictly positive values (z>0) of the defined function. Add an offset if // needed to achieve this. module PlotFunction(FuncN, minx_stepx_maxx, miny_stepy_maxy) ``` -------------------------------- ### Plot Cartesian Function with Literal (OpenSCAD) Source: https://github.com/rcolyer/plot-function/blob/master/README.md Use this to plot a Cartesian function defined as a literal. Ensure plot_function.scad is available via 'use'. Plots over the specified x and y domains with a given step size. ```openscad use DemoFunc = function(x, y) 2*(1.5 + cos(x*x + y*y/4)); PlotFunction(DemoFunc, [-40, 0.4, 40], [-40, 0.4, 40]); ``` -------------------------------- ### PlotFunction Module Source: https://github.com/rcolyer/plot-function/blob/master/README.md Plots functions defined in Cartesian coordinates (x, y input, z output). It accepts either a function literal or a numbered function (Func1-Func9). The domain for x and y is specified by minx_stepx_maxx and miny_stepy_maxy respectively. Only strictly positive z values are rendered to ensure manifold shapes. ```APIDOC ## module PlotFunction(FuncN, minx_stepx_maxx, miny_stepy_maxy) ### Description Plots either a function literal or the numbered function Func1 through Func9, where FuncN is either the function literal or the number 1 through 9. Each function is a function of x and y. minx_stepx_maxx should be [minx, stepx, maxx], and likewise for y, specifying the domain to be plotted. To guarantee a properly manifold shape, the routine will only render strictly positive values (z>0) of the defined function. Add an offset if needed to achieve this. ### Parameters - **FuncN** (function or number) - The function to plot, either a literal or a number from 1 to 9. - **minx_stepx_maxx** (array) - Defines the domain for the x-axis: [minimum x, step size, maximum x]. - **miny_stepy_maxy** (array) - Defines the domain for the y-axis: [minimum y, step size, maximum y]. ``` -------------------------------- ### PlotPolarFunction Module Source: https://github.com/rcolyer/plot-function/blob/master/README.md Plots functions defined in polar/cylindrical coordinates (radius and angle input, z output). It accepts either a function literal or a numbered function (PolarFunc1-PolarFunc9). The maximum radius and minimum step size are specified. Only strictly positive z values are rendered for manifold shapes. ```APIDOC ## module PlotPolarFunction(PolarFuncN, max_r, min_step) ### Description Plots either a function literal or the numbered function PolarFunc1 through PolarFunc9, where PolarFuncN is either the function literal or the number 1 through 9. Each function is a function of radius and angle. max_r is the outer radius, and min_step is the smallest step size between points. To guarantee a properly manifold shape, the routine will only render strictly positive values (z>0) of the defined function. Add an offset if needed to achieve this. ### Parameters - **PolarFuncN** (function or number) - The function to plot, either a literal or a number from 1 to 9. - **max_r** (number) - The maximum radius for the plot. - **min_step** (number, optional) - The minimum step size between points. Defaults to -1 (library determined). ``` -------------------------------- ### PlotAxialFunction Module Source: https://github.com/rcolyer/plot-function/blob/master/README.md Plots functions defined in axial coordinates (z-height and angle input, returning radius output). It accepts either a function literal or a numbered function (AxialFunc1-AxialFunc9). The domain for z and the number of circle steps are specified. Only strictly positive r values are rendered for manifold shapes. ```APIDOC ## module PlotAxialFunction(AxialFuncN, minz_stepz_maxz, num_circle_steps) ### Description Plots either a function literal, or the numbered function AxialFunc1 through AxialFunc9, where AxialFuncN is either the function literal or the number 1 through 9. Each function is a function of z-height and angle, and returns the radius outward in the xy-plane. max_r is the outer radius, and min_step is the smallest step size between points. minz_stepz_maxz should be [minz, stepz, maxz], and likewise for y, specifying the domain to be plotted. To guarantee a properly manifold shape, the routine will only render strictly positive values (r>0) of the defined function. Add an offset if needed to achieve this. ### Parameters - **AxialFuncN** (function or number) - The function to plot, either a literal or a number from 1 to 9. - **minz_stepz_maxz** (array) - Defines the domain for the z-axis: [minimum z, step size, maximum z]. - **num_circle_steps** (number, optional) - The number of steps to use for approximating circles. Defaults to 360. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.