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

边栏推荐
- Software test interview question: how to find problems related to the database?
- Leetcode 2347. the best poker hand
- HRD 1. a simple and reliable HRD detection method
- Fluent call interface UI
- Cap principle of [distributed development]
- 幸福的晚年
- Article reproduction: super resolution network fsrcnn
- Sort out SQL performance optimization and collect classics!
- VPP之DPDK插件
- 周报、月报有多折磨人?万能报表模板建议收藏!(附模板)
猜你喜欢
随机推荐
喜欢听的歌曲
Interview question 01.05. Primary editing
If you are still using WiFi, you will be out: li-fi is better!!!
Fluent call interface UI
软件测试面试题:你们的性能测试需求哪里来?
Leetcode 2347. the best poker hand
For newly installed PIP3, use no module named 'LSB_ Release 'problem
3000 words and 11 pictures hard core popular science: what is edge computing? What are the connections and differences with cloud computing?
Summary of common shortcut keys in idea
在一个字符串里面统计给定字符串的个数
Codeforces summer training weekly (7.14~7.20)
Neuron 2.1.0 release: it supports sparkplug B specification and more complete industrial protocol support
Dart 代码注释和文档编写规范
梳理 SQL 性能优化,收藏经典!
Thoroughly understand kubernetes scheduling framework and plug-ins
阿虎的故事
Let's move forward together, the 10th anniversary of Google play!
Unity shader introduction Essentials - basic texture
C#学习笔记----C#连接MySQL数据库
What is the opening time of London Silver









