Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug "Normals of a Cat" #3993

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 26 additions & 4 deletions ReferenceTests/src/tests/examples3d.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

#=
@reference_test "Image on Geometry (Moon)" begin
moon = loadasset("moon.png")
fig, ax, meshplot = mesh(Sphere(Point3f(0), 1f0), color=moon, shading=NoShading, axis = (;show_axis=false))
Expand Down Expand Up @@ -421,17 +421,38 @@ end
surf[3] = surf_func(i)
end
end
=#

@reference_test "Normals of a Cat" begin
x = loadasset("cat.obj")
mesh(x, color=:black)
f, a, p = mesh(x, color=:black)
pos = map(decompose(Point3f, x), GeometryBasics.normals(x)) do p, n
p => p .+ Point(normalize(n) .* 0.05f0)
end
linesegments!(pos, color=:blue)
current_figure()
l = linesegments!(pos, color=:blue)
bb = boundingbox(a.scene, p -> Makie.isaxis(p))
if bb !== HyperRectangle{3, Float64}([-0.2163253277540207, -0.052062273025512695, -0.4081778824329376], [0.4326506555080414, 1.016284465789795, 1.4193272590637207])
@info "Bbox maybe wrong"
@info "Full bb = $bb"
@info "No exclude = $(boundingbox(a.scene))"
@info "plots in scene:"
println.(a.scene.plots)
@info "isaxis? $(Makie.isaxis.(a.scene.plots))"
@info "space $(map(p -> get(p.attributes, :space, :unset), a.scene.plots))"
@info "Individual bboxes:"
println.(boundingbox.(a.scene.plots))
@info "Individual data_limits:"
println.(data_limits.(a.scene.plots))
@info "Scene transformation: $(a.scene.transformation)"
@info "Linesegments transformation: $(l.transformation)"
@info "Linesegments model: $(l.model)"
@info "Linesegments data: $(l[1][])"
@info "Recompute full: $(boundingbox(a.scene, p -> Makie.isaxis(p)))"
end
f
end

#=
@reference_test "Sphere Mesh" begin
mesh(Sphere(Point3f(0), 1f0), color=:blue)
end
Expand Down Expand Up @@ -623,3 +644,4 @@ end
@reference_test "Heatmap 3D" begin
heatmap(-2..2, -1..1, RNG.rand(100, 100); axis = (; type = LScene))
end
=#
66 changes: 33 additions & 33 deletions ReferenceTests/src/tests/refimages.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,39 +13,39 @@ using ReferenceTests.Colors: RGB, N0f8
using ReferenceTests.DelaunayTriangulation
using Makie: Record, volume

@testset "categorical" begin
include("categorical.jl")
end
@testset "dates" begin
include("dates.jl")
end
@testset "unitful" begin
include("unitful.jl")
end
@testset "specapi" begin
include("specapi.jl")
end
@testset "primitives" begin
include("primitives.jl")
end
@testset "text.jl" begin
include("text.jl")
end
@testset "attributes.jl" begin
include("attributes.jl")
end
@testset "examples2d.jl" begin
include("examples2d.jl")
end
# @testset "categorical" begin
# include("categorical.jl")
# end
# @testset "dates" begin
# include("dates.jl")
# end
# @testset "unitful" begin
# include("unitful.jl")
# end
# @testset "specapi" begin
# include("specapi.jl")
# end
# @testset "primitives" begin
# include("primitives.jl")
# end
# @testset "text.jl" begin
# include("text.jl")
# end
# @testset "attributes.jl" begin
# include("attributes.jl")
# end
# @testset "examples2d.jl" begin
# include("examples2d.jl")
# end
@testset "examples3d.jl" begin
include("examples3d.jl")
end
@testset "short_tests.jl" begin
include("short_tests.jl")
end
@testset "figures_and_makielayout.jl" begin
include("figures_and_makielayout.jl")
end
@testset "updating_plots" begin
include("updating.jl")
end
# @testset "short_tests.jl" begin
# include("short_tests.jl")
# end
# @testset "figures_and_makielayout.jl" begin
# include("figures_and_makielayout.jl")
# end
# @testset "updating_plots" begin
# include("updating.jl")
# end
Loading