当前位置:网站首页>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
边栏推荐
- Async await used in map
- JS 3D explosive fragment image switching JS special effect
- Analysis of environmental encryption technology
- 攻防世界 MISC 进阶 glance-50
- [roommate learned to use Bi report data processing in the time of King glory in one game]
- Advanced area a of attack and defense world misc Masters_ good_ idea
- Sword finger offer 68 - ii The nearest common ancestor of binary tree
- LabVIEW中比较两个VI
- Record: how to scroll screenshots of web pages on Microsoft edge in win10 system?
- Redis入门完整教程:Pipeline
猜你喜欢

Co create a collaborative ecosystem of software and hardware: the "Joint submission" of graphcore IPU and Baidu PaddlePaddle appeared in mlperf

MySQL Architecture - user rights and management

堆排序代码详解

攻防世界 MISC 进阶区 hong

VIM editor knowledge summary

【机器学习】手写数字识别

A complete tutorial for getting started with redis: getting to know redis for the first time

Analysis of the self increasing and self decreasing of C language function parameters

Set up a website with a sense of ceremony, and post it to 1/2 of the public network through the intranet

vim编辑器知识总结
随机推荐
Talk about Middleware
Attack and defense world misc advanced area can_ has_ stdio?
攻防世界 MISC 进阶区 can_has_stdio?
Advanced area of attack and defense world misc 3-11
共创软硬件协同生态:Graphcore IPU与百度飞桨的“联合提交”亮相MLPerf
【机器学习】手写数字识别
P2181 对角线和P1030 [NOIP2001 普及组] 求先序排列
为什么信息图会帮助你的SEO
ETCD数据库源码分析——处理Entry记录简要流程
S32 Design Studio for ARM 2.2 快速入门
EditPlus--用法--快捷键/配置/背景色/字体大小
攻防世界 MISC 进阶区 3-11
Analysis of the self increasing and self decreasing of C language function parameters
A complete tutorial for getting started with redis: hyperloglog
串口数据帧
Redis démarrer le tutoriel complet: Pipeline
Attack and defense world misc advanced area Hong
小程序vant tab组件解决文字过多显示不全的问题
A complete tutorial for getting started with redis: redis shell
Redis getting started complete tutorial: publish and subscribe