Closed
Milestone
Description
Based on StackEnjoyer/BeamletOptics.jl#116:
-
Center ray guarantee. The first beam of every
CollimatedSourceandPointSourcegenerated by a constructor is the center ray:first(BMO.beams(src))starts at the source position along the source direction. This holds forCollimatedSource,PointSource,UniformDiscSource,UniformPointSourceand the two new sources, also afterset_num_rays!. The sunflower sources had no center ray before; their spiral now starts at the center. -
Two new exported sources, both constructors of the existing types:
UniformLineSource(pos, dir, width, λ = 1e-6; num_rays = 101, basis)returns aCollimatedSource: parallel rays equidistant on a line alongbasis.UniformFanSource(pos, dir, θ, λ = 1e-6; num_rays = 101, basis)returns aPointSource: rays with equidistant angles in[-θ, θ]in the plane ofdirandbasis.
Their samplings are the new public names
BMO.DiscLineandBMO.ConeFan.
What does not hold
- Sources that wrap given beams (
CollimatedSource(beams, …),PointSource(beams, …), samplingBMO.NoSampling) have no center ray guarantee.BMO.min_num_rays(src) === nothingidentifies them.AstigmaticBeamGroups are not covered either. - After the source was moved, the center ray agrees with
position(src)anddirection(src)only up to rounding (about 1e-16). Afterset_pivot3d!,position(src)is the pivot, not the emission point. Take the snap point from the beam, not from the group pose.
Tasks
-
_central_beam(src/LivePolarization.jl): returnfirst(BMO.beams(src))for aCollimatedSourceorPointSourcewhose rays can be regenerated (BMO.min_num_rays(src) !== nothing). Keep the nearest-to-axis search as the fallback for wrapped beams and other beam groups. Snap, align, measure and the polarization overlay use this function. -
_beam_text(src/LiveCardRows.jl): the docstring says the AOI is that of "the center ray of a ring source". The first ray is now the center ray of all generated sources; update the docstring. Check that the first hit in_hitsis still the center ray if the center ray misses the object. - Ray slider (
_ray_stepsinsrc/LiveCardRows.jl): the steps 10, 20, 50, 100, … are even. For a line or fan source, an even number of rays yields the pattern ofn - 1rays plus a second ray at the center, since a pattern that is symmetric to its center ray has an odd number of rays. Use odd steps (11, 21, 51, 101, …) for sources withsrc.sampling isa Union{BMO.DiscLine, BMO.ConeFan}. - Catalog (
_builtin_cataloginsrc/LiveCatalogEntries.jl): add "Uniform line source" (UniformLineSource, parameters width, wavelength, rays) and "Uniform fan source" (UniformFanSource, parameters half angle, wavelength, rays), with a default of 101 rays. Both need icons. - Plane of the rays in the catalog: the sources are constructed along +y without
basis, for which BMO picksnormal3d([0, 1, 0]) = [0, 0, -1], i.e. the line or fan lies in the y-z plane. Decide whether the entries passbasis = [1, 0, 0](rays in the x-y plane of the breadboard) and whether the generated code shows it. - Card of a line source: it is a
CollimatedSource, sopropertiesand the source row show its width as "Diameter". Decide whether the card should say "width" forBMO.DiscLine. - Tests: add both sources to the list in
test/TestLiveCatalogEntries.jland add code string tests like those ofUniformDiscSource. Add a test that_central_beamreturns the first beam of all six generated sources and the nearest beam for a wrapped source. - Skill: add both sources to the list in
skills/beamletopticsgui/API.md.
Check after the BMO update
- Tests that depend on the position of the first ray of a
UniformDiscSourceorUniformPointSource: it moved onto the axis. All other rays of these sources are unchanged.
Metadata
Metadata
Assignees
Labels
No labels
Activity
Line and fan sources in the catalog, center ray of BMO sources (#22)