Last active
September 20, 2018 09:14
-
-
Save mschauer/36865d9a7ce3e9f7969b45b7eb5f4002 to your computer and use it in GitHub Desktop.
Makie Moebius band
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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