Tiling

Namespace

The JXG.Math.Tiling namespace. Used to prepare tilings used to plot Surface3D with Polyhedron3D.

Methods

Own

(static) rectangulation(el, rg_u, rg_v, stepsU, stepsV)

Rectangulate (partition it into rectangles) a given two dimensional domain. The number of rectangles the original rectangle is divided into depends on the parameters stepsU and stepsV. Input are the ranges of u and v, as well as stepsU and stepsV which are static.

Example

var rg = board.create('slider', [[-7, -7], [3, -7], [1, 4, 5]], { name: 'rg' });

var box = [-5, 5];
var view = board.create('view3d',
    [[-5, -3], [8, 8],
    [box, box, box]],
    {
        projection: 'central',
        // axesPosition: 'center',
        xPlaneRear: { visible: false },
        yPlaneRear: { visible: false },
        zPlaneRear: { visible: false }
    });

var range = [() => -rg.Value(), () => rg.Value()],
    stepsU = 15,
    stepsV = 5,
    F = (x, y) => [x, y, 3 * Math.sin(Math.sqrt(x ** 2 + y ** 2))];

view.setView(0, Math.PI / 2);  // Set view from above

var el = { F: F }; // Fake surface3d element

var surface = JXG.Math.Tiling.rectangulation(el, range, range, stepsU, stepsV);
var pol = view.create('polyhedron3d', surface, {
    shader: {
        enabled: true,
        light: {
            dir: 0
        }
    },
    fillColorArray: ['white'],
    fillOpacity: 0.9,
    strokeWidth: 0.2
});

Parameters

Name Type Description
el JXG.ParametricSurface3D | JXG.Plane3D

element which is displayed using a polyhedron3d. From this element its function F is used.

rg_u Array

Begin and end of first direction (numbers or functions)

rg_v Array

Begin and end of second direction (numbers or functions)

stepsU Number

Immutable

stepsV Number

Immutable

Returns

[coords,faces]

Details

Source
math/tiling.js, line 304

(static) triangulation(el, rg_u, rg_v, stepsU, stepsVopt)

Triangulate (partition it into triangles) a given two dimensional domain. The number of triangles the original rectangle is divided into depends on the parameters stepsU and stepsV. Input are the ranges of u and v, as well as stepsU and stepsV which are static. If the optional parameter stepsV is not given or is equal to 0, the rectangle is partitioned into nearly equilateral triangles. Otherwise, the shape of the triangles depends on the ratio of stepsU / stepsV.

Example

var rg = board.create('slider', [[-7, -7], [3, -7], [1, 4, 5]], { name: 'rg' }); // range

var box = [-5, 5];
var view = board.create('view3d',
    [[-5, -3], [8, 8],
    [box, box, box]],
    {
        projection: 'central',
        xPlaneRear: { visible: false },
        yPlaneRear: { visible: false },
        zPlaneRear: { visible: false }
    });

var range = [() => -rg.Value(), () => rg.Value()],
    stepsU = 25,
    // stepsV = 25,
    F = (x, y) => [x, y, 3 * Math.sin(Math.sqrt(x ** 2 + y ** 2))];

view.setView(0, Math.PI / 2); // Set view from above

var el = { F: F }; // Fake surface3d element

// stepsV not supplied -> approx. equilater triangles
var surface = JXG.Math.Tiling.triangulation(el, range, range, stepsU);
var pol = view.create('polyhedron3d', surface, {
    shader: {
        enabled: true,
        light: {
            dir: 0
        }
    },
    fillColorArray: ['white'],
    fillOpacity: 0.9,
    strokeWidth: 0.2
});

Parameters

Name Type Attributes Default Description
el JXG.ParametricSurface3D | JXG.Plane3D

element which is displayed using a polyhedron3d. From this element its function F is used.

rg_u Array

Begin and end of first direction (numbers or functions)

rg_v Array

Begin and end of second direction (numbers or functions)

stepsU Number

Immutable

stepsV Number <optional>
0

Immutable

Returns

[coords,faces]

Details

Source
math/tiling.js, line 145

Inherited

none

Details

Tiling

Source
math/tiling.js, line 40