Skip to content

Self practice library of pytorch-based 3D geometry processing

License

Notifications You must be signed in to change notification settings

lzhnb/Primitive3D

Repository files navigation

Primitive3D

Primitive3D: Self-Pratice Library for pytorch-based 3D Data Processing.

Installation

export OptiX_INSTALL_DIR=$OptiX_INSTALL_DIR # (optional)
python setup.py develop

Examples

  • Ray Casting
import torch
import prim3d

vertices: torch.Tensor # input vertices
faces: torch.Tensor # input faces
# create the ray caster
ray_caster = prim3d.create_raycaster(vertices, faces)

# setting ray origins and directions
origins: torch.Tensor
dirs: torch.Tensor

# output contained
depths: torch.Tensor
normals: torch.Tensor
primitive_ids: torch.Tensor

# conduct ray casting
ray_caster.invoke(origins, dirs, depths, normals, primitive_ids)
  • Marching Cubes
# toy examples from the PyMCubes
python examples/sphere.py
# we extract the sdf of bunny via `mesh_to_sdf`
python examples/bunny_sdf.py
# example for extracting a sphere using marching tetrahedra
python examples/sphere_tetrahedra.py

TODO

  • RayCasting based on Optix or CUDA BVH
  • Marching Cubes(Mitigate from CuMCubes)
  • Add RayCasting Examples
  • SDF From Mesh
  • Documents

Acknowledgement

ResourcesPermalink

Please feel free to discuss :)

About

Self practice library of pytorch-based 3D geometry processing

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published