Skip to content

Instantly share code, notes, and snippets.

View rexwangcc's full-sized avatar
🌀
Focusing

Rex rexwangcc

🌀
Focusing
View GitHub Profile
@rexwangcc
rexwangcc / ci-check-pr-title-format.py
Last active April 25, 2023 08:44
A Python Script for checking Pull Request title conventions.
import sys
import re
from typing import Callable, List
VALID_PR_TAGS = {
# this pr implements new features
"Feature",
# this pr fixes bugs
"Bugfix",
# this pr updates documentation
@rexwangcc
rexwangcc / metadata
Created March 30, 2022 09:38 — forked from k-ye/metadata
Taichi CLA Fork
{
"name": {
"title": "Full Name",
"type": "string",
"githubKey": "name"
},
"email": {
"title": "E-Mail",
"type": "string",
"githubKey": "email"
@rexwangcc
rexwangcc / taichi_zoo_Julia-Set-Fractal.py
Last active August 30, 2021 01:09
A Julia Set fractal implementation in Taichi language. Originally created by @yuanming-hu.
import taichi as ti
ti.init(arch=ti.gpu)
n = 320
pixels = ti.field(dtype=float, shape=(n * 2, n))
@ti.func
def complex_sqr(z):
@rexwangcc
rexwangcc / taichi_zoo_MLS-MPM-128.py
Last active September 3, 2021 23:12
A Moving Least Squares Material Point Method implementation in Taichi language. Originally created by @yuanming-hu with 128 lines of code.
import taichi as ti
ti.init(arch=ti.gpu) # Try to run on GPU
quality = 1 # Use a larger value for higher-res simulations
n_particles, n_grid = 9000 * quality**2, 128 * quality
dx, inv_dx = 1 / n_grid, float(n_grid)
dt = 1e-4 / quality
p_vol, p_rho = (dx * 0.5)**2, 1
p_mass = p_vol * p_rho
@rexwangcc
rexwangcc / taichi_zoo_Taichi-logo.py
Created August 30, 2021 00:33
Render a Taichi logo with Taichi language, originally created by @yuanming-hu
import taichi as ti
ti.init(arch=ti.cpu)
n = 512
x = ti.field(ti.f32, shape=(n, n))
@ti.kernel
def paint():
@rexwangcc
rexwangcc / taichi_zoo_MLS-MPM-88.py
Last active September 3, 2021 23:12
A Moving Least Squares Material Point Method implementation with Taichi language. Originally created by @yuanming-hu with 88 lines of code.
import taichi as ti
ti.init(arch=ti.gpu)
n_particles = 8192
n_grid = 128
dx = 1 / n_grid
dt = 2e-4
p_rho = 1
@rexwangcc
rexwangcc / mpm88.py
Created July 19, 2021 01:27
A Moving Least Squares Material Point Method implementation
import taichi as ti
ti.init(arch=ti.gpu)
n_particles = 8192
n_grid = 128
dx = 1 / n_grid
dt = 2e-4
p_rho = 1
@rexwangcc
rexwangcc / routes.js
Created July 3, 2021 21:50
docusaurus generated routes file
import React from 'react';
import ComponentCreator from '@docusaurus/ComponentCreator';
export default [
{
path: '/__docusaurus/debug',
component: ComponentCreator('/__docusaurus/debug','3d6'),
exact: true,
},
{