geoparticle.shapes.FilledTorus

class FilledTorus(r_minor: float, r_major: float, dl: float, plane='XOY', phi_range='[180,270)', name=None, anchor: Sequence[float] = (0, 0, 0))[source]

Bases: ThickTorusWall

3D filled torus volume.

Shortest import: from geoparticle import FilledTorus

__init__(r_minor: float, r_major: float, dl: float, plane='XOY', phi_range='[180,270)', name=None, anchor: Sequence[float] = (0, 0, 0))[source]
Parameters:
  • r_minor (float) – Outer radius of the torus tube.

  • r_major (float) – Radius of the torus centerline.

  • dl (float) – Spacing between points in the grid.

  • plane (str, optional) – Plane in which the torus lies. Defaults to ‘XOY’.

  • phi_range (str, optional) – Angular range of the torus in degrees. Defaults to ‘[180,270)’. Interval notation should be used, where [ and ] denote inclusion, whereas ( and ) denote exclusion, e.g., [180,270), (0, 90), etc. Use [0,360) for a full torus.

  • name (str, optional) – Name of the filled torus. Defaults to None.

  • anchor (Sequence[float]) – The anchor coordinate to determine the absolute position of the torus. The anchor is the center of the major circle.

Methods

__init__(r_minor, r_major, dl[, plane, ...])

param r_minor:

Outer radius of the torus tube.

check_overlap([tol])

Check if there are overlapping points in the geometry.

clip(keep, *[, plane_name, plane_normal, ...])

Clip geometry by a half-space defined by a named plane or an arbitrary plane.

coord2id(x, y, z)

Find the nearest vertex index/indices and its/their coordinates.

copy([name])

Create a deep copy of the geometry object.

equal(geo)

Check if two geometries are equal based on their coordinates.

get_and_delete(ids)

Extract points by their indices and remove them from the geometry.

get_counter()

Get the current value of the class-wide counter.

intersect(geometries[, rmax, inplace, name])

Keep points from self that are within rmax of at least one point in every other geometry.

load_from(other)

Copy coordinate arrays and dimension from another Geometry into this instance.

mirror(plane_name, plane_pos[, inplace, name])

Mirror the geometry across a principal plane.

plot([ax, ms, alpha])

Plot the geometry points in 2D.

rotate(angle_deg[, axis_direction, ...])

Rotate the geometry around a principal axis or a custom axis.

set_coord(xs, ys, zs)

Set the coordinates of the geometry, broadcasting scalars if necessary.

shift([x, y, z, inplace, name])

Translate the geometry by the given offsets.

stack(axis, n_axis, dl, dimension[, ...])

Stack a planar layer (self) along axis by repeating points at spacing dl.

subtract(geo2[, rmax, inplace, name])

Return points from self that are at least rmax away from any point in geo2.

union(geometries[, inplace, name])

Concatenate this geometry with others and return a new Geometry.

Attributes

counter

flatten_coords

Get the flattened array of coordinates.

matrix_coords

Get the coordinates as a 2D array.

size

Get the number of points in the geometry.

counter = 0