magneticalc.Wire.Wire

# ``magneticalc`.`Wire`.`Wire``

class documentation

`class Wire(Validatable):`

Constructor: `Wire()`

View In Hierarchy

Wire class.

Method | `__init__` | Initializes an empty wire. A 3D piecewise linear curve with some DC current associated with it.
Method | `recalculate` | Slices wire segments into smaller ones until segment lengths equal or undershoot slicer limit.
Method | `set` | Sets the parameters.
Instance Variable | `bounds` | Undocumented
Instance Variable | `dc` | Undocumented
Instance Variable | `points_base` | Undocumented
Instance Variable | `points_transformed` | Bounding box: Minimum bounds (3D point), maximum bounds (3D point).
Property | `elements` | Wire elements
Property | `length` | Wire length
Property | `points_sliced` | Returns this wire's points after slicing.
Static Method | `_transform_rotational_symmetry` | This transformation replicates and rotates this curve `count` times about an `axis` with radius `radius`.
Static Method | `_transform_stretch` | This transformation stretches (and/or mirrors) this curve by some factor in any direction. Use the factor +1 / -1 to retain / mirror the curve in that direction.
Instance Variable | `_elements` | Undocumented
Instance Variable | `_length` | Wire Elements: Ordered list of segment center points and directions.
Instance Variable | `_points_sliced` | Undocumented
Instance Variable | `_slicer_limit` | Undocumented

Inherited from `Validatable`:

Method | `valid.setter` | No summary
Property | `valid` | True if valid, False if invalid
Instance Variable | `_valid` | Undocumented

def __init__(self):
overrides `magneticalc.Validatable.Validatable.__init__`

Initializes an empty wire. A 3D piecewise linear curve with some DC current associated with it.

@validator
def recalculate(self, progress_callback: `Callable`) -> `bool`:

Slices wire segments into smaller ones until segment lengths equal or undershoot slicer limit.

Parameters
progress_callback: `Callable` | Progress callback

Returns
`bool` | True if successful, False if interrupted

def set(self, points: `np.ndarray`, stretch: `np.ndarray`, rotational_symmetry: `dict`, close_loop: `bool`, slicer_limit: `float`, dc: `float`):

Sets the parameters.

Parameters
points: `np.ndarray` | Ordered list of 3D coordinates (see presets)
stretch: `np.ndarray` | XYZ stretch transform factors (3D point)
rotational_symmetry: `dict` | Dictionary for rotational symmetry transform
close_loop: `bool` | Enable to transform the wire into a closed loop (append first point)
slicer_limit: `float` | Slicer limit
dc: `float` | Wire current (A)

bounds =

Undocumented

dc =

Undocumented

points_base =

Undocumented

points_transformed =

Bounding box: Minimum bounds (3D point), maximum bounds (3D point).

@property
@require_valid
elements: `np.ndarray` =

Wire elements

@property
@require_valid
length: `float` =

Wire length

@property
@require_valid
points_sliced: `np.ndarray` =

Returns this wire's points after slicing.

@staticmethod
def _transform_rotational_symmetry(axes: `np.ndarray`, parameters: `dict`, close_loop: `bool`) -> `np.ndarray`:

This transformation replicates and rotates this curve `count` times about an `axis` with radius `radius`.

Parameters
axes: `np.ndarray` | Transposed array of Wire points
parameters: `dict` | Dictionary containing the transformation parameters (number of replications, radius, axis and offset angle)
close_loop: `bool` | Enable to transform the wire into a closed loop (append first point)

Returns
`np.ndarray` | Transposed array of Wire points

@staticmethod
def _transform_stretch(axes: `np.ndarray`, stretch: `np.ndarray`) -> `np.ndarray`:

This transformation stretches (and/or mirrors) this curve by some factor in any direction. Use the factor +1 / -1 to retain / mirror the curve in that direction.

Parameters
axes: `np.ndarray` | Transposed array of Wire points
stretch: `np.ndarray` | XYZ stretch transform factors (3D point)

Returns
`np.ndarray` | Transposed array of Wire points

_elements =

Undocumented

_length =

Wire Elements: Ordered list of segment center points and directions.

_points_sliced =

Undocumented

_slicer_limit =

Undocumented