File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ class Scene:
45
45
contents : list = field (default_factory = list )
46
46
origin : List [float ] = field (default = (0 , 0 , 0 ))
47
47
visible : bool = True
48
+ lattice : Optional [List [List [float ]]] = None
48
49
_meta : Dict = None
49
50
50
51
def __add__ (self , other ):
@@ -61,6 +62,7 @@ def __add__(self, other):
61
62
contents = self .contents + other .contents ,
62
63
origin = self .origin ,
63
64
visible = self .visible ,
65
+ lattice = self .lattice ,
64
66
_meta = {self .name : self ._meta , other .name : other ._meta },
65
67
)
66
68
@@ -91,6 +93,7 @@ def to_json(self):
91
93
name = self .name ,
92
94
contents = self .merge_primitives (self .contents ),
93
95
origin = self .origin ,
96
+ lattice = self .lattice ,
94
97
)
95
98
96
99
def remove_defaults (scene_dict ):
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ def get_structure_scene(
69
69
Args:
70
70
self: Structure object
71
71
origin: fractional coordinate of the origin
72
- legend: Legend for the sites
72
+ legend: Legend for the sites\
73
73
draw_image_atoms: If true draw image atoms that are just outside the
74
74
periodic boundary
75
75
@@ -95,16 +95,18 @@ def get_structure_scene(
95
95
site .lattice ,
96
96
properties = site .properties ,
97
97
)
98
-
99
98
site_scene = site .get_scene (legend = legend ,)
100
99
for scene in site_scene .contents :
101
100
primitives [scene .name ] += scene .contents
102
101
103
102
primitives ["unit_cell" ].append (self .lattice .get_scene ())
104
103
104
+ lattice_vectors = [list (array ) for array in self .lattice .matrix ]
105
+
105
106
return Scene (
106
107
name = "Structure" ,
107
108
origin = origin ,
109
+ lattice = lattice_vectors ,
108
110
contents = [
109
111
Scene (name = k , contents = v , origin = origin ) for k , v in primitives .items ()
110
112
],
You can’t perform that action at this time.
0 commit comments