Update G4Vis to breaking changes in GeometryBasics@0.5#27
Update G4Vis to breaking changes in GeometryBasics@0.5#27peremato merged 3 commits intoJuliaHEP:masterfrom fhagemann:g4vis
G4Vis to breaking changes in GeometryBasics@0.5#27Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #27 +/- ##
=========================================
- Coverage 1.78% 1.76% -0.03%
=========================================
Files 17 17
Lines 1231 1250 +19
=========================================
Hits 22 22
- Misses 1209 1228 +19 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
https://github.com/JuliaHEP/Geant4.jl/actions/runs/15480067026/job/43584141833?pr=27#step:9:59 damn why is this so unhelpful |
|
I will look at this specific example locally and see whether I can learn anything from it.. -.- |
|
does the Project.toml in |
|
I don't have compat entries in the docs/Project.toml locally. I could try adding one though |
Because it has additional dependencies (e.g. Literate, PYTHIA8, etc.) |
Because to generate the documentation (create and run the notebooks) we need to run Geant4 several times and this can only be done in separate processes since the cleanup of Geant4 C++ is not perfect (many singletons left behind). |
|
I am can build successfully the documentation locally (MacOS) but fails in the CI with signal 11 (segmentation fault). I'll try in a Linux system. I suspect the |
|
@fhagemann Yes the problem is that GeometryBasics has changed the internal layout and the interface to IGLWrap does not work anymore. For the time being to get this PR we can disable drawing boolean solids with something like this: --- a/ext/G4Vis/Boolean.jl
+++ b/ext/G4Vis/Boolean.jl
@@ -40,11 +40,12 @@ function boolean(op, m1::GeometryBasics.Mesh, m2::GeometryBasics.Mesh, t::Transf
ncoors(cm)::Ptr{Cint}, nfaces(cm)::Ptr{Cint},
vpointer(cm)::Ptr{Ptr{Cdouble}}, fpointer(cm)::Ptr{Ptr{Cint}},
j::Ref{Ptr{Cint}})::Cint
+ @show ret
if ret == 0
c = unsafe_array(Point3{Float64}, cm.vertices, cm.nv)
f = unsafe_array(TriangleFace{Int32}, cm.faces, cm.nf)
- return GeometryBasics.Mesh(c,f)
+ return GeometryBasics.mesh(c,f)
else
return
end
@@ -62,13 +63,15 @@ const operation = Dict("G4UnionSolid" => 0, "G4IntersectionSolid" => 1, "G4Subtr
function GeometryBasics.mesh(s::G4BooleanSolid)
if isdefined(IGLWrap_jll, :libiglwrap)
- op = operation[GetEntityType(s)]
- left = GetConstituentSolid(s, 0)
- right = GetConstituentSolid(s, 1)
- boolean(op, GeometryBasics.mesh(left), GeometryBasics.mesh(right))
+ println("IGLWrap_jll is available but interface needs to be fixed for drawing boolean solids (TODO)")
+ GeometryBasics.mesh(Point3{Float64}[], QuadFace{Int32}[])
+ #op = operation[GetEntityType(s)]
+ #left = GetConstituentSolid(s, 0)
+ #right = GetConstituentSolid(s, 1)
+ #boolean(op, GeometryBasics.mesh(left), GeometryBasics.mesh(right))
else
- println("IGLWrap_jll is not available for currrent platform $(Sys.MACHINE) and is needed for drawing boolean solids")
- GeometryBasics.Mesh(Point3{Float64}[], QuadFace{Int32}[])
+ println("IGLWrap_jll is not available for current platform $(Sys.MACHINE) and is needed for drawing boolean solids")
+ GeometryBasics.mesh(Point3{Float64}[], QuadFace{Int32}[])
end
end
@@ -80,7 +83,7 @@ function GeometryBasics.mesh(s::G4DisplacedSolid)
points = GeometryBasics.coordinates(m)
faces = GeometryBasics.faces(m)
map!(c -> c * t, points, points)
- GeometryBasics.Mesh(points, faces)
+ GeometryBasics.mesh(points, faces)
end
function Geant4.draw(solid::G4BooleanSolid; wireframe::Bool=false, kwargs...) |
there's still way to do it, we can use Line 47 in c715fa4 a target of |
|
I h
I had a quick look at this: this might require some work because the docs build activates the environment in the Lines 1 to 13 in c715fa4 If I "just" delete the docs/Project.toml and add all information via [extras] and [targets] to the main Project.toml, the docs build fails immediately.
|
|
Line 9 in c715fa4 my understanding is this shouldn't be done manually, because the doc-building GitHub action should activate docs environment as defined in the top-level Project.toml? I haven't tried |
|
As I already said, each notebook needs to be created in a new process (invoking |
|
Is this good to be merged? |
I'll have a look myself. I feel responsible of having done it this way. |

According to the release notes of
GeometryBasics@0.5.0, there seem to be some breaking changes that affect theG4Visextension, and also currently result in the documentation CI failing.These changes are:
Also, looks like
CairoMakie.draw_mesh3Drequires thenormalsto be of typeUnion{Nothing, Vec3f}(so in this caseVec3f = Vec3{Float32}), butG4Visby default createsnormalsof typeVec3{Float64}and struggles converting it because of theUnion. Therefore, I explicitly require thenormaltypeto beVec3f.I also bumped the minimal compat for
GeometryBasicsto0.5. As far as I know,GeometryBasicsis only relevant in theG4Visextension.Let's see whether the docs CI runs without failing now 🤞