fastpli.objects.fibers.FiberBundles

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

Bases: object

Methods

append

Appends 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(list(np.array))

cast

Cast objects into new type

copy

deep copy of class

cut

Cut fiber into voi.

cut_sphere

Cut fiber into voi.

extend

Extends FiberBundle

rotate

Rotates fiber_bundles around offset

scale

Rescales fiber_bundles

translate

Translates fiber_bundles

Attributes

dtype

layers

Returns layer properties of fiber_bundles

append(fiber_bundle)[source]

Appends FiberBundle

apply(fun)[source]

Applies function to fibers

Parameters

fun (function)

Returns

res – fun(fiber_bundles)

Return type

FiberBundles

apply_to_points(fun)[source]

Applies function to fibers positions

Parameters

fun (function)

Returns

res – fun(fiber_bundles[…].points)

Return type

FiberBundles

apply_to_radii(fun)[source]

Applies function to fibers radii

Parameters

fun (function)

Returns

res – fun(fiber_bundles[…].radii)

Return type

FiberBundles

as_array()[source]

Returns copy data as list(list(np.array))

Returns

res – fiber bundle as list(list(np.array))

Return type

[[(n,4)-array]]

cast(dtype)[source]

Cast objects into new type

Parameters

dtype (type)

Returns

res – fiber_bundles

Return type

FiberBundles

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_bundles

Return type

FiberBundles

cut_sphere(radius, center=(0, 0, 0))[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
  • radius (float) – radius of cutting sphere

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

Returns

res – cutted fiber_bundles

Return type

FiberBundles

extend(fiber_bundles)[source]

Extends FiberBundle

property layers

Returns layer properties of fiber_bundles

Returns

res – [Layers] class containing [Layer]. The element position corresponds to FiberBundle index

Return type

[Layers]

rotate(rot, offset=None)[source]

Rotates fiber_bundles around offset

Parameters
  • fiber_bundles ([[(,4)-array, …]]) – list of fibers

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

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

Returns

res – rotated fiber_bundles

Return type

FiberBundles

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

Rescales fiber_bundles

Parameters
  • scale (float) – scale factor

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

Returns

res – scaled fiber_bundles

Return type

FiberBundles

translate(offset)[source]

Translates fiber_bundles

Parameters

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

Returns

res – translated fiber_bundles

Return type

FiberBundles