Repository navigation
Releases
Releases · StackEnjoyer/BeamletOptics.jl
v0.14.0
BeamletOptics v0.14.0
Breaking changes
- Refractive indices are
AbstractRefractiveIndexvalues. Every constructor that takes a refractive index (lenses, prisms, plate and cube beamsplitters, compensator plates, polarizers) throws aMethodErrorfor a number or a function such asλ -> 1.5. WriteConstantRefractiveIndex(1.5), or useSellmeierEquationorDiscreteRefractiveIndex. For your own dispersion formula, definestruct MyGlass <: BeamletOptics.AbstractRefractiveIndex endand(::MyGlass)(λ) = .... BeamletOptics.RefractiveIndexis removed. UseBeamletOptics.AbstractRefractiveIndexas the type bound of a refractive index.- Detector readouts take a sampling instead of keywords.
intensity(pd; n = 200, crop_factor = 5, x_min = a, x_max = b)becomesintensity(pd, RegularGrid(num_points = 200, crop_factor = 5, x_min = a, x_max = b)), and the same holds forelectric_fieldandoptical_power. UseRectilinearGrid(xs, zs)for your own axes. The keywordnum_spotsis gone, and a single bound such asx_minnow applies on its own. intensity(pd, Z)no longer takes a wave impedance. Writeintensity(pd), which uses the refractive index of the hits.electric_field(pd)ofAstigmaticGaussianBeamlethits returns 3D field vectors, as forPolarizedRayhits. Writesum.(abs2, E)instead ofabs2.(E), or useintensity(pd).solve_system!has no keywordretrace, andBeamletOptics.retrace_system!is removed. Every solve traces the beam from its start, soempty!(beam)before solving again is no longer needed. Child beams are new objects after each solve: read them again after every solve.set_num_rays!is renamednum_rays!.propertiesanddefault_propertiesare no longer exported and only accept objects, beams and groups. WriteBeamletOptics.properties(x).MeshDummy(path)is removed: writeNonInteractableObject(path). The deprecatedConcaveSphericalMirroris removed: writeSphericalMirror.get_sdf_inside_stepand the preferencesdf_inside_stepare removed without a replacement, since rays inside a shape now leave at its first exit. Delete the call.BeamletOptics.hit_count(detector)is removed. Writelength(detector).BeamletOptics.beamlet_hit_field(hit, p)is removed. Writeelectric_field(hit, p), which returns a 3D vector for anAstigmaticGaussianBeamletHit.BeamletOptics.AbstractSamplingis renamedBeamletOptics.AbstractSourceSampling.BeamletOptics.is_static(x)is removed. WriteBeamletOptics.kinematic_trait_of(x) isa BeamletOptics.Static.BeamletOptics.render_children(h)is removed. WriteBeamletOptics.children(h), and defineBeamletOptics.childrenfor your own system render handles.GaussianBeamletHitandAstigmaticGaussianBeamletHitstore values and no longer refer to their beamlet:hit.gauss,hit.agb,hit.idandposition(hit)are gone. Keep the beamlet yourself, and read a hit withdirection(hit)andBeamletOptics.wavelength(hit).WavefrontBeamletDecompositionandGaussianModeDecompositiontake the position of the grid beforedir, e.g.WavefrontBeamletDecomposition(x, y, amplitude, phase, pos, dir, λ). The keywordoriginis gone. Passzeros(3)for the previous placement.GaussianBeamletDecompositionthrows anArgumentErrorif its beamlets are not narrower than the beam, i.e. forn_grid ≤ 4with the defaultoverlap. Use a largern_grid.GaussianBeamletthrows anArgumentErrorfor asupportvector that is not orthogonal to the direction. Before, it built a wrong waist. Pass a vector normal todir.ObjectGroupis no longer anAbstractObject. AVector{AbstractObject}cannot hold a group, methods typed::AbstractObjectdo not receive groups, andBeamletOptics.shape(group)is gone. Write[lens, group]andBeamletOptics.objects(group). The type has one parameter:ObjectGroup{T}.- Moving a group or composite object whose parts share a shape, e.g. a
DoubletLenstogether with its own front lens, throws anArgumentErrorbefore anything moves. Before, the shared shape moved twice. Add each part to a group only once. - The field
orientationofCollimatedSource,PointSourceandAstigmaticBeamGroupis renameddir. Readorientation(source). Your ownAbstractBeamGrouptypes rename the field or defineorientationandorientation!. - The OpticsBase extension loads with
using OpticsBase. Remove theinclude(... "BeamletOpticsOpticsBaseExt.jl")line from the previous docs. BeamletOptics.kinematic_trait_ofthrows for a type without a method instead of returningStatic(). Declare it for your own types that use the kinematic verbs.- Your own
AbstractSystemtypes must defineBeamletOptics.objects(system), which every solve calls. - Your own
AbstractObjectGrouptypes are no longerAbstractObjects. They aremutable structs with the fieldsobjects,center::Point3{T}anddir::SMatrix{3,3,T,9}. BeamletOptics.children!throws for a beam that already has children. UseBeamletOptics.relaunch!to replace them.- Your own
AbstractDetectortypes are emptied by every move and byinitialize!. DefineBase.empty!for them. BeamletOptics.thicknessof aUnionSDForDifferenceSDFcounts every operand and throws for an operand without athicknessmethod. DefineBeamletOptics.thicknessfor your own SDFs.z0ofAstigmaticGaussianBeamletis the offset of the waist fromposition, as forGaussianBeamlet. Before, the whole beamlet started atposition + z0 * direction. For the previous beam, start atposition + z0 * directionand passz0_x - z0andz0_y - z0.- A
GaussianBeamletstops tracing with a warning where its Lagrange invariant leavesget_lagrange_tolerance()(default 50 %) of its start value, e.g. behind a strong ball lens. Passcheck_invariant = falsetosolve_system!to trace on as before. - The Lagrange check of
AstigmaticGaussianBeamletis relative to its start value withinget_lagrange_tolerance(), so beamlets withM2 > 4are no longer stopped, andthresholdlimits only the complex invariant. Change the limit withset_lagrange_tolerance!and restart Julia. - Moving a detector, also as part of a group, empties it. Read it out before moving it, or move it and solve again.
- A detector without hits reads as zero field, intensity and power and as an empty spot diagram instead of throwing. Test
length(pd) == 0instead of catching the error. intensityandoptical_powerof a detector are the flux through it, andelectric_fieldis no longer projected. On a tilted detector, the intensity of rays scales with cos θ instead of cos² θ, that of polarized rays with cos θ instead of 1, and the field of beamlets is larger by 1/√cos θ.optical_poweris the beam power at any angle of incidence.- The default window of
GaussianBeamlethits spans 3 beam radii instead of 1.5, and beamlet windows widen with 1/cos θ on a tilted detector, so default maps are wider and coarser. PassRegularGrid(crop_factor = 1.5)for the previous window. gauss_parameters(::GaussianBeamlet, z)returns asψthe Gouy phase collected from the start of the beam, continuous at every surface. Before, it was relative to the local waist.gauss_parameters(gauss, z, 0)gives the previous value.- Beamlet sources carry
P0as their total power.CollimatedGaussianBeamletSourcehas a new keywordP0(1 mW for the whole source; before, 1 mW per beamlet).SphericalGaussianBeamletSource,EllipticalGaussianBeamletSourceandGaussianBeamletDecompositionno longer emit about 30P0and 0.95P0respectively. TheirE0sets only the polarization and phase. num_ringsofEllipticalGaussianBeamletSourcecounts the center as a ring, like the other sources. Passnum_rings + 1for the previous rings.- Ring sources give each ring a number of rays in proportion to its area, so the edge ring of
CollimatedSource,PointSourceand the beamlet cone sources gets fewer rays. The first ray ofUniformDiscSourceandUniformPointSourceis the center ray on the axis. - Invalid arguments of sources and
num_rays!throw anArgumentErrorinstead of anErrorException. - Beamsplitter coatings and polarizer films are drawn in saturated colors in both looks. Pass
colorandalphatorender!to change them. - Live beam plots hold one color per vertex. Set the color with
BeamletOptics.render_settings!(h; color = ...)instead of on the plot.BeamletOptics.render_settings(h)includescolor.
Features
- Detector readouts on
RegularGrid,RectilinearGridor your own samplings (BeamletOptics.AbstractDetectorSampling);ray_hitsgives the directions of the rays on a detector UniformLineSourceandUniformFanSource;path_segmentslists a traced beam tree as flat segmentsPrism(vertices, height, n)for convex polygons,EquilateralPrism,DovePrism, surface-basedDoubletLensandTripletLens,NonInteractableObject(path)for mesh filespush!,delete!,pop!andpopat!forObjectGroup; your own assembly types viaBeamletOptics.AbstractObjectGroup;initialize!andsolve_system!(...; initialize = true)empty the detectors- The OpticsBase extension is declared and loads with
using OpticsBase;PlaneFieldof beamlet hits - Rendering:
color = :wavelength,wavelength_color(λ),show_bounding_sphere = true - Faster solves: bounding sphere pretest, aspheres about twice as fast, balanced threads for beam groups
Bugfixes
GaussianBeamlet: waist radius at tilted waists and for largeM2, Gouy phase behind lenses, phase and field in mediaAstigmaticGaussianBeamlet: field follows polarizers and Fresnel losses, children continue their parent, no Gouy phase jump at mirrors, powe...
v0.13.13
BeamletOptics v0.13.13
Merged pull requests:
- Add OpticsBase extension: PlaneField from detectors and back to beamlets (#98) (@TacHawkes)
- Bugfix: registration failed on unregistered OpticsBase (#110) (@StackEnjoyer)
v0.13.12
BeamletOptics v0.13.12
Merged pull requests:
- Feature/system push pop (#99) (@StackEnjoyer)
Closed issues:
- Add push!/pop! capability to
System(#97)
v0.13.11
BeamletOptics v0.13.11
Merged pull requests:
- Draft: Live rendering and interactive live_view (#78) (@TacHawkes)
v0.13.10
BeamletOptics v0.13.10
Merged pull requests:
- REPL progress bars for beam groups and field calculations (#90) (@StackEnjoyer)
v0.13.9
v0.13.8
v0.13.7
BeamletOptics v0.13.7
Merged pull requests:
- renable forwarddiff for aspheres (#81) (@StackEnjoyer)
- fix issue #82 (#83) (@StackEnjoyer)
- Fix/polarized ray numerics (#86) (@TacHawkes)
Closed issues:
v0.13.6
v0.13.5
BeamletOptics v0.13.5
Merged pull requests:
- BMO Workspaces (#67) (@StackEnjoyer)
- SDF - operator and conic mirrors (#68) (@StackEnjoyer)
- CompatHelper: add new compat entry for GeometryBasics at version 0.5 for package test, (keep existing compat) (#69) (@github-actions[bot])
- CompatHelper: add new compat entry for AbstractTrees at version 0.4 for package test, (keep existing compat) (#70) (@github-actions[bot])
- CompatHelper: add new compat entry for Makie at version 0.24 for package test, (keep existing compat) (#71) (@github-actions[bot])
- CompatHelper: add new compat entry for BeamletOptics at version 0.13 for package test, (keep existing compat) (#72) (@github-actions[bot])
- CompatHelper: add new compat entry for GLMakie at version 0.13 for package docs, (keep existing compat) (#73) (@github-actions[bot])
- CompatHelper: add new compat entry for BeamletOptics at version 0.13 for package docs, (keep existing compat) (#74) (@github-actions[bot])
- CompatHelper: add new compat entry for CairoMakie at version 0.15 for package docs, (keep existing compat) (#75) (@github-actions[bot])