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
add truss example #1683
add truss example #1683
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1683 +/- ##
=======================================
Coverage 92.59% 92.59%
=======================================
Files 71 71
Lines 13864 13864
=======================================
Hits 12838 12838
Misses 1026 1026 |
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.
Looks good to me, some whitespace, and some minor suggestions.
|
||
Plot connections between points in 3D as cylinders, colored by scalars. | ||
|
||
|
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.
[4.0, 1.0, 2.0], | ||
[4.0, 3.0, 2.0] | ||
] | ||
|
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.
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.
Line 29 is also blank.
|
||
mesh = pyvista.PolyData(nodes, edges_w_padding) | ||
|
||
colors = range(edges.shape[0]) |
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.
colors is a bit confusing as it isn't directly a color, what about edge_id
? You also use edges.shape[0]
twice, you could define it above for reuse.
[2, 6], | ||
]) | ||
|
||
# We must "pad" the edges to indicate to vtk how many points per edge |
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.
points or nodes here? I'm not sure. It might be a good place to point out quickly why the padding is necessary, or maybe link to the PolyData class where it is explained more?
Sorry @MatthewFlamm, I saw it was green on the |
Add the truss example created in pyvista/pyvista-support#494 to our gallery.