Skip to content
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

Rotating Glyphs #39

Closed
laserman781 opened this issue Aug 6, 2019 · 1 comment
Closed

Rotating Glyphs #39

laserman781 opened this issue Aug 6, 2019 · 1 comment
Assignees
Labels
filtering General topics around filtering and usage of filters

Comments

@laserman781
Copy link

I am trying to plot points as blocks, and the goal is to have them all perfectly in line. I've been able to have the blocks stack perfectly although they would need to be rotated in order to be perfect. How would I go about this?
image
Code so far:

block_pts = blocks[['x', 'y', 'z']].values
Poly = pv.PolyData(block_pts)
geom = pv.Cube()
cubes = Poly.glyph(geom=geom,scale=False,factor=75,absolute=True)
p = pv.Plotter()
p.add_mesh(cubes)
p.plot()
@banesullivan
Copy link
Member

Rotating the geom object before passing it as the glyph geometry should do this. Try using one of rotate_x(), rotate_y(), rotate_z() or some custom rotating function you have on the geom object:

...
geom = pv.Cube()
geom.rotate_z(33.3) # this is performed inplace
cubes = Poly.glyph(geom=geom, scale=False, factor=75, absolute=True)
...

@banesullivan banesullivan added the filtering General topics around filtering and usage of filters label Aug 6, 2019
@banesullivan banesullivan self-assigned this Aug 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
filtering General topics around filtering and usage of filters
Projects
None yet
Development

No branches or pull requests

2 participants