Skip to content

Commit f0a60de

Browse files
committed
edit docs; make CurveBuilder and SurfaceBuilder work without MeshBuffers
1 parent 68ab765 commit f0a60de

File tree

166 files changed

+2603
-3986
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

166 files changed

+2603
-3986
lines changed

demos/demoutil.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,8 @@ function makeMesh(func, resolutionU, resolutionV) {
213213
.positionNormal(func)
214214
.attribute(colorGradient, H3DU.Semantic.COLOR)
215215
// Evaluate the surface and generate a triangle
216-
// mesh, using resolution+1 different U coordinates,
217-
// and resolution+1 different V coordinates.
216+
// mesh, using resolution+1 different u-coordinates,
217+
// and resolution+1 different v-coordinates.
218218
// Instead of H3DU.Mesh.TRIANGLES, we could use
219219
// H3DU.Mesh.LINES to create a wireframe mesh,
220220
// or H3DU.Mesh.POINTS to create a point mesh.

demos/ellarclength.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ function _numIntegrate(func, xmin, xmax) {
2929
"use strict";
3030
/*
3131
* Estimates the integral of a continuous function. The integral
32-
* is like the area between the function's graph and the X axis,
33-
* where areas above the X axis add to the integral, and areas
34-
* below the X axis subtract from it.
32+
* is like the area between the function's graph and the x-axis,
33+
* where areas above the x-axis add to the integral, and areas
34+
* below the x-axis subtract from it.
3535
* @private
3636
* @param {Function} func A function that takes one number
3737
* and returns a number. This function is assumed to be

demos/fallingballs.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
* Updates the position of a particle using Verlet integration.
1818
* @param {Array<number>} particle Information on a single particle in
1919
* the form of an array of nine numbers as follows:<ul>
20-
* <li>The first three numbers are the X, Y, and Z coordinates
20+
* <li>The first three numbers are the x-, y-, and z-coordinates
2121
* of the particle's position.
22-
* <li>The next three numbers are the X, Y, and Z coordinates
22+
* <li>The next three numbers are the x-, y-, and z-coordinates
2323
* of the particle's previous position.
2424
* <li>The next three numbers are the X, Y, and Z components
2525
* of the particle's acceleration (force divided by mass).
@@ -59,9 +59,9 @@
5959
* Initializes a particle's data for Verlet integration.
6060
* @param {Array<Number>} particle Array to hold
6161
* the data for Verlet integration.
62-
* @param {number} x Starting X coordinate of the particle.
63-
* @param {number} y Starting Y coordinate of the particle.
64-
* @param {number} z Starting Z coordinate of the particle.
62+
* @param {number} x Starting x-coordinate of the particle.
63+
* @param {number} y Starting y-coordinate of the particle.
64+
* @param {number} z Starting z-coordinate of the particle.
6565
* @param {number} vx X component of the velocity.
6666
* @param {number} vy Y component of the velocity.
6767
* @param {number} vz Z component of the velocity.

demos/implicit.js

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
* @param {Object} func A <b>sampling object</b>. This object contains a single property,
1414
* "sample", which is a function that takes three parameters
1515
* specifying a 3-dimensional point:<ol>
16-
* <li>x - An X coordinate.
17-
* <li>y - A Y coordinate.
18-
* <li>z - A Z coordinate.</ol>
16+
* <li>x - An x-coordinate.
17+
* <li>y - A y-coordinate.
18+
* <li>z - A z-coordinate.</ol>
1919
* and returns a number. If the implicit surface function returns 0, that
2020
* means the point lies on the surface.
2121
* @example <caption>The following defines an implicit surface
@@ -68,9 +68,9 @@ ImplicitSurface._fGetOffset = function(a, b, desired) {
6868
};
6969

7070
ImplicitSurface._TARGET_VALUE = 0;
71-
// For any edge, if one vertex is inside of the surface and the other is outside of the surface
71+
// For any edge, if one vertex is inside of the surface and the other is outside the surface
7272
// then the edge intersects the surface
73-
// For each of the 8 vertices of the cube can be two possible states : either inside or outside of the surface
73+
// For each of the 8 vertices of the cube can be two possible states : either inside or outside the surface
7474
// For any cube the are 2^8=256 possible sets of vertex states
7575
// This table lists the edges intersected by the surface for all 256 possible vertex states
7676
// There are 12 edges. For each entry in the table, if edge #n is intersected, then bit #n is set to 1
@@ -433,7 +433,7 @@ ImplicitSurface.prototype._vMarchCube1 = function(mesh, fX, fY, fZ, fScaleX, fSc
433433

434434
const iEdgeFlags = ImplicitSurface._aiCubeEdgeFlags[iFlagIndex];
435435

436-
// If the cube is entirely inside or outside of the surface, then there will be no intersections
436+
// If the cube is entirely inside or outside the surface, then there will be no intersections
437437
if(iEdgeFlags === 0)return;
438438
// Find the point of intersection of the surface with each edge
439439
// Then find the normal to the surface at those points
@@ -475,20 +475,20 @@ ImplicitSurface.prototype._vMarchCube1 = function(mesh, fX, fY, fZ, fScaleX, fSc
475475
/**
476476
* Finds a tight bounding box within the given three-dimensional
477477
* area that encloses this implicit surface.
478-
* @param {number} xsize Number of grid points along the X axis. Must be 2 or greater.
479-
* @param {number} ysize Number of grid points along the Y axis. Must be 2 or greater.
480-
* @param {number} zsize Number of grid points along the Z axis. Must be 2 or greater.
481-
* @param {number} xmin Smallest value along the X axis.
482-
* @param {number} xmax Greatest value along the X axis.
483-
* @param {number} ymin Smallest value along the Y axis.
484-
* @param {number} ymax Greatest value along the Y axis.
485-
* @param {number} zmin Smallest value along the Z axis.
486-
* @param {number} zmax Greatest value along the Z axis.
478+
* @param {number} xsize Number of grid points along the x-axis. Must be 2 or greater.
479+
* @param {number} ysize Number of grid points along the y-axis. Must be 2 or greater.
480+
* @param {number} zsize Number of grid points along the z-axis. Must be 2 or greater.
481+
* @param {number} xmin Smallest value along the x-axis.
482+
* @param {number} xmax Greatest value along the x-axis.
483+
* @param {number} ymin Smallest value along the y-axis.
484+
* @param {number} ymax Greatest value along the y-axis.
485+
* @param {number} zmin Smallest value along the z-axis.
486+
* @param {number} zmax Greatest value along the z-axis.
487487
* @returns {Array<number>} An array of six numbers describing a tight
488488
* axis-aligned bounding box
489489
* that fits this implicit surface within the given area. The first three numbers
490-
* are the smallest-valued X, Y, and Z coordinates, and the
491-
* last three are the largest-valued X, Y, and Z coordinates.
490+
* are the smallest-valued x-, y-, and z-coordinates, and the
491+
* last three are the largest-valued x-, y-, and z-coordinates.
492492
* If no part of the boundary of the surface lies within the given
493493
* area, returns the array [Inf, Inf, Inf, -Inf,
494494
* -Inf, -Inf].
@@ -539,15 +539,15 @@ ImplicitSurface.prototype.findBox = function(xsize, ysize, zsize, xmin, xmax, ym
539539
* implicit surface
540540
* within the given area.
541541
* @param {Mesh} mesh Mesh to store the points in.
542-
* @param {number} xsize Number of grid points along the X axis. Must be 2 or greater.
543-
* @param {number} ysize Number of grid points along the Y axis. Must be 2 or greater.
544-
* @param {number} zsize Number of grid points along the Z axis. Must be 2 or greater.
545-
* @param {number} xmin Smallest value along the X axis.
546-
* @param {number} xmax Greatest value along the X axis.
547-
* @param {number} ymin Smallest value along the Y axis.
548-
* @param {number} ymax Greatest value along the Y axis.
549-
* @param {number} zmin Smallest value along the Z axis.
550-
* @param {number} zmax Greatest value along the Z axis.
542+
* @param {number} xsize Number of grid points along the x-axis. Must be 2 or greater.
543+
* @param {number} ysize Number of grid points along the y-axis. Must be 2 or greater.
544+
* @param {number} zsize Number of grid points along the z-axis. Must be 2 or greater.
545+
* @param {number} xmin Smallest value along the x-axis.
546+
* @param {number} xmax Greatest value along the x-axis.
547+
* @param {number} ymin Smallest value along the y-axis.
548+
* @param {number} ymax Greatest value along the y-axis.
549+
* @param {number} zmin Smallest value along the z-axis.
550+
* @param {number} zmax Greatest value along the z-axis.
551551
* @returns {ImplicitSurface} This object.
552552
*/
553553
ImplicitSurface.prototype.evalSurfacePoints = function(mesh, xsize, ysize, zsize, xmin, xmax, ymin, ymax, zmin, zmax) {
@@ -580,15 +580,15 @@ ImplicitSurface.prototype.evalSurfacePoints = function(mesh, xsize, ysize, zsize
580580
* given mesh the triangles and normals that make up the boundary of
581581
* this implicit surface within the given area.
582582
* @param {Mesh} mesh Mesh to store the points in.
583-
* @param {number} xsize Number of grid points along the X axis. Must be 2 or greater.
584-
* @param {number} ysize Number of grid points along the Y axis. Must be 2 or greater.
585-
* @param {number} zsize Number of grid points along the Z axis. Must be 2 or greater.
586-
* @param {number} xmin Smallest value along the X axis.
587-
* @param {number} xmax Greatest value along the X axis.
588-
* @param {number} ymin Smallest value along the Y axis.
589-
* @param {number} ymax Greatest value along the Y axis.
590-
* @param {number} zmin Smallest value along the Z axis.
591-
* @param {number} zmax Greatest value along the Z axis.
583+
* @param {number} xsize Number of grid points along the x-axis. Must be 2 or greater.
584+
* @param {number} ysize Number of grid points along the y-axis. Must be 2 or greater.
585+
* @param {number} zsize Number of grid points along the z-axis. Must be 2 or greater.
586+
* @param {number} xmin Smallest value along the x-axis.
587+
* @param {number} xmax Greatest value along the x-axis.
588+
* @param {number} ymin Smallest value along the y-axis.
589+
* @param {number} ymax Greatest value along the y-axis.
590+
* @param {number} zmin Smallest value along the z-axis.
591+
* @param {number} zmax Greatest value along the z-axis.
592592
* @returns {ImplicitSurface} This object.
593593
*/
594594
ImplicitSurface.prototype.evalSurface = function(mesh, xsize, ysize, zsize, xmin, xmax, ymin, ymax, zmin, zmax) {

0 commit comments

Comments
 (0)