diff --git a/src/GlassCat/generate.jl b/src/GlassCat/generate.jl index 3c14ea807..d511db739 100644 --- a/src/GlassCat/generate.jl +++ b/src/GlassCat/generate.jl @@ -6,7 +6,7 @@ using DelimitedFiles: readdlm # used in agffile_to_catalog using StringEncodings using StaticArrays using Unitful -import Unitful: Length, Temperature, Quantity, Units +import Unitful: Length, Temperature """ generate_jls(sourcenames::Vector{<:AbstractString}, mainfile::AbstractString, jldir::AbstractString, agfdir::AbstractString; test::Bool = false) diff --git a/src/Optical/Emitters/Spectrum.jl b/src/Optical/Emitters/Spectrum.jl index 438e5b08c..06de7706b 100644 --- a/src/Optical/Emitters/Spectrum.jl +++ b/src/Optical/Emitters/Spectrum.jl @@ -88,7 +88,6 @@ struct Measured{T} <: AbstractSpectrum{T} power::Vector{T} where {T<:Real} = samples[!, :Power] # no missing values allowed and must be real numbers maxpower = maximum(power) - T = eltype(power) p = sortperm(wavelengths) wavelengths = wavelengths[p] power = power[p] ./ maxpower #make sure power values have the same sorted permutation as wavelengths normalized with maximum power equal to 1 diff --git a/src/Vis/Emitters.jl b/src/Vis/Emitters.jl index dc11bda32..db0e201d7 100644 --- a/src/Vis/Emitters.jl +++ b/src/Vis/Emitters.jl @@ -42,18 +42,18 @@ function maybe_draw_debug_info(scene::Makie.LScene, o::Origins.AbstractOriginDis arrow_size = ARRROW_SIZE * visual_size(o) arrow_start = pos arrow_end = dir * ARRROW_LENGTH * visual_size(o) - Makie.arrows!(scene.scene, [Makie.Point3f0(arrow_start)], [Makie.Point3f0(arrow_end)], arrowsize=arrow_size, linewidth=arrow_size * 0.5, linecolor=:blue, arrowcolor=:blue) + Makie.arrows!(scene.scene, [Makie.Point3f(arrow_start)], [Makie.Point3f(arrow_end)], arrowsize=arrow_size, linewidth=arrow_size * 0.5, linecolor=:blue, arrowcolor=:blue) arrow_end = uv * 0.5 * ARRROW_LENGTH * visual_size(o) - Makie.arrows!(scene.scene, [Makie.Point3f0(arrow_start)], [Makie.Point3f0(arrow_end)], arrowsize= 0.5 * arrow_size, linewidth=arrow_size * 0.5, linecolor=:red, arrowcolor=:red) + Makie.arrows!(scene.scene, [Makie.Point3f(arrow_start)], [Makie.Point3f(arrow_end)], arrowsize= 0.5 * arrow_size, linewidth=arrow_size * 0.5, linecolor=:red, arrowcolor=:red) arrow_end = vv * 0.5 * ARRROW_LENGTH * visual_size(o) - Makie.arrows!(scene.scene, [Makie.Point3f0(arrow_start)], [Makie.Point3f0(arrow_end)], arrowsize= 0.5 * arrow_size, linewidth=arrow_size * 0.5, linecolor=:green, arrowcolor=:green) + Makie.arrows!(scene.scene, [Makie.Point3f(arrow_start)], [Makie.Point3f(arrow_end)], arrowsize= 0.5 * arrow_size, linewidth=arrow_size * 0.5, linecolor=:green, arrowcolor=:green) # draw all the samples origins positions = map(x -> transform*x, collect(o)) - positions = collect(Makie.Point3f0, positions) + positions = collect(Makie.Point3f, positions) Makie.scatter!(scene, positions, color=:green, markersize = MARKER_SIZE * visual_size(o)) - # positions = collect(Makie.Point3f0, o) + # positions = collect(Makie.Point3f, o) # Makie.scatter!(scene, positions, color=:green, markersize = MARKER_SIZE * visual_size(o)) end @@ -121,7 +121,7 @@ function OpticSim.Vis.draw!(scene::Makie.LScene, s::Sources.Source{T}; parent_tr m[:, 4:6] .*= m[:, 7] * ARRROW_LENGTH * visual_size(s.origins) - # 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) + # Makie.arrows!(scene, [Makie.Point3f(origin(ray))], [Makie.Point3f(rayscale * direction(ray))]; kwargs..., arrowsize = min(0.05, rayscale * 0.05), arrowcolor = color, linecolor = color, linewidth = 2) color = :yellow arrow_size = ARRROW_SIZE * visual_size(s.origins) Makie.arrows!(scene, m[:,1], m[:,2], m[:,3], m[:,4], m[:,5], m[:,6]; kwargs..., arrowcolor=color, linecolor=color, arrowsize=arrow_size, linewidth=arrow_size*0.5) diff --git a/src/Vis/Visualization.jl b/src/Vis/Visualization.jl index d601f91dc..dd4ae0278 100644 --- a/src/Vis/Visualization.jl +++ b/src/Vis/Visualization.jl @@ -153,8 +153,8 @@ function make2dy(scene::Makie.LScene = current_3d_scene) # use 2d camera Makie.cam2d!(s) - scene_transform = Makie.qrotation(Makie.Vec3f0(0, 1, 0), 0.5pi) - scene_transform_inv = Makie.qrotation(Makie.Vec3f0(0, 1, 0), -0.5pi) # to use with the ticks and names + scene_transform = Makie.qrotation(Makie.Vec3f(0, 1, 0), 0.5pi) + scene_transform_inv = Makie.qrotation(Makie.Vec3f(0, 1, 0), -0.5pi) # to use with the ticks and names # set rotation to look onto yz plane s.transformation.rotation[] = scene_transform @@ -186,8 +186,8 @@ function make2dx(scene::Makie.LScene = current_3d_scene) # use 2d camera Makie.cam2d!(s) - scene_transform= Makie.qrotation(Makie.Vec3f0(0, 0, 1), 0.5pi) * Makie.qrotation(Makie.Vec3f0(1, 0, 0), 0.5pi) - scene_transform_inv=Makie.qrotation(Makie.Vec3f0(1, 0, 0), -0.5pi) * Makie.qrotation(Makie.Vec3f0(0, 0, 1), -0.5pi) + scene_transform= Makie.qrotation(Makie.Vec3f(0, 0, 1), 0.5pi) * Makie.qrotation(Makie.Vec3f(1, 0, 0), 0.5pi) + scene_transform_inv=Makie.qrotation(Makie.Vec3f(1, 0, 0), -0.5pi) * Makie.qrotation(Makie.Vec3f(0, 0, 1), -0.5pi) # set rotation to look onto yz plane s.transformation.rotation[] = scene_transform @@ -353,8 +353,8 @@ function draw!(scene::Makie.LScene, surf::Surface{T}; numdivisions::Int = 30, no end draw!(scene, mesh; kwargs..., normals = false) if normals - ndirs = Makie.Point3f0.(samplesurface(surf, normal, numdivisions ÷ 10)) - norigins = Makie.Point3f0.(samplesurface(surf, point, numdivisions ÷ 10)) + ndirs = Makie.Point3f.(samplesurface(surf, normal, numdivisions ÷ 10)) + norigins = Makie.Point3f.(samplesurface(surf, point, numdivisions ÷ 10)) Makie.arrows!(scene, norigins, ndirs, arrowsize = 0.2, arrowcolor = normalcolor, linecolor = normalcolor, linewidth = 2) end end @@ -379,8 +379,8 @@ function draw!(scene::Makie.LScene, tmesh::TriangleMesh{T}; linewidth = 3, shade end if normals @warn "Normals being drawn from triangulated mesh, precision may be low" - norigins = [Makie.Point3f0(centroid(t)) for t in tmesh.triangles[1:10:end]] - ndirs = [Makie.Point3f0(normal(t)) for t in tmesh.triangles[1:10:end]] + norigins = [Makie.Point3f(centroid(t)) for t in tmesh.triangles[1:10:end]] + ndirs = [Makie.Point3f(normal(t)) for t in tmesh.triangles[1:10:end]] if length(norigins) > 0 Makie.arrows!(scene, norigins, ndirs, arrowsize = 0.2, arrowcolor = normalcolor, linecolor = normalcolor, linewidth = 2) end @@ -619,7 +619,7 @@ Draw a [`Ray`](@ref) in a given `color` optionally scaling the size using `raysc """ function draw!(scene::Makie.LScene, ray::AbstractRay{T,N}; color = :yellow, rayscale = 1.0, kwargs...) where {T<:Real,N} arrow_size = min(0.05, rayscale * 0.05) - Makie.arrows!(scene, [Makie.Point3f0(origin(ray))], [Makie.Point3f0(rayscale * direction(ray))]; kwargs..., arrowsize = arrow_size, arrowcolor = color, linecolor = color, linewidth=arrow_size * 0.5) + Makie.arrows!(scene, [Makie.Point3f(origin(ray))], [Makie.Point3f(rayscale * direction(ray))]; kwargs..., arrowsize = arrow_size, arrowcolor = color, linecolor = color, linewidth=arrow_size * 0.5) end """