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

Function box_vertices

python/visualization.py:292–309  ·  view source on GitHub ↗
(
    box_center: Vector3, box_size: Vector3, is_cylindrical: bool = False
)

Source from the content-addressed store, hash-verified

290
291
292def box_vertices(
293 box_center: Vector3, box_size: Vector3, is_cylindrical: bool = False
294) -> Tuple[float, float, float, float, float, float]:
295 # in cylindrical coordinates, radial (R) axis
296 # is in the range (0,R) rather than (-R/2,+R/2)
297 # as in Cartesian coordinates.
298 if is_cylindrical:
299 xmin = 0
300 xmax = box_size.x
301 else:
302 xmin = box_center.x - 0.5 * box_size.x
303 xmax = box_center.x + 0.5 * box_size.x
304 ymin = box_center.y - 0.5 * box_size.y
305 ymax = box_center.y + 0.5 * box_size.y
306 zmin = box_center.z - 0.5 * box_size.z
307 zmax = box_center.z + 0.5 * box_size.z
308
309 return xmin, xmax, ymin, ymax, zmin, zmax
310
311
312# ------------------------------------------------------- #

Callers 4

plot_volumeFunction · 0.85
plot_epsFunction · 0.85
get_boundary_volumesFunction · 0.85
plot_fieldsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected