当前位置:网站首页>【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()

边栏推荐
- 喜欢听的歌曲
- 普通设备能不能接入TSN时间敏感网络?
- Modify the request path using the streaming API of gateway
- Sort out SQL performance optimization and collect classics!
- 面试题 01.07. 旋转矩阵
- Software test interview question: think_ What is the function of time?
- JG data reset (WD)
- 了解Shader
- Software testing interview question: where do your performance testing requirements come from?
- 面试题 01.08. 零矩阵
猜你喜欢

Docker builds MySQL master-slave locally

面试官:你确定Redis是单线程的进程吗?

【向 Dice Roller 应用添加图片】

Transplant QT system for i.mx6ull development board - cross compile QT code

IIC读写EEFPROM

Qlib教程——基于源码(二)本地数据保存与加载

普通设备能不能接入TSN时间敏感网络?

Three instance

Matlab 44 animation gradient drawing programs

Codeforces summer training weekly (7.14~7.20)
随机推荐
Codeforces summer training weekly (7.21~7.27)
Leetcode 2341. How many pairs can an array form
HRD 1. a simple and reliable HRD detection method
The understanding of domain adaptation in transfer learning and the introduction of three technologies
递归相关习题
使用Gateway的流式api修改请求路径
Docker builds MySQL master-slave locally
Interview question 01.09. string rotation
likeshop外卖点餐系统【100%开源无加密】
【样式集合1】tab 栏
Unity shader introduction Essentials - basic texture
JUC concurrent programming learning
在一个字符串里面统计给定字符串的个数
Kibana6.2.4 version update x-pack certification
Realize OCR language recognition demo (II) - display and interaction of pictures and recognition content
基于 Flink CDC 实现海量数据的实时同步和转换
Discussion on PHP using some functions bypass WAF
总结:Prometheus存储
[style set 1] tab
VLAN experiment