MCPcopy Create free account
hub / github.com/NanoComp/meep / shift

Method shift

python/geom.py:1117–1130  ·  view source on GitHub ↗

Shifts the object's `center` by `vec` (`Vector3`), returning a new object. This can also be accomplished via the `+` operator: ```python geometric_obj + Vector3(10,10,10) ``` Using `+=` will shift the object in place.

(self, vec)

Source from the content-addressed store, hash-verified

1115 return self
1116
1117 def shift(self, vec):
1118 """
1119 Shifts the object's `center` by `vec` (`Vector3`), returning a new object.
1120 This can also be accomplished via the `+` operator:
1121
1122 ```python
1123 geometric_obj + Vector3(10,10,10)
1124 ```
1125
1126 Using `+=` will shift the object in place.
1127 """
1128 c = deepcopy(self)
1129 c.center += Vector3(*vec)
1130 return c
1131
1132 def info(self, indent_by=0):
1133 """

Callers 4

__add__Method · 0.95
__radd__Method · 0.95
_dupFunction · 0.80
test_shiftMethod · 0.80

Calls 1

Vector3Class · 0.85

Tested by 1

test_shiftMethod · 0.64