Home

Awesome

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

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)
# 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

Acknowledgement

ResourcesPermalink

Please feel free to discuss :)