-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Mesh3d cell data checks #3369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mesh3d cell data checks #3369
Changes from 12 commits
12f3e1f
33e2b9a
f1772a2
e531e4e
65a5806
e97f5ed
55e5e12
79deeae
bf51940
83060bc
a041e51
2b54f14
a9ab05f
ec502ee
fadce01
29f5a06
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,19 +34,21 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout | |
} | ||
|
||
var coords = readComponents(['x', 'y', 'z']); | ||
var indices = readComponents(['i', 'j', 'k']); | ||
|
||
if(!coords) { | ||
traceOut.visible = false; | ||
return; | ||
} | ||
|
||
if(indices) { | ||
// otherwise, convert all face indices to ints | ||
indices.forEach(function(index) { | ||
for(var i = 0; i < index.length; ++i) index[i] |= 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm. So you didn't move this to Can you try plotting a mesh3d trace with non-integer indices and see what happens? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @etpinard Thanks for the review. |
||
}); | ||
// three indices should be all provided or not | ||
if( | ||
(traceIn.i && (!traceIn.j || !traceIn.k)) || | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ha, you're using
would have Could we be more stringent and use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good Call. Now There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm. I don't understand There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are right. That is fixed in 29f5a06 |
||
(traceIn.j && (!traceIn.k || !traceIn.i)) || | ||
(traceIn.k && (!traceIn.i || !traceIn.j)) | ||
) { | ||
traceOut.visible = false; | ||
return; | ||
} | ||
readComponents(['i', 'j', 'k']); | ||
|
||
var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults'); | ||
handleCalendarDefaults(traceIn, traceOut, ['x', 'y', 'z'], layout); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@etpinard wondering where could these functions go if we want to reuse these functions in other places e.g. in iso-surfaces?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd vote for putting helper functions like this one in a new file
src/traces/mesh3d/helpers.js
.