fastpli.objects.fibers.FiberBundle

class FiberBundle(data=None, layers=None, dtype=None)[source]

Bases: object

Methods

append

appends Fiber to FiberBundle

apply

Applies function to fibers

apply_to_points

Applies function to fibers positions

apply_to_radii

Applies function to fibers radii

as_array

Returns copy data as list(np.array)

cast

Cast objects into new type

copy

deep copy of class

cut

Cut fiber into voi.

cut_sphere

Cut fiber into sphere.

extend

extends Fiber to FiberBundle

rotate

Rotates fiber_bundle around offset

scale

Rescales fiber_bundle

translate

Translates fiber_bundle

Attributes

dtype

dtype of containing Fibers

layers

Returns layer properties of fiber_bundle

append(fiber)[source]

appends Fiber to FiberBundle

apply(fun)[source]

Applies function to fibers

Parameters

fun (function)

Returns

res – fun(fiber_bundle)

Return type

FiberBundle

apply_to_points(fun)[source]

Applies function to fibers positions

Parameters

fun (function)

Returns

res – fun(fiber_bundle.points)

Return type

FiberBundle

apply_to_radii(fun)[source]

Applies function to fibers radii

Parameters

fun (function)

Returns

res – fun(fiber_bundle.radii)

Return type

FiberBundle

as_array()[source]

Returns copy data as list(np.array)

Returns

res – fiber bundle as list(np.array)

Return type

[(n,4)-array]

cast(dtype)[source]

Cast objects into new type

Parameters

dtype (type)

Returns

res – casted fiber_bundle

Return type

fiber_bundle

copy()[source]

deep copy of class

cut(voi)[source]

Cut fiber into voi. The cutting process can create multiple fibers. It checks every fiber_segment_aabb if it overlapps with the voi.

Parameters

voi ([xmin, ymin, zmin],[xmax,ymax,zmax]) – Volume of interest of which fibers to include. E.g. same as in Simulation

Returns

res – cutted fiber_bundle

Return type

FiberBundle

cut_sphere(radius, center=(0, 0, 0))[source]

Cut fiber into sphere. The cutting process can create multiple fibers. It checks every fiber_segment_aabb if it overlapps with the sphere.

Parameters
  • radius (float) – radius of cutting sphere

  • center (3d-array) – center of cutting sphere

Returns

res – cutted fiber_bundle

Return type

FiberBundle

property dtype

dtype of containing Fibers

extend(fibers)[source]

extends Fiber to FiberBundle

property layers

Returns layer properties of fiber_bundle

Returns

res – Layers class containing [Layer].

Return type

Layers

rotate(rot, offset=None)[source]

Rotates fiber_bundle around offset

Parameters
  • rot ((3,3)-array_like) – rotation matrix

  • offset (3d-array-array_like, optional) – offset for rotation center

Returns

res – rotated fiber_bundle

Return type

FiberBundle

scale(scale, mode='all')[source]

Rescales fiber_bundle

Parameters
  • scale (float) – scale factor

  • mode (str, optional) – ‘all’, ‘points’ or ‘radii’ will be scaled

Returns

res – scaled fiber_bundle

Return type

FiberBundle

translate(offset)[source]

Translates fiber_bundle

Parameters

offset (3d-array-array_like) – offset to translate

Returns

res – translated fiber_bundle

Return type

FiberBundle