Skip to content

Display 3D Voxelized Topology Optimization Results #546

Answered by marcomusy
bhttchr6 asked this question in Q&A
Discussion options

You must be logged in to vote

Uhm, maybe you wish to use a Glyph object to represent the voxels, e.g.:

import numpy as np
from vedo import *

X, Y, Z = np.mgrid[:30, :30, :30]
scalar_field = ((X-0)**2 + (Y-15)**2 + (Z-15)**2)/225

vol = Volume(scalar_field)

pcl = vol.topoints().ps(4)
# pcl.print()
# pcl.pointdata.select('input_scalars')
# pcl.pointdata['myscals'] = pcl.pointdata['input_scalars']+10

marker = Cube().scale(0.2)
glyphed_pcl = Glyph(pcl, marker, scaleByScalar=True).cmap('jet')
glyphed_pcl.addScalarBar()

show(pcl, glyphed_pcl, N=2, axes=1)

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@bhttchr6
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by bhttchr6
Comment options

You must be logged in to vote
2 replies
@marcomusy
Comment options

@bhttchr6
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants