.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/geometry/plot_ring_2.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_geometry_plot_ring_2.py: 2x2 Ring - Geometry Visualization ================================= This script demonstrates how to create and visualize a 2x2 ring geometry using the FiberFusing library. .. GENERATED FROM PYTHON SOURCE LINES 6-49 .. image-sg:: /gallery/geometry/images/sphx_glr_plot_ring_2_001.png :alt: Fiber structure, Fiber structure :srcset: /gallery/geometry/images/sphx_glr_plot_ring_2_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none
| .. code-block:: Python from FiberFusing import Geometry, DomainAlignment, BackGround from FiberFusing.fiber import FiberLoader from FiberFusing.profile import Profile, StructureType # Set up the background medium (air) air_background = BackGround(refractive_index=1.0) # Create the profile structure based on the fused fiber profile profile = Profile() profile.add_structure( structure_type=StructureType.CIRCULAR, number_of_fibers=2, fusion_degree=0.4, fiber_radius=62.5e-6 ) profile.refractive_index = 1.4444 # Refractive index of silica at the specified wavelength # Load fibers (e.g., SMF-28) positioned at the cores of the profile structure fiber_loader = FiberLoader() fibers = [ fiber_loader.load_fiber('SMF28', clad_refractive_index=profile.refractive_index, position=core_position) for core_position in profile.cores ] # Set up the geometry with the defined background, profile structure, and resolution geometry = Geometry( x_bounds=DomainAlignment.CENTERING, y_bounds=DomainAlignment.CENTERING, resolution=280 ) # Add the fibers to the geometry geometry.add_structure(air_background, profile, *fibers) geometry.initialize() # Plot the resulting geometry geometry.plot() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.724 seconds) .. _sphx_glr_download_gallery_geometry_plot_ring_2.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_ring_2.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_ring_2.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_ring_2.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_