File indexing completed on 2026-04-10 07:50:27
0001
0002 """
0003 U4Mesh_test2_cf.py
0004 ====================
0005
0006 """
0007 import numpy as np, pyvista as pv
0008 from opticks.ana.fold import Fold
0009 SIZE = np.array([1280, 720])
0010
0011 if __name__ == '__main__':
0012 a = Fold.Load("$AFOLD",symbol="a")
0013 a_color = "red"
0014 a_label = "A : %s : %s : %s" % (a_color, a.NPFold_meta.GEOM[0], a.NPFold_meta.desc[0])
0015 print(repr(a))
0016
0017
0018 b = Fold.Load("$BFOLD",symbol="b")
0019 b_color = "blue"
0020 b_label = "B : %s : %s : %s " % (b_color, b.NPFold_meta.GEOM[0], b.NPFold_meta.desc[0])
0021 print(repr(b))
0022
0023
0024 a_offset = np.array([0,0,20], dtype=np.float64)
0025 b_offset = np.array([0,0, 0], dtype=np.float64)
0026
0027 a_pd = pv.PolyData(a.vtx + a_offset, a.fpd)
0028 b_pd = pv.PolyData(b.vtx + b_offset, b.fpd)
0029
0030
0031 label = "\n".join(["U4Mesh_test2_cf.py", a_label, b_label ])
0032 print(label)
0033
0034 pl = pv.Plotter(window_size=SIZE*2)
0035 pl.add_text("%s" % label, position="upper_left")
0036 pl.add_mesh(a_pd, opacity=1.0, show_edges=True, lighting=True, color=a_color )
0037 pl.add_mesh(b_pd, opacity=1.0, show_edges=True, lighting=True, color=b_color )
0038
0039 pl.show_grid()
0040 pl.show()
0041 pass
0042
0043