-
Notifications
You must be signed in to change notification settings - Fork 102
/
Copy pathfig3_1b.py
executable file
·39 lines (23 loc) · 954 Bytes
/
fig3_1b.py
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
27
28
29
30
31
32
33
34
35
36
37
#! /usr/bin/env python3
import pyvista as pv
import numpy as np
from spatialmath import SE3
from math import cos, sin, pi
import pvplus
plotter = pv.Plotter(polygon_smoothing=True, window_size=(2000,2000))
plotter.enable_parallel_projection()
print(pv.__version__)
dir = [1, 0, 0]
pos = [-1, 0, 0]
plotter.add_mesh(pv.Cylinder(center=pos, direction=dir, radius=0.2, height=2))
# blue frame at the origin
pvplus.add_frame(plotter, SE3(), color='blue', label='A')
# red frame at -2, 0, 0
pvplus.add_frame(plotter, SE3(-2, 0, 0) * SE3.Rz(-pi/2) * SE3.Rx(pi/2), color='red', label='B')
# disk = pv.Cylinder(center=(-2,0,0), direction=(0,1,0), height=0.02, radius=2)
# plotter.add_mesh(disk, color='red', opacity=0.1)
# camera position, focus point, up
# plotter.camera_position = [(2, -2, 1), (0, 0, 0), (0, 0, 1)]
plotter.set_background('white')
# plotter.enable_eye_dome_lighting() # messes up subplots
plotter.export_gltf('fig3_1b.gltf')