Exemple #1
0
def add_density(x: ti.i32, y: ti.i32, r: ti.i32, value: ti.f32):
    for index in range((2 * r + 1) * (2 * r + 1)):
        i = index // (2 * r + 1) - r
        j = ti.mod(index, 2 * r + 1) - r
        den = density_pair.cur[x + i, y + j] + value * smooth_step(
            r * r, 0.0, i * i + j * j)
        density_pair.cur[x + i, y + j] = den
Exemple #2
0
 def __mod__(self, other):
     import taichi as ti
     return ti.mod(self, other)
Exemple #3
0
 def __imod__(self, other):
     import taichi as ti
     self.assign(ti.mod(self, other))
     return self
Exemple #4
0
 def __rmod__(self, other):
     import taichi as ti
     return ti.mod(other, self)
Exemple #5
0
 def __rmod__(self, other):
     _taichi_skip_traceback = 1
     return ti.mod(other, self)
Exemple #6
0
 def __imod__(self, other):
     _taichi_skip_traceback = 1
     self.assign(ti.mod(self, other))
     return self
Exemple #7
0
 def __rmod__(self, other):
     import taichi as ti
     _taichi_skip_traceback = 1
     return ti.mod(other, self)