Skip to content

Commit 473d15b

Browse files
committed
Merge pull request #593 from monfera/mesh3d-docs
mesh3d document update
2 parents b4785b0 + f256361 commit 473d15b

File tree

1 file changed

+58
-15
lines changed

1 file changed

+58
-15
lines changed

src/traces/mesh3d/attributes.js

+58-15
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,57 @@ var extendFlat = require('../../lib/extend').extendFlat;
1616
module.exports = {
1717
x: {
1818
valType: 'data_array',
19-
description: 'Sets the x coordinates of the vertices'
19+
description: [
20+
'Sets the X coordinates of the vertices. The nth element of vectors `x`, `y` and `z`',
21+
'jointly represent the X, Y and Z coordinates of the nth vertex.'
22+
].join(' ')
2023
},
2124
y: {
2225
valType: 'data_array',
23-
description: 'Sets the y coordinates of the vertices'
26+
description: [
27+
'Sets the Y coordinates of the vertices. The nth element of vectors `x`, `y` and `z`',
28+
'jointly represent the X, Y and Z coordinates of the nth vertex.'
29+
].join(' ')
2430
},
2531
z: {
2632
valType: 'data_array',
27-
description: 'Sets the z coordinates of the vertices'
33+
description: [
34+
'Sets the Z coordinates of the vertices. The nth element of vectors `x`, `y` and `z`',
35+
'jointly represent the X, Y and Z coordinates of the nth vertex.'
36+
].join(' ')
2837
},
2938

3039
i: {
3140
valType: 'data_array',
32-
description: 'Sets the indices of x coordinates of the vertices'
41+
description: [
42+
'A vector of vertex indices, i.e. integer values between 0 and the length of the vertex',
43+
'vectors, representing the *first* vertex of a triangle. For example, `{i[m], j[m], k[m]}`',
44+
'together represent face m (triangle m) in the mesh, where `i[m] = n` points to the triplet',
45+
'`{x[n], y[n], z[n]}` in the vertex arrays. Therefore, each element in `i` represents a',
46+
'point in space, which is the first vertex of a triangle.'
47+
].join(' ')
3348
},
3449
j: {
3550
valType: 'data_array',
36-
description: 'Sets the indices of y coordinates of the vertices'
51+
description: [
52+
'A vector of vertex indices, i.e. integer values between 0 and the length of the vertex',
53+
'vectors, representing the *second* vertex of a triangle. For example, `{i[m], j[m], k[m]}` ',
54+
'together represent face m (triangle m) in the mesh, where `j[m] = n` points to the triplet',
55+
'`{x[n], y[n], z[n]}` in the vertex arrays. Therefore, each element in `j` represents a',
56+
'point in space, which is the second vertex of a triangle.'
57+
].join(' ')
58+
3759
},
3860
k: {
3961
valType: 'data_array',
40-
description: 'Sets the indices of z coordinates of the vertices'
62+
description: [
63+
'A vector of vertex indices, i.e. integer values between 0 and the length of the vertex',
64+
'vectors, representing the *third* vertex of a triangle. For example, `{i[m], j[m], k[m]}`',
65+
'together represent face m (triangle m) in the mesh, where `k[m] = n` points to the triplet ',
66+
'`{x[n], y[n], z[n]}` in the vertex arrays. Therefore, each element in `k` represents a',
67+
'point in space, which is the third vertex of a triangle.'
68+
].join(' ')
69+
4170
},
4271

4372
delaunayaxis: {
@@ -46,9 +75,10 @@ module.exports = {
4675
values: [ 'x', 'y', 'z' ],
4776
dflt: 'z',
4877
description: [
49-
'Sets the Delaunay axis from which the triangulation of the mesh',
50-
'takes place.',
51-
'An alternative to setting the `i`, `j`, `k` indices triplets.'
78+
'Sets the Delaunay axis, which is the axis that is perpendicular to the surface of the',
79+
'Delaunay triangulation.',
80+
'It has an effect if `i`, `j`, `k` are not provided and `alphahull` is set to indicate',
81+
'Delaunay triangulation.'
5282
].join(' ')
5383
},
5484

@@ -57,11 +87,24 @@ module.exports = {
5787
role: 'style',
5888
dflt: -1,
5989
description: [
60-
'Sets the shape of the mesh',
61-
'If *-1*, Delaunay triangulation is used',
62-
'If *>0*, the alpha-shape algorithm is used',
63-
'If *0*, the convex-hull algorithm is used',
64-
'An alternative to the `i`, `j`, `k` indices triplets.'
90+
'Determines how the mesh surface triangles are derived from the set of',
91+
'vertices (points) represented by the `x`, `y` and `z` arrays, if',
92+
'the `i`, `j`, `k` arrays are not supplied.',
93+
'For general use of `mesh3d` it is preferred that `i`, `j`, `k` are',
94+
'supplied.',
95+
96+
'If *-1*, Delaunay triangulation is used, which is mainly suitable if the',
97+
'mesh is a single, more or less layer surface that is perpendicular to `delaunayaxis`.',
98+
'In case the `delaunayaxis` intersects the mesh surface at more than one point',
99+
'it will result triangles that are very long in the dimension of `delaunayaxis`.',
100+
101+
'If *>0*, the alpha-shape algorithm is used. In this case, the positive `alphahull` value',
102+
'signals the use of the alpha-shape algorithm, _and_ its value',
103+
'acts as the parameter for the mesh fitting.',
104+
105+
'If *0*, the convex-hull algorithm is used. It is suitable for convex bodies',
106+
'or if the intention is to enclose the `x`, `y` and `z` point set into a convex',
107+
'hull.'
65108
].join(' ')
66109
},
67110

@@ -106,7 +149,7 @@ module.exports = {
106149
dflt: false,
107150
description: [
108151
'Determines whether or not normal smoothing is applied to the meshes,',
109-
'creating meshes with a low-poly look.'
152+
'creating meshes with an angular, low-poly look via flat reflections.'
110153
].join(' ')
111154
},
112155

0 commit comments

Comments
 (0)