chakravala / Grassmann.jl

⟨Grassmann-Clifford-Hodge⟩ multilinear differential geometric algebra

Home Page:https://grassmann.crucialflow.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

3D vector fields don't plot correctly

chillenb opened this issue · comments

I am trying to run

using Grassmann, Makie; @basis S"∞+++"
streamplot(vectorfield(exp((π/4)*(v12+v∞3)),V(2,3,4),V(1,2,3)),-1.5..1.5,-1.5..1.5,-1.5..1.5,gridsize=(10,10))

Of course, I first get an error ERROR: No backend available!

but after loading CairoMakie, rerunning

streamplot(vectorfield(exp((π/4)*(v12+v∞3)),V(2,3,4),V(1,2,3)),-1.5..1.5,-1.5..1.5,-1.5..1.5,gridsize=(10,10))

produces the following image:
strange_vecfield3d

I am using Julia v1.9.4 (x64 linux) and the following packages are installed:

  [13f3f980] CairoMakie v0.11.3
  [e9467ef8] GLMakie v0.9.3
  [4df31cd9] Grassmann v0.8.6
  [ee78f7c6] Makie v0.20.2
  [9b87118b] PackageCompiler v2.1.16
  [91a5bcdd] Plots v1.39.0

The 2D vector field examples seem to work just fine

Thanks for reporting, this is an issue with Makie.jl itself and not with Grassmann.jl specifically:

Observe that

f = vectorfield(exp((π/4)*(v12+v∞3)),V(2,3,4),V(1,2,3))

returns a function which can accept Point input

julia> f(Point(1,1,1))
3-element Point3{Float64} with indices SOneTo(3):
 -0.5
  0.49999999993486655
  0.9999999999348665

So the vectorfield method defined in Grassmann works the same as it always has for this example.

The issue seems to be with the streamplot function in Makie.jl ... perhaps you should open an issue there?

All the example does is feed f into the streamplot method from Makie, so the issue is with Makie.streamplot it seems.

Thanks for looking into this for me!

I see now that the problem is definitely a Makie regression. The arrows in 3D streamplot are much too large by default. The good news is that I was still able to run your example by setting the arrow size explicitly: streamplot(..., arrow_size=0.1)

Happy holidays!
Chris