当前位置:网站首页>【taichi】在太极中画出规整的网格
【taichi】在太极中画出规整的网格
2022-07-27 23:51:00 【beidou111】
import numpy as np
import taichi as ti
grid_n = 10
dx = 1 / grid_n
dy = 1 / grid_n
def draw_grid():
X = []
Y = []
for i in range(grid_n):
X.append([dx*i,0])
Y.append([dx*i,1])
for i in range(grid_n):
X.append([0, dy*i])
Y.append([1, dy*i])
X = np.array(X)
Y = np.array(Y)
gui.lines(begin=X, end=Y, radius=2, color=0x000000)
gui = ti.GUI("draw_grid", res=800, background_color=0xFFFFFF)
while gui.running:
draw_grid()
gui.show()

边栏推荐
- Distributed | how to import data into dble quickly through the split function of dble
- 华为“天才少年”稚晖君又出新作,从零开始造“客制化”智能键盘
- Leetcode 2341. How many pairs can an array form
- 企业运维实践-使用Aliyun容器镜像服务对海外gcr、quay仓库镜像进行镜像拉取构建
- Lambda表达式和Stream流
- Tencent cloud hiflow scene connector
- Lua get started quickly
- leetcode: 515. 在每个树行中找最大值
- [style set 1] tab
- 【样式集合1】tab 栏
猜你喜欢

leetcode: 515. 在每个树行中找最大值

8000 word explanation of OBSA principle and application practice

腾讯云HiFlow场景连接器

Byte monthly salary 28K, share a wave of my automation testing experience

基于 Flink CDC 实现海量数据的实时同步和转换

Learn how Baidu PaddlePaddle easydl realizes automatic animal recognition in aquarium

IIC读写EEFPROM

PHP利用某些函数bypass waf探讨

26.抽象化和模板思想

Matlab 44 animation gradient drawing programs
随机推荐
26. Abstraction and template ideas
Day 013 one dimensional array exercise
ICML2022 | 在线决策Transformer
Count the number of given strings in a string
QT setting Icon
Baidu PaddlePaddle easydl: when AI enters the factory, "small bearing" can also turn "big industry"
"Wei Lai Cup" 2022 Niuke summer multi school training camp 3 supplementary problem solution (a, C, J)
EEG多元模式分析预测慈善捐赠行为
普通设备能不能接入TSN时间敏感网络?
Summary: Prometheus storage
白质脑功能网络图论分析:抑郁症分类和预测的神经标记
Hcip day 15
喜欢听的歌曲
A comprehensive case of crawler learning -- visiting websites
面试题 01.09. 字符串轮转
IIC读写EEFPROM
Let's move forward together, the 10th anniversary of Google play!
Oracle RAC cluster file directory migration
迅为i.MX6ULL开发板Qt系统移植-交叉编译Qt代码
【分布式开发】之 CAP 原则