MeteoInfo的个人博客分享 http://blog.sciencenet.cn/u/MeteoInfo

博文

MeteoInfoLab绘制三维南瓜

已有 897 次阅读 2022-11-28 09:01 |个人分类:MeteoInfo|系统分类:科研笔记

脚本是从MATLAB程序移植过来的,主要是sphere函数生成球形表面,再进行调整。

# Snack Jack pumpkin
 
[X,Y,Z] = sphere(160)
R = 1+(-(1-mod(arange(0,16.1,.1).reshape(1,-1),2))**2)/40+ \
    (-(1-mod(arange(0,32.1,.2).reshape(1,-1),2))**2)/40
 
axes3d(aspect='equal', axis=None, axes_zoom=True)
lighting()
material([0.6,0.7,0.2,100,0.5])
surf(R*X, R*Y, (.8+(0-arange(1,-1.01,-.0125).reshape(1,-1).T**4)*.3)*Z*R*1.2, 
    facecolor='#e60', edgecolor=None)
    
# Recycle the sphere coords for the stem.
surf(X/15, Y/15, Z/2+.6, facecolor='#040', edgecolor=None)

pumpkin.png



https://blog.sciencenet.cn/blog-611158-1365573.html

上一篇:发布MeteoInfo 3.4
下一篇:MeteoInfoLab脚本绘制山魈脸谱
收藏 IP: 114.247.188.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...
扫一扫,分享此博文

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-4-27 10:47

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部