Skip to content

Instantly share code, notes, and snippets.

@mschauer
Last active September 20, 2018 09:14
Show Gist options
  • Select an option

  • Save mschauer/36865d9a7ce3e9f7969b45b7eb5f4002 to your computer and use it in GitHub Desktop.

Select an option

Save mschauer/36865d9a7ce3e9f7969b45b7eb5f4002 to your computer and use it in GitHub Desktop.
Makie Moebius band
using Makie
t = 0:0.1:2pi+0.1
function band_connect(n)
ns = 1:n-1
ns2 = n+1:2n-1
[ns ns .+ 1 ns2;
ns .+ 1 ns2 .+ 1 ns2 ]
end
mesh([sin.(t); sin.(t)], [0.5 .- cos.(-0.5*t .+ pi)*0.5; 0.5 .+ cos.(0.5*t .+ pi)*0.5],
[ cos.(t) .+ 0.25 .+ cos.(t)/4; cos.(t) .+ 0.5], band_connect(length(t))'[:], color = RGBAf0(1.0, 0, 0, 1.0), shading=true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment