Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 874c3ad

Browse files
committed
do not enable smooth shading with bad epsilon by default
1 parent 663ccb8 commit 874c3ad

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

src/traces/isosurface/attributes.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,5 @@ colorScaleAttrs('', {
249249
hoverinfo: extendFlat({}, baseAttrs.hoverinfo)
250250
}), 'calc', 'nested');
251251

252-
// required defaults to speed up surface normal calculations
253-
attrs.flatshading.dflt = true; attrs.lighting.facenormalsepsilon.dflt = 0;
254-
255252
attrs.x.editType = attrs.y.editType = attrs.z.editType = attrs.value.editType = 'calc+clearAxisTypes';
256253
attrs.transforms = undefined;

src/traces/mesh3d/attributes.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ colorScaleAttrs('', {
191191
flatshading: {
192192
valType: 'boolean',
193193
role: 'style',
194-
dflt: false,
194+
dflt: true,
195195
editType: 'calc',
196196
description: [
197197
'Determines whether or not normal smoothing is applied to the meshes,',
@@ -215,18 +215,18 @@ colorScaleAttrs('', {
215215
vertexnormalsepsilon: {
216216
valType: 'number',
217217
role: 'style',
218-
min: 0.00,
218+
min: 0,
219219
max: 1,
220-
dflt: 1e-12, // otherwise finely tessellated things eg. the brain will have no specular light reflection
220+
dflt: 0,
221221
editType: 'calc',
222222
description: 'Epsilon for vertex normals calculation avoids math issues arising from degenerate geometry.'
223223
},
224224
facenormalsepsilon: {
225225
valType: 'number',
226226
role: 'style',
227-
min: 0.00,
227+
min: 0,
228228
max: 1,
229-
dflt: 1e-6, // even the brain model doesn't appear to need finer than this
229+
dflt: 0,
230230
editType: 'calc',
231231
description: 'Epsilon for face normals calculation avoids math issues arising from degenerate geometry.'
232232
},

0 commit comments

Comments
 (0)