You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For signed distance function of 3D object, It could represent the object like this:
@ti.dataclass
class Sphere:
center: vec3
radius: float
@ti.dataclass
class Triangle:
p1: vec3
p2: vec3
p3:vec3
Or more generally
@ti.dataclass
class SDFObject:
floatField1:float
...
floatFieldN:float
vec3Field1:vec3
...
vec3FieldN:vec3
GeoType:int # 1 for sphere 2 for triangle and so on
But how do you represent a triangle mesh object? I want to do somethng like this:
@ti.dataclass:
class Mesh:
face: ti.Matrix(n,3) #dynamic size,but can be determined on runtime
normal:ti.Matrix() #same size as face
n:int #number of triangles
Meshfield = Mesh.field(shape=(10,)) #represent all the mesh in the scene
Or do I need to construct the cloud into something like this, this solution make the AABB box searching difficult?
AllFaces = ti.root.dynamic(ti.i, N, chunk_size=32) #represent all the faces of all mesh,precaculate the total faces number in the scene?
face = ti.Vector.field(n=3, dtype=float, shape=(3,))
AllFaces.place(face)
The text was updated successfully, but these errors were encountered:
For signed distance function of 3D object, It could represent the object like this:
@ti.dataclass
class Sphere:
center: vec3
radius: float
@ti.dataclass
class Triangle:
p1: vec3
p2: vec3
p3:vec3
Or more generally
@ti.dataclass
class SDFObject:
floatField1:float
...
floatFieldN:float
vec3Field1:vec3
...
vec3FieldN:vec3
GeoType:int # 1 for sphere 2 for triangle and so on
But how do you represent a triangle mesh object? I want to do somethng like this:
@ti.dataclass:
class Mesh:
face: ti.Matrix(n,3) #dynamic size,but can be determined on runtime
normal:ti.Matrix() #same size as face
n:int #number of triangles
Meshfield = Mesh.field(shape=(10,)) #represent all the mesh in the scene
Or do I need to construct the cloud into something like this, this solution make the AABB box searching difficult?
AllFaces = ti.root.dynamic(ti.i, N, chunk_size=32) #represent all the faces of all mesh,precaculate the total faces number in the scene?
face = ti.Vector.field(n=3, dtype=float, shape=(3,))
AllFaces.place(face)
The text was updated successfully, but these errors were encountered: