rsoft_cad.utils.fiber_layout package

Submodules

rsoft_cad.utils.fiber_layout.circular module

Circular module for RSoft CAD utilities

rsoft_cad.utils.fiber_layout.circular.lantern_layout(cladding_dia, n, rot=1.5707963267948966)[source]

Computes the positions of 5 circles arranged in a circular fashion around a larger reference circle.

Parameters:

cladding_dia (float) – Diameter of the smaller circles (cladding diameter).

Returns:

(R, centres_x, centres_y) where:

R (float): Radius of the reference circle. centres_x (ndarray): x-coordinates of cladding circle centres. centres_y (ndarray): y-coordinates of cladding circle centres.

Return type:

tuple

rsoft_cad.utils.fiber_layout.circular.find_scale_factor(start_dia, n, start_scale, end_scale, step_scale)[source]

rsoft_cad.utils.fiber_layout.hexagonal module

Hexagonal module for RSoft CAD utilities

rsoft_cad.utils.fiber_layout.hexagonal.hexagonal_fiber_layout(fiber_dia, num_rings=3, spacing_factor=1.0)[source]

Computes the positions of fibers arranged in a hexagonal pattern.

Parameters:
  • fiber_dia (float) – Diameter of the fibers.

  • num_rings (int) – Number of hexagonal rings around the central fiber.

  • spacing_factor (float) – Factor to adjust spacing between fibers (1.0 = touching).

Returns:

(centers_x, centers_y) where:

centers_x (ndarray): x-coordinates of fiber centers. centers_y (ndarray): y-coordinates of fiber centers.

Return type:

tuple

rsoft_cad.utils.fiber_layout.hexagonal.calculate_capillary_diameter(fiber_dia, num_rings=3, spacing_factor=1.0)[source]

Calculate the diameter of the capillary that fits all fibers in a hexagonal packing.

Parameters:
  • fiber_dia (float) – Diameter of each fiber

  • num_rings (int) – Number of rings in the hexagonal packing

  • spacing_factor (float) – Factor to adjust spacing between fibers (1.0 = touching)

Returns:

Diameter of the encompassing circle

Return type:

float

rsoft_cad.utils.fiber_layout.visualise_layout module

Visualisation module for RSoft CAD utilities

rsoft_cad.utils.fiber_layout.visualise_layout.visualise_lantern(n, cladding_dia=125, show_scale_factor_plot=True)[source]

Visualize a lantern layout with n cladding circles.

Parameters:

nint

Number of cladding circles

cladding_diafloat

Diameter of the cladding circles in microns (default: 125)

show_scale_factor_plotbool

If True, shows the scale factor vs radius plot (default: True)

Returns:

tuple

(fig, ax) for the main lantern layout plot (fig1, ax1) for the scale factor plot (if show_scale_factor_plot=True)

rsoft_cad.utils.fiber_layout.visualise_layout.plot_hexagonal_fibers(fiber_dia, num_rings=3, spacing_factor=1.0)[source]

Plots the fibers in a hexagonal pattern.

Parameters:
  • fiber_dia (float) – Diameter of the fibers.

  • num_rings (int) – Number of hexagonal rings around the central fiber.

  • spacing_factor (float) – Factor to adjust spacing between fibers (1.0 = touching).

rsoft_cad.utils.fiber_layout.visualise_layout.visualise_lp_lantern(lp_modes_dict, cladding_dia=125)[source]

Visualize a lantern layout with LP modes positioned according to the provided dictionary.

Parameters:

lp_modes_dictdict

Dictionary containing LP mode names as keys and coordinate tuples as values Example: {‘LP01’: (x1, y1), ‘LP11a’: (x2, y2), …}

cladding_diafloat

Diameter of the cladding circles in microns (default: 125)

Returns:

tuple

(fig, ax) for the main lantern layout plot