当前位置:网站首页>SPH中的粒子初始排列问题(两张图解决)
SPH中的粒子初始排列问题(两张图解决)
2022-07-04 22:37:00 【beidou111】
因此对应代码为(改自太极k-ye的pbf2d.py)
def init():
init_pos = ti.Vector([0.2,0.3,0.2])
cube_size = 0.4
spacing = 0.02
num_per_row = (int) (cube_size // spacing)
num_per_floor = num_per_row * num_per_row
for i in range(num_particles):
floor = i // (num_per_floor)
row = (i % num_per_floor) // num_per_row
col = (i % num_per_floor) % num_per_row
positions[i] = ti.Vector([row*spacing, floor*spacing, col*spacing]) + init_pos
边栏推荐
- Redis入门完整教程:Redis Shell
- 【剑指Offer】6-10题
- Redis入門完整教程:Pipeline
- Lost in the lock world of MySQL
- 金融市场,资产管理与投资基金
- Redis入门完整教程:键管理
- A complete tutorial for getting started with redis: understanding and using APIs
- 小程序vant tab组件解决文字过多显示不全的问题
- Pagoda 7.9.2 pagoda control panel bypasses mobile phone binding authentication bypasses official authentication
- P2181 diagonal and p1030 [noip2001 popularization group] arrange in order
猜你喜欢
Redis入门完整教程:Pipeline
Detailed explanation of heap sort code
A complete tutorial for getting started with redis: Pipeline
Redis: redis configuration file related configuration and redis persistence
攻防世界 MISC 进阶区 hit-the-core
攻防世界 MISC 高手进阶区 001 normal_png
Sobel filter
Redis入门完整教程:Bitmaps
MYSQL架构——用户权限与管理
Serial port data frame
随机推荐
集群的概述与定义,一看就会
Attack and defense world misc master advanced zone 001 normal_ png
JS card style countdown days
小程序vant tab组件解决文字过多显示不全的问题
Co create a collaborative ecosystem of software and hardware: the "Joint submission" of graphcore IPU and Baidu PaddlePaddle appeared in mlperf
Tweenmax emoticon button JS special effect
该如何去选择证券公司,手机上开户安不安全
ECS settings SSH key login
vim编辑器知识总结
Principle of lazy loading of pictures
Redis入门完整教程:哈希说明
Redis入门完整教程:Redis Shell
Sword finger offer 65 Add without adding, subtracting, multiplying, dividing
Qt加法计算器(简单案例)
Talk about Middleware
Redis入门完整教程:慢查询分析
【剑指Offer】6-10题
How can enterprises cross the digital divide? In cloud native 2.0
Common methods in string class
【二叉树】节点与其祖先之间的最大差值