choose implicitSurface example.js
example:
triangulation implicitSurface


uses ( Version (A) ) implicitSurface genus2 cut.js

// Example: implicit surface genus2 cut:

const isf = ( x, y, z ) => ( 2*y*( y*y - 3*x*x )*( 1 - z*z ) + ( x*x + y*y )*( x*x + y*y ) - ( 9*z*z - 1 )*( 1 - z*z ) );// IMPLICIT SURFACE Function
const dx = ( x, y, z ) => ( -12*x*y*( 1 - z*z ) + 4*x*( x*x + y*y ) );// PARTIAL DERIVATE to x
const dy = ( x, y, z ) => ( 6*( y*y - x*x )*( 1 - z*z ) + 4*y*( x*x + y*y ) );// PARTIAL DERIVATE to y
const dz = ( x, y, z ) => ( -4*y*( y*y - 3*x*x )*z + 36*z*z*z - 20*z );// PARTIAL DERIVATE to z

const xs = 0; // x START POINT
const ys = 3; // y START POINT
const zs = 0; // z START POINT

const e = 0.001; // epsilon
const d = 0.08; // rough edge length of triangles

const opt = {};
opt.fc = 360000;
opt.pc = 180000;
opt.b = [ 1, -Infinity, Infinity, -Infinity, Infinity, -Infinity ]; // bounds xMax, xMin, yMax, yMin, zMax, zMin



replace source in triangulationImplicitSurface.html rename the example

src="implicitSurface example.js"


// use version (A) with opt for infinite surfaces such as cylinders and cones or for cuts
/*opt optional object, all properties also optional
{
fc: faces //( max. number of triangles )
pc: positions // ( max. number of points )
b: bounds // array [ xMax, xMin, yMax, yMin, zMax, zMin ]
}
*/

// (A) parameters from implicitSurface example.js, with object of optional parameters, contains bounds
g.createImplicitSurface( isf, dx, dy, dz, xs, ys, zs, d, e, opt );

// (B) parameters from implicitSurface example.js with some default values
//g.createImplicitSurface( isf, dx, dy, dz, xs, ys, zs, d, e );


examples for version (A) with opt: (infinite surfaces or cut surfaces)

src="implicitSurface cylinder.js"
src="implicitSurface sphere cylinder.js"
src="implicitSurface two cylinder parallel.js"
src="implicitSurface two cylinder.js"
src="implicitSurface three cylinder.js"
src="implicitSurface two cylinder sphere.js"
src="implicitSurface sphere cone.js"
src="implicitSurface sphere cut.js"
src="implicitSurface yh6.js"
src="implicitSurface y sin.js"
src="implicitSurface torus.js"
src="implicitSurface genus2 cut.js"

examples for version (B) without opt:

src="implicitSurface threeBalls.js"
src="implicitSurface equipotential.js"
src="implicitSurface yh4.js"
src="implicitSurface torus sphere.js"
src="implicitSurface genus3.js"


VERSION (A)


implicitSurface cylinder.js


implicitSurface sphere cylinder.js


implicitSurface two cylinder parallel.js


implicitSurface two cylinder.js


implicitSurface three cylinder.js


implicitSurface two cylinder sphere.js


implicitSurface sphere cone.js


implicitSurface sphere cut.js


implicitSurface yh6.js


implicitSurface y sin.js


implicitSurface torus.js


implicitSurface genus2 cut.js


VERSION (B)


implicitSurface threeBalls.js
triangulation in progress

implicitSurface equipotential.js


implicitSurface yh4.js


implicitSurface torus sphere.js



implicitSurface genus3.js