Created
December 5, 2016 13:37
-
-
Save anonymous/bc98e07f807ebc03f75837cb76117b79 to your computer and use it in GitHub Desktop.
This file contains 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
# Adopted to Julia | |
# Copyright (c) 2016, Hiroharu Sugawara <hsugawa@gmail.com> | |
# License: BSD Style. | |
# An example of a cone, ie a non-regular mesh defined by its triangles. | |
n = 8 | |
t = linspace(-pi, pi, n) | |
xy = exp(im * t) | |
x = real(xy) | |
y = imag(xy) | |
z = zeros(n) | |
triangles = [ (0, i, i + 1) for i in 1:n-1 ] | |
unshift!(x,0.0) | |
unshift!(y,0.0) | |
unshift!(z,1.0) | |
t=Array(t) | |
unshift!(t,0.0) | |
using PyCall | |
@pyimport mayavi.mlab as mlab | |
mlab.triangular_mesh(x, y, z, triangles, scalars=PyObject(t)) | |
mlab.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment