Closed agen49 closed 1 year ago
mesh.z.max() - mesh.z.min()
Thank you for replying back. I appreciate the time.
I've tried to follow the code but I am kinda lost. Would you please post a code example on this page for ONLY the lines of codes that any user can use to rotate their parts?
I am getting an error "module 'stl.mesh' has no attribute 'z'".
from stl import mesh
your_mesh = mesh.Mesh.from_file('tests/stl_binary/HalfDonut.stl')
# Rotate 90 degrees over the Y axis
your_mesh.rotate([0.0, 0.5, 0.0], math.radians(90))
z_height = your_mesh.z.max() - your_mesh.z.min()
Thank you very much. Honestly, I didn't expect it to be that simple, I thought I need to copy all the code under "modifying mech objects" and tweak it. Thank you for clarifying that, very kind of you. I've seen you posted a citation for your code on another post, I'll make sure to use that. Have a good day/night.
Thank you, when I do double rotation, The Z-height value I get from Numpy-stl is different than the one I get from slicing software, may I ask why? Am I doing something wrong?
your_mesh.rotate([0.0, 1.0, 0.0], math.radians(15))
your_mesh.rotate([1.0, 0.0, 0.0], math.radians(15))
And I commute the Z-height using:
z_height = your_mesh.z.max() - your_mesh.z.min() z_height
On Sep 14, 2022, at 7:05 AM, Rick van Hattem @.***> wrote:
from stl import mesh
your_mesh = mesh.Mesh.from_file('tests/stl_binary/HalfDonut.stl')
Rotate 90 degrees over the Y axis
your_mesh.rotate([0.0, 0.5, 0.0], math.radians(90))
z_height = your_mesh.z.max() - your_mesh.z.min() — Reply to this email directly, view it on GitHub https://github.com/WoLpH/numpy-stl/issues/202#issuecomment-1246603534, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3ADPAPK5BAK5LIYRG554YLV6GWQVANCNFSM6AAAAAAQKZ46UQ. You are receiving this because you authored the thread.
Hello,
Thanks to everyone who made this library available to public.
1) Is there an option to rotate an stll object using x, y, and z angles? If yes, how?
2) Is there an option to find the Z-height of an stl object at a specific orientation? If yes, how?
Thank you.
P.S. I am new to programming, my background is in environmental engineering.