Skip to content

Commit dfd29d4

Browse files
committed
mesh3d document update
1 parent b5c9827 commit dfd29d4

File tree

1 file changed

+62
-15
lines changed

1 file changed

+62
-15
lines changed

src/traces/mesh3d/attributes.js

Lines changed: 62 additions & 15 deletions
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 X 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[v]}` 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[v]}` 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[v]}` 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,28 @@ 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, because calculating the surface from points can be very',
95+
'time consuming and usually lead to artifacts.',
96+
97+
'If *-1*, Delaunay triangulation is used, which is mainly suitable if the',
98+
'mesh is a single, more or less layer surface that is perpendicular to `delaunayaxis`.',
99+
'In case the `delaunayaxis` intersects the mesh surface at more than one point',
100+
'(e.g. sphere, cube, potato, animal, donut etc. shapes) it will lead to triangles',
101+
'that are very long in the dimension of `delaunayaxis`.',
102+
103+
'If *>0*, the alpha-shape algorithm is used. In this case, the `alphahull` value',
104+
'not only signals the intention to choose the alpha-shape algorithm, but its value',
105+
'acts as the parameter for the mesh fitting. It can take minutes to calculate a large',
106+
'mesh (e.g. over 10 thousand points), and the result is very sensitive to the',
107+
'chosen value. ',
108+
109+
'If *0*, the convex-hull algorithm is used. It is suitable for convex bodies',
110+
'or if the intention is to enclose the `x`, `y` and `z` point set into a convex',
111+
'hull. However it can not generate concave surfaces.'
65112
].join(' ')
66113
},
67114

@@ -106,7 +153,7 @@ module.exports = {
106153
dflt: false,
107154
description: [
108155
'Determines whether or not normal smoothing is applied to the meshes,',
109-
'creating meshes with a low-poly look.'
156+
'creating meshes with an angular, low-poly look via flat reflections.'
110157
].join(' ')
111158
},
112159

0 commit comments

Comments
 (0)