fastpli.objects.fibers.FiberBundle
- class FiberBundle(data=None, layers=None, dtype=None)[source]
Bases:
object
Methods
appends Fiber to FiberBundle
Applies function to fibers
Applies function to fibers positions
Applies function to fibers radii
Returns copy data as list(np.array)
Cast objects into new type
deep copy of class
Cut fiber into voi.
Cut fiber into sphere.
extends Fiber to FiberBundle
Rotates fiber_bundle around offset
Rescales fiber_bundle
Translates fiber_bundle
Attributes
dtype of containing Fibers
Returns layer properties of fiber_bundle
- apply(fun)[source]
Applies function to fibers
- Parameters
fun (function)
- Returns
res – fun(fiber_bundle)
- Return type
- apply_to_points(fun)[source]
Applies function to fibers positions
- Parameters
fun (function)
- Returns
res – fun(fiber_bundle.points)
- Return type
- apply_to_radii(fun)[source]
Applies function to fibers radii
- Parameters
fun (function)
- Returns
res – fun(fiber_bundle.radii)
- Return type
- 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
- 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
- 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
- property dtype
dtype of containing Fibers
- property layers
Returns layer properties of fiber_bundle
- Returns
res – Layers class containing [Layer].
- Return type
- 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
- 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