当前位置:网站首页>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
边栏推荐
- 剑指Offer 68 - II. 二叉树的最近公共祖先
- Advanced area of attack and defense world misc 3-11
- [odx Studio Edit pdx] - 0.2 - Comment comparer deux fichiers pdx / odx
- 【图论】拓扑排序
- Taobao commodity review API interface (item_review get Taobao commodity review API interface), tmall commodity review API interface
- OSEK标准ISO_17356汇总介绍
- Feature scaling normalization
- 【ODX Studio编辑PDX】-0.3-如何删除/修改Variant变体中继承的(Inherited)元素
- Redis getting started complete tutorial: Key Management
- Redis introduction complete tutorial: detailed explanation of ordered collection
猜你喜欢

MySQL Architecture - user rights and management

Redis入门完整教程:HyperLogLog

Redis入门完整教程:Bitmaps

Redis入門完整教程:Pipeline

Editplus-- usage -- shortcut key / configuration / background color / font size

A complete tutorial for getting started with redis: Pipeline

LabVIEW中比较两个VI
![[graph theory] topological sorting](/img/2c/238ab5813fb46a3f14d8de465b8999.png)
[graph theory] topological sorting

攻防世界 MISC 高手进阶区 001 normal_png

【机器学习】手写数字识别
随机推荐
攻防世界 MISC 进阶 glance-50
Record: how to scroll screenshots of web pages on Microsoft edge in win10 system?
[sword finger offer] questions 1-5
【ODX Studio编辑PDX】-0.3-如何删除/修改Variant变体中继承的(Inherited)元素
共创软硬件协同生态:Graphcore IPU与百度飞桨的“联合提交”亮相MLPerf
【ODX Studio编辑PDX】-0.2-如何对比Compare两个PDX/ODX文件
MYSQL架构——逻辑架构
Summary of wechat applet display style knowledge points
Detailed explanation of heap sort code
Redis: redis configuration file related configuration and redis persistence
啃下大骨头——排序(二)
The new version judges the code of PC and mobile terminal, the mobile terminal jumps to the mobile terminal, and the PC jumps to the latest valid code of PC terminal
该如何去选择证券公司,手机上开户安不安全
Feature scaling normalization
Redis入门完整教程:HyperLogLog
Redis入门完整教程:Bitmaps
Redis introduction complete tutorial: slow query analysis
Attack and defense world misc advanced zone 2017_ Dating_ in_ Singapore
集群的概述与定义,一看就会
攻防世界 MISC 进阶区 hong