-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathexample1.py
More file actions
26 lines (17 loc) · 823 Bytes
/
example1.py
File metadata and controls
26 lines (17 loc) · 823 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import env # noqa: F401
TITLE = "Transforms on a Solid"
DESCRIPTION = """ Translation Transform and Rotation Transform can be applied on Solids.
Rotation parameters are in degrees and represent the angle of rotation around each cartesian axis.
Here a cube is translated, another is rotated."""
def exampleCode():
from pytissueoptics.scene import Cuboid, Vector, get3DViewer
centerCube = Cuboid(a=1, b=1, c=1, position=Vector(0, 0, 0))
topCube = Cuboid(a=1, b=1, c=1, position=Vector(0, 2, 0))
bottomCube = Cuboid(a=1, b=1, c=1, position=Vector(0, 0, 0))
bottomCube.translateTo(Vector(0, -2, 0))
centerCube.rotate(0, 30, 30)
viewer = get3DViewer()
viewer.add(centerCube, topCube, bottomCube, representation="surface")
viewer.show()
if __name__ == "__main__":
exampleCode()