diff --git a/Project.toml b/Project.toml index c349b9600..737f65383 100644 --- a/Project.toml +++ b/Project.toml @@ -17,6 +17,7 @@ FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" Format = "1fa38f19-a742-5d3f-a2b9-30dd87b9d5f8" ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" GLMakie = "e9467ef8-e4e7-5192-8a1a-b1aee30e663a" +GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326" HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3" ImageView = "86fae568-95e7-573e-a6b2-d8a6b900c9ef" Images = "916415d5-f1e6-5110-898d-aaa5f9f070e0" diff --git a/samples/notebooks/BasicCSG.jl b/samples/notebooks/BasicCSG.jl index 78d34f1e8..29482b400 100644 --- a/samples/notebooks/BasicCSG.jl +++ b/samples/notebooks/BasicCSG.jl @@ -29,8 +29,6 @@ begin import PlutoUI using Makie - using Makie.AbstractPlotting - using Makie.AbstractPlotting.MakieLayout defs = OpticSim.NotebooksUtils.Defs("ran") @@ -233,9 +231,9 @@ end begin function Vis.scene(resolution = (1000, 1000)) # @info "RG: Vis.Scene Replacement" - scene, layout = MakieLayout.layoutscene(resolution = resolution) + scene, layout = Makie.layoutscene(resolution = resolution) Vis.set_current_main_scene(scene) - lscene = layout[1, 1] = MakieLayout.LScene(scene, scenekw = (camera = Makie.cam3d_cad!, axis_type = Makie.axis3d!, raw = false)) + lscene = layout[1, 1] = Makie.LScene(scene, scenekw = (camera = Makie.cam3d_cad!, axis_type = Makie.axis3d!, raw = false)) Vis.set_current_3d_scene(lscene) return scene, lscene end diff --git a/samples/notebooks/EmittersIntro.jl b/samples/notebooks/EmittersIntro.jl index b550cb717..b2aae624a 100644 --- a/samples/notebooks/EmittersIntro.jl +++ b/samples/notebooks/EmittersIntro.jl @@ -43,8 +43,6 @@ begin import PlutoUI using Makie - using Makie.AbstractPlotting - using Makie.AbstractPlotting.MakieLayout defs = OpticSim.NotebooksUtils.Defs("ran") @@ -235,9 +233,9 @@ end begin function Vis.scene(resolution = (1000, 1000)) # @info "RG: Vis.Scene Replacement" - scene, layout = MakieLayout.layoutscene(resolution = resolution) + scene, layout = Makie.layoutscene(resolution = resolution) Vis.set_current_main_scene(scene) - lscene = layout[1, 1] = MakieLayout.LScene(scene, scenekw = (camera = Makie.cam3d_cad!, axis_type = Makie.axis3d!, raw = false)) + lscene = layout[1, 1] = Makie.LScene(scene, scenekw = (camera = Makie.cam3d_cad!, axis_type = Makie.axis3d!, raw = false)) Vis.set_current_3d_scene(lscene) return scene, lscene end @@ -346,7 +344,7 @@ begin local s2 = Sources.Source(sourcenum = 2, origins=Origins.Hexapolar(5, 8.0, 8.0), directions=Directions.Constant(), transform=Transform(zeros(Geometry.Vec3), rotationY(deg2rad(-8)) * unitZ3())) # create the "ray generator" - local combined_sources = Sources.CompositeSource(Transform(Geometry.Vec3(0.0, 0.0, 10.0), unitZ3() * -1), [s1 s2]) + local combined_sources = Sources.CompositeSource(Transform(Geometry.Vec3(0.0, 0.0, 10.0), unitZ3() * -1), [s1, s2]) # and draw the system + the generated rays Vis.drawtracerays(sys, raygenerator = combined_sources, resolution=resolution(), test = true, trackallrays = true, colorbysourcenum = true, drawgen = false) diff --git a/samples/notebooks/Samples.jl b/samples/notebooks/Samples.jl index bc44929ee..c5840e3da 100644 --- a/samples/notebooks/Samples.jl +++ b/samples/notebooks/Samples.jl @@ -43,8 +43,6 @@ begin import PlutoUI using Makie - using Makie.AbstractPlotting - using Makie.AbstractPlotting.MakieLayout defs = OpticSim.NotebooksUtils.Defs("ran") @@ -204,9 +202,9 @@ end begin function Vis.scene(resolution = (1000, 1000)) # @info "RG: Vis.Scene Replacement" - scene, layout = MakieLayout.layoutscene(resolution = resolution) + scene, layout = Makie.layoutscene(resolution = resolution) Vis.set_current_main_scene(scene) - lscene = layout[1, 1] = MakieLayout.LScene(scene, scenekw = (camera = Makie.cam3d_cad!, axis_type = Makie.axis3d!, raw = false)) + lscene = layout[1, 1] = Makie.LScene(scene, scenekw = (camera = Makie.cam3d_cad!, axis_type = Makie.axis3d!, raw = false)) Vis.set_current_3d_scene(lscene) return scene, lscene end diff --git a/src/NotebooksUtils/NotebooksUtils.jl b/src/NotebooksUtils/NotebooksUtils.jl index 942f3187a..ea777a7e9 100644 --- a/src/NotebooksUtils/NotebooksUtils.jl +++ b/src/NotebooksUtils/NotebooksUtils.jl @@ -10,8 +10,6 @@ import PlutoUI import Format import Makie -import Makie.AbstractPlotting -import Makie.AbstractPlotting.MakieLayout import WGLMakie import GLMakie @@ -250,13 +248,24 @@ function SetBackend(defs::Defs, be::String) if (be == "Web") @info "Makie backend set to WEB (WGLMakie)" WGLMakie.activate!() - AbstractPlotting.__init__() - AbstractPlotting.inline!(true) + # this try and catch is for Makie versions below 0.13 (where Abstract Plotting was removed and renamed to Makie) + # the display stack used to get shuffled around such that the Makie display did not take priority. + # with Makie v0.13 and above is should not be nececery but i didn't find a clean way to test for the Makie version + try + Makie.AbstractPlotting.__init__() + Makie.AbstractPlotting.inline!(true) + catch e + Makie.inline!(true) # for version 0.13 and above + end else @info "Makie backend set to STATIC (GLMakie)" GLMakie.activate!() - AbstractPlotting.__init__() - AbstractPlotting.inline!(true) + try + Makie.AbstractPlotting.__init__() + Makie.AbstractPlotting.inline!(true) + catch e + Makie.inline!(true) # for version 0.13 and above + end end end diff --git a/src/OpticSim.jl b/src/OpticSim.jl index d556b67d5..d62669b2d 100644 --- a/src/OpticSim.jl +++ b/src/OpticSim.jl @@ -19,7 +19,7 @@ using Revise # included here to allow a call to the activate! during the initialization import GLMakie -import Makie.AbstractPlotting +import Makie include("constants.jl") include("utilities.jl") @@ -43,7 +43,14 @@ function __init__() # this call is to try and keep the original behevior of Makie's default backend after adding the WGLMakie backend to the package try GLMakie.activate!() - AbstractPlotting.__init__() + # this try and catch is for Makie versions below 0.13 (where Abstract Plotting was removed and renamed to Makie) + # the display stack used to get shuffled around such that the Makie display did not take priority. + # with Makie v0.13 and above is should not be nececery but i didn't find a clean way to test for the Makie version + try + Makie.AbstractPlotting.__init__() + catch e + # do nothing + end catch e @warn "Unable to activate! the GLMakie backend\n$e" end diff --git a/src/Vis/Emitters.jl b/src/Vis/Emitters.jl index fac18fc9a..2ed72325c 100644 --- a/src/Vis/Emitters.jl +++ b/src/Vis/Emitters.jl @@ -8,8 +8,6 @@ using Distributions using StaticArrays import Makie -import Makie.AbstractPlotting -import Makie.AbstractPlotting.MakieLayout using .Emitters using .Emitters.Spectrum @@ -26,7 +24,7 @@ const MARKER_SIZE = 15 #------------------------------------- # draw debug information - local axes and positions #------------------------------------- -function maybe_draw_debug_info(scene::MakieLayout.LScene, o::Origins.AbstractOriginDistribution; transform::Geometry.Transform = Transform(), debug::Bool=false, kwargs...) where {T<:Real} +function maybe_draw_debug_info(scene::Makie.LScene, o::Origins.AbstractOriginDistribution; transform::Geometry.Transform = Transform(), debug::Bool=false, kwargs...) where {T<:Real} dir = forward(transform) uv = SVector{3}(right(transform)) @@ -35,7 +33,7 @@ function maybe_draw_debug_info(scene::MakieLayout.LScene, o::Origins.AbstractOri if (debug) # this is a stupid hack to force makie to render in 3d - for some scenes, makie decide with no apperent reason to show in 2d instead of 3d - AbstractPlotting.scatter!(scene, [pos[1], pos[1]+0.1], [pos[2], pos[2]+0.1], [pos[3], pos[3]+0.1], color=:red, markersize=0) + Makie.scatter!(scene, [pos[1], pos[1]+0.1], [pos[2], pos[2]+0.1], [pos[3], pos[3]+0.1], color=:red, markersize=0) # draw the origin and normal of the surface Makie.scatter!(scene, pos, color=:blue, markersize = MARKER_SIZE * visual_size(o)) @@ -43,18 +41,18 @@ function maybe_draw_debug_info(scene::MakieLayout.LScene, o::Origins.AbstractOri # normal arrow_start = pos arrow_end = dir * ARRROW_LENGTH * visual_size(o) - Makie.arrows!(scene.scene, [AbstractPlotting.Point3f0(arrow_start)], [AbstractPlotting.Point3f0(arrow_end)], arrowsize=ARRROW_SIZE * visual_size(o), arrowcolor=:blue) + Makie.arrows!(scene.scene, [Makie.Point3f0(arrow_start)], [Makie.Point3f0(arrow_end)], arrowsize=ARRROW_SIZE * visual_size(o), arrowcolor=:blue) arrow_end = uv * 0.5 * ARRROW_LENGTH * visual_size(o) - Makie.arrows!(scene.scene, [AbstractPlotting.Point3f0(arrow_start)], [AbstractPlotting.Point3f0(arrow_end)], arrowsize= 0.5 * ARRROW_SIZE * visual_size(o), arrowcolor=:red) + Makie.arrows!(scene.scene, [Makie.Point3f0(arrow_start)], [Makie.Point3f0(arrow_end)], arrowsize= 0.5 * ARRROW_SIZE * visual_size(o), arrowcolor=:red) arrow_end = vv * 0.5 * ARRROW_LENGTH * visual_size(o) - Makie.arrows!(scene.scene, [AbstractPlotting.Point3f0(arrow_start)], [AbstractPlotting.Point3f0(arrow_end)], arrowsize= 0.5 * ARRROW_SIZE * visual_size(o), arrowcolor=:green) + Makie.arrows!(scene.scene, [Makie.Point3f0(arrow_start)], [Makie.Point3f0(arrow_end)], arrowsize= 0.5 * ARRROW_SIZE * visual_size(o), arrowcolor=:green) # draw all the samples origins positions = map(x -> transform*x, collect(o)) - positions = collect(AbstractPlotting.Point3f0, positions) + positions = collect(Makie.Point3f0, positions) Makie.scatter!(scene, positions, color=:green, markersize = MARKER_SIZE * visual_size(o)) - # positions = collect(AbstractPlotting.Point3f0, o) + # positions = collect(Makie.Point3f0, o) # Makie.scatter!(scene, positions, color=:green, markersize = MARKER_SIZE * visual_size(o)) end @@ -64,15 +62,14 @@ end #------------------------------------- # draw point origin #------------------------------------- -# function OpticSim.Vis.draw!(scene::MakieLayout.LScene, o::Origins.Point; transform::Geometry.Transform = Transform(), kwargs...) where {T<:Real} -function OpticSim.Vis.draw!(scene::MakieLayout.LScene, o::Origins.Point; transform::Geometry.Transform = Transform(), kwargs...) where {T<:Real} +function OpticSim.Vis.draw!(scene::Makie.LScene, o::Origins.Point; transform::Geometry.Transform = Transform(), kwargs...) where {T<:Real} maybe_draw_debug_info(scene, o; transform=transform, kwargs...) end #------------------------------------- # draw RectGrid and RectUniform origins #------------------------------------- -function OpticSim.Vis.draw!(scene::MakieLayout.LScene, o::Union{Origins.RectGrid, Origins.RectUniform}; transform::Geometry.Transform = Transform(), kwargs...) where {T<:Real} +function OpticSim.Vis.draw!(scene::Makie.LScene, o::Union{Origins.RectGrid, Origins.RectUniform}; transform::Geometry.Transform = Transform(), kwargs...) where {T<:Real} dir = forward(transform) uv = SVector{3}(right(transform)) vv = SVector{3}(up(transform)) @@ -92,7 +89,7 @@ end #------------------------------------- # draw hexapolar origin #------------------------------------- -function OpticSim.Vis.draw!(scene::MakieLayout.LScene, o::Origins.Hexapolar; transform::Geometry.Transform = Transform(), kwargs...) where {T<:Real} +function OpticSim.Vis.draw!(scene::Makie.LScene, o::Origins.Hexapolar; transform::Geometry.Transform = Transform(), kwargs...) where {T<:Real} dir = forward(transform) uv = SVector{3}(right(transform)) vv = SVector{3}(up(transform)) @@ -109,7 +106,7 @@ end #------------------------------------- # draw source #------------------------------------- -function OpticSim.Vis.draw!(scene::MakieLayout.LScene, s::Sources.Source{T}; parent_transform::Geometry.Transform = Transform(), debug::Bool=false, kwargs...) where {T<:Real} +function OpticSim.Vis.draw!(scene::Makie.LScene, s::Sources.Source{T}; parent_transform::Geometry.Transform = Transform(), debug::Bool=false, kwargs...) where {T<:Real} OpticSim.Vis.draw!(scene, s.origins; transform=parent_transform * s.transform, debug=debug, kwargs...) @@ -136,7 +133,7 @@ end #------------------------------------- # draw optical rays #------------------------------------- -function OpticSim.Vis.draw!(scene::MakieLayout.LScene, rays::AbstractVector{OpticSim.OpticalRay{T, 3}}; kwargs...) where {T<:Real} +function OpticSim.Vis.draw!(scene::Makie.LScene, rays::AbstractVector{OpticSim.OpticalRay{T, 3}}; kwargs...) where {T<:Real} m = zeros(T, length(rays)*2, 3) for (index, optical_ray) in enumerate(rays) ray = OpticSim.ray(optical_ray) @@ -151,7 +148,7 @@ end #------------------------------------- # draw composite source #------------------------------------- -function OpticSim.Vis.draw!(scene::MakieLayout.LScene, s::Sources.CompositeSource{T}; parent_transform::Geometry.Transform = Transform(), kwargs...) where {T<:Real} +function OpticSim.Vis.draw!(scene::Makie.LScene, s::Sources.CompositeSource{T}; parent_transform::Geometry.Transform = Transform(), kwargs...) where {T<:Real} for source in s.sources OpticSim.Vis.draw!(scene, source; parent_transform=parent_transform*s.transform, kwargs...) end diff --git a/src/Vis/Vis.jl b/src/Vis/Vis.jl index ee0fb3308..f58a6e9eb 100644 --- a/src/Vis/Vis.jl +++ b/src/Vis/Vis.jl @@ -7,7 +7,7 @@ module Vis # If using precompiled system image (which we always are) you have to run AbstractPlotting.__init__() after loading Makie # during precompilation, the display stack gets shuffled around such that the Makie display does not take priority. # See https://discourse.julialang.org/t/makie-doesnt-display-plot-when-using-a-custom-julia-sysimage/38515. -__init__() = AbstractPlotting.__init__() +__init__() = try Makie.AbstractPlotting.__init__() catch e end # for versions of Makie below 0.13 include("Visualization.jl") include("Emitters.jl") diff --git a/src/Vis/Visualization.jl b/src/Vis/Visualization.jl index 50a13f811..0e69e6178 100644 --- a/src/Vis/Visualization.jl +++ b/src/Vis/Visualization.jl @@ -14,8 +14,7 @@ using ColorSchemes using StaticArrays using LinearAlgebra import Makie -import Makie.AbstractPlotting -import Makie.AbstractPlotting.MakieLayout +import GeometryBasics import Plots import Luxor using FileIO @@ -93,101 +92,101 @@ Create a new Makie scene with the given resolution including control buttons. function scene(resolution = (1000, 1000)) @assert resolution[1] > 0 && resolution[2] > 0 - scene, layout = MakieLayout.layoutscene(resolution = resolution) + scene, layout = Makie.layoutscene(resolution = resolution) global current_main_scene = scene - lscene = layout[1, 1] = MakieLayout.LScene(scene, scenekw = (camera = Makie.cam3d_cad!, axis_type = Makie.axis3d!, raw = false)) + lscene = layout[1, 1] = Makie.LScene(scene, scenekw = (camera = Makie.cam3d_cad!, axis_type = Makie.axis3d!, raw = false)) global current_3d_scene = lscene - threedbutton = MakieLayout.Button(scene, label = "3D", buttoncolor = RGB(0.8, 0.8, 0.8), height = 40, width = 80) - twodxbutton = MakieLayout.Button(scene, label = "2D-x", buttoncolor = RGB(0.8, 0.8, 0.8), height = 40, width = 80) - twodybutton = MakieLayout.Button(scene, label = "2D-y", buttoncolor = RGB(0.8, 0.8, 0.8), height = 40, width = 80) - savebutton = MakieLayout.Button(scene, label = "Screenshot", buttoncolor = RGB(0.8, 0.8, 0.8), height = 40, width = 160) + threedbutton = Makie.Button(scene, label = "3D", buttoncolor = RGB(0.8, 0.8, 0.8), height = 40, width = 80) + twodxbutton = Makie.Button(scene, label = "2D-x", buttoncolor = RGB(0.8, 0.8, 0.8), height = 40, width = 80) + twodybutton = Makie.Button(scene, label = "2D-y", buttoncolor = RGB(0.8, 0.8, 0.8), height = 40, width = 80) + savebutton = Makie.Button(scene, label = "Screenshot", buttoncolor = RGB(0.8, 0.8, 0.8), height = 40, width = 160) - MakieLayout.on(threedbutton.clicks) do nclicks + Makie.on(threedbutton.clicks) do nclicks make3d(lscene) yield() end - MakieLayout.on(twodybutton.clicks) do nclicks + Makie.on(twodybutton.clicks) do nclicks make2dy(lscene) yield() end - MakieLayout.on(twodxbutton.clicks) do nclicks + Makie.on(twodxbutton.clicks) do nclicks make2dx(lscene) yield() end - MakieLayout.on(savebutton.clicks) do nclicks + Makie.on(savebutton.clicks) do nclicks Vis.save("screenshot.png") yield() end - layout[2, 1] = MakieLayout.grid!(hcat(threedbutton, twodxbutton, twodybutton, savebutton), tellwidth = false, tellheight = true) + layout[2, 1] = Makie.grid!(hcat(threedbutton, twodxbutton, twodybutton, savebutton), tellwidth = false, tellheight = true) return scene, lscene end -function make3d(scene::MakieLayout.LScene = current_3d_scene) +function make3d(scene::Makie.LScene = current_3d_scene) s = scene.scene # use 3d camera Makie.cam3d_cad!(s) # reset scene rotation - s.transformation.rotation[] = AbstractPlotting.Quaternion(0.0, 0.0, 0.0, 1.0) + s.transformation.rotation[] = Makie.Quaternion(0.0, 0.0, 0.0, 1.0) # show all the axis ticks - s[AbstractPlotting.OldAxis].attributes.showticks[] = (true, true, true) + s[Makie.OldAxis].attributes.showticks[] = (true, true, true) # reset tick and axis label rotation and position - rot = (AbstractPlotting.Quaternion(0.0, 0.0, -0.7071067811865476, -0.7071067811865475), AbstractPlotting.Quaternion(0.0, 0.0, 1.0, 0.0), AbstractPlotting.Quaternion(0.0, 0.7071067811865475, 0.7071067811865476, 0.0)) - s[AbstractPlotting.OldAxis].attributes.ticks.rotation[] = rot - s[AbstractPlotting.OldAxis].attributes.names.rotation[] = rot - s[AbstractPlotting.OldAxis].attributes.ticks.align = ((:left, :center), (:right, :center), (:right, :center)) - s[AbstractPlotting.OldAxis].attributes.names.align = ((:left, :center), (:right, :center), (:right, :center)) + rot = (Makie.Quaternion(0.0, 0.0, -0.7071067811865476, -0.7071067811865475), Makie.Quaternion(0.0, 0.0, 1.0, 0.0), Makie.Quaternion(0.0, 0.7071067811865475, 0.7071067811865476, 0.0)) + s[Makie.OldAxis].attributes.ticks.rotation[] = rot + s[Makie.OldAxis].attributes.names.rotation[] = rot + s[Makie.OldAxis].attributes.ticks.align = ((:left, :center), (:right, :center), (:right, :center)) + s[Makie.OldAxis].attributes.names.align = ((:left, :center), (:right, :center), (:right, :center)) # reset scene limits to automatic - s.limits[] = AbstractPlotting.Automatic() + s.limits[] = Makie.Automatic() Makie.update!(s) end -function make2dy(scene::MakieLayout.LScene = current_3d_scene) +function make2dy(scene::Makie.LScene = current_3d_scene) s = scene.scene # use 2d camera Makie.cam2d!(s) # set rotation to look onto yz plane s.transformation.rotation[] = Makie.qrotation(Makie.Vec3f0(0, 1, 0), 0.5pi) # hide x ticks - s[AbstractPlotting.OldAxis].attributes.showticks[] = (false, true, true) + s[Makie.OldAxis].attributes.showticks[] = (false, true, true) # set tick and axis label rotation and position - s[AbstractPlotting.OldAxis].attributes.ticks.rotation[] = (0.0, 0.0, 0.0) - s[AbstractPlotting.OldAxis].attributes.names.rotation[] = (0.0, 0.0, 0.0) - s[AbstractPlotting.OldAxis].attributes.ticks.align = ((:right, :center), (:right, :center), (:center, :right)) - s[AbstractPlotting.OldAxis].attributes.names.align = ((:left, :center), (:left, :center), (:center, :left)) + s[Makie.OldAxis].attributes.ticks.rotation[] = (0.0, 0.0, 0.0) + s[Makie.OldAxis].attributes.names.rotation[] = (0.0, 0.0, 0.0) + s[Makie.OldAxis].attributes.ticks.align = ((:right, :center), (:right, :center), (:center, :right)) + s[Makie.OldAxis].attributes.names.align = ((:left, :center), (:left, :center), (:center, :left)) # update the scene limits automatically to get true reference values - s.limits[] = AbstractPlotting.Automatic() + s.limits[] = Makie.Automatic() Makie.update_limits!(s) # manually set the scene limits to draw the axes correctly - o, w = AbstractPlotting.origin(s.data_limits[]), AbstractPlotting.widths(s.data_limits[]) + o, w = Makie.origin(s.data_limits[]), Makie.widths(s.data_limits[]) s.limits[] = Makie.FRect3D((1000.0f0, o[2], o[3]), (w[2], w[2], w[3])) # set the eye (i.e. light) position to behind the camera s.camera.eyeposition[] = (0, 0, -100) Makie.update!(s) end -function make2dx(scene::MakieLayout.LScene = current_3d_scene) +function make2dx(scene::Makie.LScene = current_3d_scene) s = scene.scene # use 2d camera Makie.cam2d!(s) # set rotation to look onto yz plane - s.transformation.rotation[] = AbstractPlotting.Quaternion(0.5, 0.5, 0.5, 0.5) + s.transformation.rotation[] = Makie.Quaternion(0.5, 0.5, 0.5, 0.5) # hide y ticks - s[AbstractPlotting.OldAxis].attributes.showticks[] = (true, false, true) + s[Makie.OldAxis].attributes.showticks[] = (true, false, true) # set tick and axis label rotation and position - s[AbstractPlotting.OldAxis].attributes.ticks.rotation[] = (0.0, 0.0, 0.0) - s[AbstractPlotting.OldAxis].attributes.names.rotation[] = (0.0, 0.0, 0.0) - s[AbstractPlotting.OldAxis].attributes.ticks.align = ((:right, :center), (:right, :center), (:center, :center)) - s[AbstractPlotting.OldAxis].attributes.names.align = ((:left, :center), (:right, :center), (:center, :center)) + s[Makie.OldAxis].attributes.ticks.rotation[] = (0.0, 0.0, 0.0) + s[Makie.OldAxis].attributes.names.rotation[] = (0.0, 0.0, 0.0) + s[Makie.OldAxis].attributes.ticks.align = ((:right, :center), (:right, :center), (:center, :center)) + s[Makie.OldAxis].attributes.names.align = ((:left, :center), (:right, :center), (:center, :center)) # update the scene limits automatically to get true reference values - s.limits[] = AbstractPlotting.Automatic() + s.limits[] = Makie.Automatic() Makie.update_limits!(s) # manually set the scene limits to draw the axes correctly - o, w = AbstractPlotting.origin(s.data_limits[]), AbstractPlotting.widths(s.data_limits[]) + o, w = Makie.origin(s.data_limits[]), Makie.widths(s.data_limits[]) s.limits[] = Makie.FRect3D((o[1], -1000.0f0, o[3]), (w[1], w[1], w[3])) # set the eye (i.e. light) position to behind the camera s.camera.eyeposition[] = (0, 0, -100) @@ -231,9 +230,9 @@ Save the current Makie scene to an image file. function save(path::String) # save closes the window so just display it again as a work-around # for some reason the size isn't maintained automatically so we just reset it manually - size = AbstractPlotting.size(current_main_scene) + size = Makie.size(current_main_scene) Makie.save(path, current_3d_scene.scene) - AbstractPlotting.resize!(current_main_scene, size) + Makie.resize!(current_main_scene, size) display(current_main_scene) end function save(::Nothing) end @@ -283,18 +282,18 @@ indexedcolor2(i::Int) = ColorSchemes.hsv[1.0 - rem(i / (2.1 * π), 1.0)] .* 0.5 ## displaying imported meshes -Base.:*(a::Transform, p::Makie.AbstractPlotting.GeometryBasics.PointMeta) = a * p.main -Base.:*(a::Real, p::Makie.AbstractPlotting.GeometryBasics.PointMeta{N,S}) where {S<:Real,N} = Makie.AbstractPlotting.GeometryBasics.Point{N,S}((a * SVector{N,S}(p))...) -Base.:*(a::Transform, p::Makie.AbstractPlotting.GeometryBasics.Point{N,S}) where {S<:Real,N} = Makie.AbstractPlotting.GeometryBasics.Point{N,S}((a.rotation * SVector{N,S}(p) + a.translation)...) +Base.:*(a::Transform, p::GeometryBasics.PointMeta) = a * p.main +Base.:*(a::Real, p::GeometryBasics.PointMeta{N,S}) where {S<:Real,N} = GeometryBasics.Point{N,S}((a * SVector{N,S}(p))...) +Base.:*(a::Transform, p::GeometryBasics.Point{N,S}) where {S<:Real,N} = GeometryBasics.Point{N,S}((a.rotation * SVector{N,S}(p) + a.translation)...) -function draw!(scene::MakieLayout.LScene, ob::AbstractString; color = :gray, linewidth = 3, shaded::Bool = true, wireframe::Bool = false, transform::Transform{Float64} = identitytransform(Float64), scale::Float64 = 1.0, kwargs...) +function draw!(scene::Makie.LScene, ob::AbstractString; color = :gray, linewidth = 3, shaded::Bool = true, wireframe::Bool = false, transform::Transform{Float64} = identitytransform(Float64), scale::Float64 = 1.0, kwargs...) if any(endswith(lowercase(ob), x) for x in [".obj", "ply", ".2dm", ".off", ".stl"]) meshdata = FileIO.load(ob) if transform != identitytransform(Float64) || scale != 1.0 - coords = [transform * (scale * p) for p in Makie.AbstractPlotting.GeometryBasics.coordinates(meshdata)] - meshdata = Makie.AbstractPlotting.GeometryBasics.Mesh(coords, Makie.AbstractPlotting.GeometryBasics.faces(meshdata)) + coords = [transform * (scale * p) for p in GeometryBasics.coordinates(meshdata)] + meshdata = GeometryBasics.Mesh(coords, GeometryBasics.faces(meshdata)) end - Makie.mesh!(Makie.AbstractPlotting.GeometryBasics.normal_mesh(meshdata); kwargs..., color = color, shading = shaded, visible = shaded) + Makie.mesh!(GeometryBasics.normal_mesh(meshdata); kwargs..., color = color, shading = shaded, visible = shaded) if wireframe if shaded Makie.wireframe!(scene[end][1], color = (:black, 0.1), linewidth = linewidth) @@ -310,14 +309,14 @@ end ## GEOMETRY """ - draw!(scene::MakieLayout.LScene, surf::Surface{T}; numdivisions = 20, normals = false, normalcolor = :blue, kwargs...) + draw!(scene::Makie.LScene, surf::Surface{T}; numdivisions = 20, normals = false, normalcolor = :blue, kwargs...) Transforms `surf` into a mesh using [`makemesh`](@ref) and draws the result. `normals` of the surface can be drawn at evenly sampled points with provided `normalcolor`. `numdivisions` determines the resolution with which the mesh is triangulated. `kwargs` is passed on to the [`TriangleMesh`](@ref) drawing function. """ -function draw!(scene::MakieLayout.LScene, surf::Surface{T}; numdivisions::Int = 30, normals::Bool = false, normalcolor = :blue, kwargs...) where {T<:Real} +function draw!(scene::Makie.LScene, surf::Surface{T}; numdivisions::Int = 30, normals::Bool = false, normalcolor = :blue, kwargs...) where {T<:Real} mesh = makemesh(surf, numdivisions) if nothing === mesh return @@ -331,11 +330,11 @@ function draw!(scene::MakieLayout.LScene, surf::Surface{T}; numdivisions::Int = end """ - draw!(scene::MakieLayout.LScene, tmesh::TriangleMesh{T}; linewidth = 3, shaded = true, wireframe = false, color = :orange, normals = false, normalcolor = :blue, transparency = false, kwargs...) + draw!(scene::Makie.LScene, tmesh::TriangleMesh{T}; linewidth = 3, shaded = true, wireframe = false, color = :orange, normals = false, normalcolor = :blue, transparency = false, kwargs...) Draw a [`TriangleMesh`](@ref), optionially with a visible `wireframe`. `kwargs` are passed on to [`Makie.mesh`](http://makie.juliaplots.org/stable/plotting_functions.html#mesh). """ -function draw!(scene::MakieLayout.LScene, tmesh::TriangleMesh{T}; linewidth = 3, shaded::Bool = true, wireframe::Bool = false, color = :orange, normals::Bool = false, normalcolor = :blue, transparency::Bool = false, kwargs...) where {T<:Real} +function draw!(scene::Makie.LScene, tmesh::TriangleMesh{T}; linewidth = 3, shaded::Bool = true, wireframe::Bool = false, color = :orange, normals::Bool = false, normalcolor = :blue, transparency::Bool = false, kwargs...) where {T<:Real} points, indices = makiemesh(tmesh) if length(points) > 0 && length(indices) > 0 Makie.mesh!(scene, points, indices; kwargs..., color = color, shading = shaded, transparency = transparency, visible = shaded) @@ -359,12 +358,12 @@ function draw!(scene::MakieLayout.LScene, tmesh::TriangleMesh{T}; linewidth = 3, end """ - draw!(scene::MakieLayout.LScene, meshes::Vararg{S}; colors::Bool = false, kwargs...) where {T<:Real,S<:Union{TriangleMesh{T},Surface{T}}} + draw!(scene::Makie.LScene, meshes::Vararg{S}; colors::Bool = false, kwargs...) where {T<:Real,S<:Union{TriangleMesh{T},Surface{T}}} Draw a series of [`TriangleMesh`](@ref) or [`Surface`](@ref) objects, if `colors` is true then each mesh will be colored automatically with a diverse series of colors. `kwargs` are is passed on to the drawing function for each element. """ -function draw!(scene::MakieLayout.LScene, meshes::Vararg{S}; colors::Bool = false, kwargs...) where {T<:Real,S<:Union{TriangleMesh{T},Surface{T}}} +function draw!(scene::Makie.LScene, meshes::Vararg{S}; colors::Bool = false, kwargs...) where {T<:Real,S<:Union{TriangleMesh{T},Surface{T}}} for i in 1:length(meshes) if colors col = indexedcolor2(i) @@ -382,19 +381,19 @@ function draw(meshes::Vararg{S}; kwargs...) where {T<:Real,S<:Union{TriangleMesh end """ - draw!(scene::MakieLayout.LScene, csg::Union{CSGTree,CSGGenerator}; numdivisions::Int = 20, kwargs...) + draw!(scene::Makie.LScene, csg::Union{CSGTree,CSGGenerator}; numdivisions::Int = 20, kwargs...) Convert a CSG object ([`CSGTree`](@ref) or [`CSGGenerator`](@ref)) to a mesh using [`makemesh`](@ref) with resolution set by `numdivisions` and draw the resulting [`TriangleMesh`](@ref). """ -draw!(scene::MakieLayout.LScene, csg::CSGTree{T}; numdivisions::Int = 30, kwargs...) where {T<:Real} = draw!(scene, makemesh(csg, numdivisions); kwargs...) -draw!(scene::MakieLayout.LScene, csg::CSGGenerator{T}; kwargs...) where {T<:Real} = draw!(scene, csg(); kwargs...) +draw!(scene::Makie.LScene, csg::CSGTree{T}; numdivisions::Int = 30, kwargs...) where {T<:Real} = draw!(scene, makemesh(csg, numdivisions); kwargs...) +draw!(scene::Makie.LScene, csg::CSGGenerator{T}; kwargs...) where {T<:Real} = draw!(scene, csg(); kwargs...) """ - draw!(scene::MakieLayout.LScene, bbox::BoundingBox{T}; kwargs...) + draw!(scene::Makie.LScene, bbox::BoundingBox{T}; kwargs...) Draw a [`BoundingBox`](@ref) as a wireframe, ie series of lines. """ -function draw!(scene::MakieLayout.LScene, bbox::BoundingBox{T}; kwargs...) where {T<:Real} +function draw!(scene::Makie.LScene, bbox::BoundingBox{T}; kwargs...) where {T<:Real} p1 = SVector{3,T}(bbox.xmin, bbox.ymin, bbox.zmin) p2 = SVector{3,T}(bbox.xmin, bbox.ymax, bbox.zmin) p3 = SVector{3,T}(bbox.xmin, bbox.ymax, bbox.zmax) @@ -409,27 +408,27 @@ end ## OPTICS """ - draw!(scene::MakieLayout.LScene, ass::LensAssembly; kwargs...) + draw!(scene::Makie.LScene, ass::LensAssembly; kwargs...) Draw each element in a [`LensAssembly`](@ref), with each element automatically colored differently. """ -function draw!(scene::MakieLayout.LScene, ass::LensAssembly{T}; kwargs...) where {T<:Real} +function draw!(scene::Makie.LScene, ass::LensAssembly{T}; kwargs...) where {T<:Real} for (i, e) in enumerate(elements(ass)) draw!(scene, e; kwargs..., color = indexedcolor2(i)) end end """ - draw!(scene::MakieLayout.LScene, sys::AbstractOpticalSystem; kwargs...) + draw!(scene::Makie.LScene, sys::AbstractOpticalSystem; kwargs...) Draw each element in the lens assembly of an [`AbstractOpticalSystem`](@ref), with each element automatically colored differently, as well as the detector of the system. """ -function draw!(scene::MakieLayout.LScene, sys::CSGOpticalSystem{T}; kwargs...) where {T<:Real} +function draw!(scene::Makie.LScene, sys::CSGOpticalSystem{T}; kwargs...) where {T<:Real} draw!(scene, sys.assembly; kwargs...) draw!(scene, sys.detector; kwargs...) end -draw!(scene::MakieLayout.LScene, sys::AxisymmetricOpticalSystem{T}; kwargs...) where {T<:Real} = draw!(scene, sys.system; kwargs...) +draw!(scene::Makie.LScene, sys::AxisymmetricOpticalSystem{T}; kwargs...) where {T<:Real} = draw!(scene, sys.system; kwargs...) onlydetectorrays(system::Q, tracevalue::LensTrace{T,3}) where {T<:Real,Q<:AbstractOpticalSystem{T}} = onsurface(detector(system), point(tracevalue)) @@ -457,7 +456,7 @@ end drawtracerays!(system::Q; kwargs...) where {T<:Real,Q<:AbstractOpticalSystem{T}} = drawtracerays!(current_3d_scene, system; kwargs...) -function drawtracerays!(scene::MakieLayout.LScene, system::Q; raygenerator::S = Source(transform = translation(0.0,0.0,10.0), origins = Origins.RectGrid(10.0,10.0,25,25),directions = Constant(0.0,0.0,-1.0)), test::Bool = false, trackallrays::Bool = false, colorbysourcenum::Bool = false, colorbynhits::Bool = false, rayfilter::Union{Nothing,Function} = onlydetectorrays, verbose::Bool = false, drawsys::Bool = false, drawgen::Bool = false, kwargs...) where {T<:Real,Q<:AbstractOpticalSystem{T},S<:AbstractRayGenerator{T}} +function drawtracerays!(scene::Makie.LScene, system::Q; raygenerator::S = Source(transform = translation(0.0,0.0,10.0), origins = Origins.RectGrid(10.0,10.0,25,25),directions = Constant(0.0,0.0,-1.0)), test::Bool = false, trackallrays::Bool = false, colorbysourcenum::Bool = false, colorbynhits::Bool = false, rayfilter::Union{Nothing,Function} = onlydetectorrays, verbose::Bool = false, drawsys::Bool = false, drawgen::Bool = false, kwargs...) where {T<:Real,Q<:AbstractOpticalSystem{T},S<:AbstractRayGenerator{T}} raylines = Vector{LensTrace{T,3}}(undef, 0) drawgen && draw!(scene, raygenerator, norays = true; kwargs...) @@ -520,34 +519,34 @@ end ## RAYS, LINES AND POINTS """ - draw!(scene::MakieLayout.LScene, rays::AbstractVector{<:AbstractRay{T,N}}; kwargs...) + draw!(scene::Makie.LScene, rays::AbstractVector{<:AbstractRay{T,N}}; kwargs...) Draw a vector of [`Ray`](@ref) or [`OpticalRay`](@ref) objects. """ -function draw!(scene::MakieLayout.LScene, rays::AbstractVector{<:AbstractRay{T,N}}; kwargs...) where {T<:Real,N} +function draw!(scene::Makie.LScene, rays::AbstractVector{<:AbstractRay{T,N}}; kwargs...) where {T<:Real,N} for r in rays draw!(scene, r; kwargs...) end end """ - draw!(scene::MakieLayout.LScene, traces::AbstractVector{LensTrace{T,N}}; kwargs...) + draw!(scene::Makie.LScene, traces::AbstractVector{LensTrace{T,N}}; kwargs...) Draw a vector of [`LensTrace`](@ref) objects. """ -function draw!(scene::MakieLayout.LScene, traces::AbstractVector{LensTrace{T,N}}; kwargs...) where {T<:Real,N} +function draw!(scene::Makie.LScene, traces::AbstractVector{LensTrace{T,N}}; kwargs...) where {T<:Real,N} for t in traces draw!(scene, t; kwargs...) end end """ - draw!(scene::MakieLayout.LScene, trace::LensTrace{T,N}; colorbysourcenum::Bool = false, colorbynhits::Bool = false, kwargs...) + draw!(scene::Makie.LScene, trace::LensTrace{T,N}; colorbysourcenum::Bool = false, colorbynhits::Bool = false, kwargs...) Draw a [`LensTrace`](@ref) as a line which can be colored automatically by its `sourcenum` or `nhits` attributes. The alpha is determined by the `power` attribute of `trace`. """ -function draw!(scene::MakieLayout.LScene, trace::LensTrace{T,N}; colorbysourcenum::Bool = false, colorbynhits::Bool = false, kwargs...) where {T<:Real,N} +function draw!(scene::Makie.LScene, trace::LensTrace{T,N}; colorbysourcenum::Bool = false, colorbynhits::Bool = false, kwargs...) where {T<:Real,N} if colorbysourcenum color = indexedcolor(sourcenum(trace)) elseif colorbynhits @@ -559,13 +558,13 @@ function draw!(scene::MakieLayout.LScene, trace::LensTrace{T,N}; colorbysourcenu end """ - draw!(scene::MakieLayout.LScene, ray::OpticalRay{T,N}; colorbysourcenum::Bool = false, colorbynhits::Bool = false, kwargs...) + draw!(scene::Makie.LScene, ray::OpticalRay{T,N}; colorbysourcenum::Bool = false, colorbynhits::Bool = false, kwargs...) Draw an [`OpticalRay`](@ref) which can be colored automatically by its `sourcenum` or `nhits` attributes. The alpha of the ray is determined by the `power` attribute of `ray`. `kwargs` are passed to `draw!(scene, ray::Ray)`. """ -function draw!(scene::MakieLayout.LScene, r::OpticalRay{T,N}; colorbysourcenum::Bool = false, colorbynhits::Bool = false, kwargs...) where {T<:Real,N} +function draw!(scene::Makie.LScene, r::OpticalRay{T,N}; colorbysourcenum::Bool = false, colorbynhits::Bool = false, kwargs...) where {T<:Real,N} if colorbysourcenum color = indexedcolor(sourcenum(r)) elseif colorbynhits @@ -577,41 +576,41 @@ function draw!(scene::MakieLayout.LScene, r::OpticalRay{T,N}; colorbysourcenum:: end """ - draw!(scene::MakieLayout.LScene, ray::Ray{T,N}; color = :yellow, rayscale = 1.0, kwargs...) + draw!(scene::Makie.LScene, ray::Ray{T,N}; color = :yellow, rayscale = 1.0, kwargs...) Draw a [`Ray`](@ref) in a given `color` optionally scaling the size using `rayscale`. `kwargs` are passed to [`Makie.arrows`](http://makie.juliaplots.org/stable/plotting_functions.html#arrows). """ -function draw!(scene::MakieLayout.LScene, ray::AbstractRay{T,N}; color = :yellow, rayscale = 1.0, kwargs...) where {T<:Real,N} +function draw!(scene::Makie.LScene, ray::AbstractRay{T,N}; color = :yellow, rayscale = 1.0, kwargs...) where {T<:Real,N} Makie.arrows!(scene, [Makie.Point3f0(origin(ray))], [Makie.Point3f0(rayscale * direction(ray))]; kwargs..., arrowsize = min(0.05, rayscale * 0.05), arrowcolor = color, linecolor = color, linewidth = 2) end """ - draw!(scene::MakieLayout.LScene, du::DisjointUnion{T}; kwargs...) + draw!(scene::Makie.LScene, du::DisjointUnion{T}; kwargs...) Draw each [`Interval`](@ref) in a [`DisjointUnion`](@ref). """ -function draw!(scene::MakieLayout.LScene, du::DisjointUnion{T}; kwargs...) where {T<:Real} +function draw!(scene::Makie.LScene, du::DisjointUnion{T}; kwargs...) where {T<:Real} draw!(scene, intervals(du); kwargs...) end """ - draw!(scene::MakieLayout.LScene, intervals::AbstractVector{Interval{T}}; kwargs...) + draw!(scene::Makie.LScene, intervals::AbstractVector{Interval{T}}; kwargs...) Draw a vector of [`Interval`](@ref)s. """ -function draw!(scene::MakieLayout.LScene, intervals::AbstractVector{Interval{T}}; kwargs...) where {T<:Real} +function draw!(scene::Makie.LScene, intervals::AbstractVector{Interval{T}}; kwargs...) where {T<:Real} for i in intervals draw!(scene, i; kwargs...) end end """ - draw!(scene::MakieLayout.LScene, interval::Interval{T}; kwargs...) + draw!(scene::Makie.LScene, interval::Interval{T}; kwargs...) Draw an [`Interval`](@ref) as a line with circles at each [`Intersection`](@ref) point. """ -function draw!(scene::MakieLayout.LScene, interval::Interval{T}; kwargs...) where {T<:Real} +function draw!(scene::Makie.LScene, interval::Interval{T}; kwargs...) where {T<:Real} if !(interval isa EmptyInterval) l = lower(interval) u = upper(interval) @@ -632,11 +631,11 @@ function draw!(scene::MakieLayout.LScene, interval::Interval{T}; kwargs...) wher end """ - draw!(scene::MakieLayout.LScene, intersection::Intersection; normal::Bool = false, kwargs...) + draw!(scene::Makie.LScene, intersection::Intersection; normal::Bool = false, kwargs...) Draw an [`Intersection`](@ref) as a circle, optionally showing the surface normal at the point. """ -function draw!(scene::MakieLayout.LScene, intersection::Intersection; normal::Bool = false, kwargs...) +function draw!(scene::Makie.LScene, intersection::Intersection; normal::Bool = false, kwargs...) draw!(scene, point(intersection); kwargs...) if normal draw!(scene, Ray(point(intersection), normal(intersection)); kwargs...) @@ -644,41 +643,41 @@ function draw!(scene::MakieLayout.LScene, intersection::Intersection; normal::Bo end """ - draw!(scene::MakieLayout.LScene, lines::AbstractVector{Tuple{AbstractVector{T},AbstractVector{T}}}; kwargs...) + draw!(scene::Makie.LScene, lines::AbstractVector{Tuple{AbstractVector{T},AbstractVector{T}}}; kwargs...) Draw a vector of lines. """ -function draw!(scene::MakieLayout.LScene, lines::AbstractVector{Tuple{P,P}}; kwargs...) where {T<:Real,P<:AbstractVector{T}} +function draw!(scene::Makie.LScene, lines::AbstractVector{Tuple{P,P}}; kwargs...) where {T<:Real,P<:AbstractVector{T}} for l in lines draw!(scene, l; kwargs...) end end """ - draw!(scene::MakieLayout.LScene, line::Tuple{AbstractVector{T},AbstractVector{T}}; color = :yellow, kwargs...) + draw!(scene::Makie.LScene, line::Tuple{AbstractVector{T},AbstractVector{T}}; color = :yellow, kwargs...) Draw a line between two points, `kwargs` are passed to [`Makie.linesegments`](http://makie.juliaplots.org/stable/plotting_functions.html#linesegments). """ -function draw!(scene::MakieLayout.LScene, line::Tuple{P,P}; color = :yellow, kwargs...) where {T<:Real,P<:AbstractVector{T}} +function draw!(scene::Makie.LScene, line::Tuple{P,P}; color = :yellow, kwargs...) where {T<:Real,P<:AbstractVector{T}} Makie.linesegments!(scene, [line[1], line[2]]; kwargs..., color = color) end """ - draw!(s::MakieLayout.LScene, point::AbstractVector{T}; kwargs...) + draw!(s::Makie.LScene, point::AbstractVector{T}; kwargs...) Draw a single point, `kwargs` are passed to `draw!(scene, points::AbstractVector{AbstractVector{T}})`. """ -function draw!(s::MakieLayout.LScene, point::AbstractVector{T}; kwargs...) where {T<:Real} +function draw!(s::Makie.LScene, point::AbstractVector{T}; kwargs...) where {T<:Real} draw!(s, [point]; kwargs...) end """ - draw!(scene::MakieLayout.LScene, points::AbstractVector{AbstractVector{T}}; markersize = 20, color = :black, kwargs...) + draw!(scene::Makie.LScene, points::AbstractVector{AbstractVector{T}}; markersize = 20, color = :black, kwargs...) Draw a vector of points. `kwargs` are passed to [`Makie.scatter`](http://makie.juliaplots.org/stable/plotting_functions.html#scatter). """ -function draw!(scene::MakieLayout.LScene, points::AbstractVector{P}; markersize = 20, color = :black, kwargs...) where {T<:Real,P<:AbstractVector{T}} +function draw!(scene::Makie.LScene, points::AbstractVector{P}; markersize = 20, color = :black, kwargs...) where {T<:Real,P<:AbstractVector{T}} Makie.scatter!(scene, points, markersize = markersize, color = color, strokewidth = 0; kwargs...) end diff --git a/test/testsets/JuliaLang.jl b/test/testsets/JuliaLang.jl index 6b2c2d7f5..75f8b4c79 100644 --- a/test/testsets/JuliaLang.jl +++ b/test/testsets/JuliaLang.jl @@ -28,7 +28,7 @@ and pop it from the set OpticSim.Vis => [ (OpticSim.Vis.drawcurves, Tuple{Vararg{Spline{P,S,N,M},N1} where N1} where {M} where {N} where {S} where {P}), (OpticSim.Vis.draw, Tuple{Vararg{S,N} where N} where {S<:Union{OpticSim.Surface{T},OpticSim.TriangleMesh{T}}} where {T<:Real}), - (OpticSim.Vis.draw!, Tuple{OpticSim.Vis.MakieLayout.LScene,Vararg{S,N} where N} where {S<:Union{OpticSim.Surface{T},OpticSim.TriangleMesh{T}}} where {T<:Real}) + (OpticSim.Vis.draw!, Tuple{OpticSim.Vis.Makie.LScene,Vararg{S,N} where N} where {S<:Union{OpticSim.Surface{T},OpticSim.TriangleMesh{T}}} where {T<:Real}) ], OpticSim.Examples => [], OpticSim.Chebyshev => [],