Julia and Projective Geometric Algebra with GLMakie: Unable to Plot 3D Triangle

Hi all,

I am following this medium:

and I am trying the code to plot 3D Triangle from REPL:

  1.  includes “ripga3d.jl” so the REPL can evaluate 3D PGA expressions,
  2.  defines three vertices of a triangle in 3D space,
  3.  translates the vertices from Euclidean coordinates to PGA expressions,
  4.  constructs three triangle sides by joining pairs of those vertices,
  5.  calculates the lengths of the triangle sides,
  6.  constructs a plane face by joining all three vertices,
  7.  calculates the area of the triangle,
  8.  defines a horizontal plane at z=1/2,
  9.  cuts the triangle with that horizontal plane, and finally
  10. plots the cut triangle.
include("ripga3d.jl"); # REPL G
using GLMakie

VC = Float32.([0 -1/2 1/2; 0 -1 -1; 1 0 0]) # Vertex Coordinates
V = point(VC) # Vertex PGA expressions
S = [V[:,1]&V[:,2]  V[:,2]&V[:,3]  V[:,3]&V[:,1]] # triangle Sides
side_lengths = norm(S)
F = V[:,1] & V[:,2] & V[:,3]
area = norm(F)/2
zcut = e3 - 0.5*e0
P = S ^ zcut
C = toCoord(P)

fig = Figure()
ax3d = Axis3(fig[1,1], aspect = (1,1,1));
lines!(ax3d, [VE VE[:,1]], color = :black);
scatter!(ax3d, VE, markersize = 25, color = [:red, :green, :blue]);
lines!(ax3d, C, linestyle = :dot, color = :gray);

I got an error:

LoadError: UndefVarError: VE not defined

What did I miss?

I couldn’t see any definition for VE in the original article, so - unless some version of your existing V or VC works - you’ll have to ask the author…