How to visualize infinite lines with Makie.jl?

Say I have an infinite line passing through the points (0,0,0) and (1,1,1) in 3D. How to visualize this line in Makie so that it is always visible no matter the level of zoom?

We don’t have that for 3D, yet. But the way it works is to derive the endpoints of the line using the current projection matrix / axis limits. Therefore, whenever the projection changes, the line updates.

Is there an example in 2D that works already @jules? We have a couple of things that are infinite and that we would like to visualize such as lines, rays, planes.

The projection thing you can look at in the ablines code, for example. You’d have to analyze that matrix differently, though, for your 3D usecase: Makie.jl/src/basic_recipes/ablines.jl at master · MakieOrg/Makie.jl · GitHub

If there is a built-in function that we can call as Makie.line(p1, p2), we can update our recipes accordingly.

@jules Makie.ablines and Makie.vlines work perfectly in 2D. What is the current status for 3D lines? Any built-in recipe that we could use to visualize lines that cross the entire scene?

I guess in Tyler we do something similar:

Thank you @sdanisch. I am bit lost with the more low-level camera details. If there is a high-level recipe that takes a line representation in 3D space and produces the desired visualization, that would help a lot.

Does something like lines!([p1, p2], xautolimits=false, yautolimits=false, zautolimits=false) work for 3d? With p1 and p2 finite but very far from each other, much further than any reasonable zoom level.

Unfortunately not, depending on your camera’s near and farclip settings (that depend on data) the line would be clipped at a seemingly arbitrary point.