openmc.model.Polygon

class openmc.model.Polygon(points, basis='rz')[source]

Polygon formed from a path of closed points.

New in version 0.13.3.

Parameters
  • points (np.ndarray) – An Nx2 array of points defining the vertices of the polygon.

  • basis ({'rz', 'xy', 'yz', 'xz'}, optional) – 2D basis set for the polygon. The polygon is two dimensional and has infinite extent in the third (unspecified) dimension. For example, the ‘xy’ basis produces a polygon with infinite extent in the +/- z direction. For the ‘rz’ basis the phi extent is infinite, thus forming an axisymmetric surface.

Variables
  • points (np.ndarray) – An Nx2 array of points defining the vertices of the polygon.

  • basis ({'rz', 'xy', 'yz', 'xz'}) – 2D basis set for the polygon.

  • regions (list of openmc.Region) – A list of openmc.Region objects, one for each of the convex polygons formed during the decomposition of the input polygon.

  • region (openmc.Union) – The union of all the regions comprising the polygon.

offset(distance: float | collections.abc.Sequence[float] | numpy.ndarray) Polygon[source]

Offset this polygon by a set distance

Parameters

distance (float or sequence of float or np.ndarray) – The distance to offset the polygon by. Positive is outward (expanding) and negative is inward (shrinking). If a float is provided, the same offset is applied to all vertices. If a list or tuple is provided, each vertex gets a different offset. If an iterable or numpy array is provided, each vertex gets a different offset.

Returns

offset_polygon

Return type

openmc.model.Polygon