# 3D-Code-Examples **Repository Path**: python_examples/3d-code-examples ## Basic Information - **Project Name**: 3D-Code-Examples - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-08-14 - **Last Updated**: 2024-08-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # computer_graphics_examples 日常使用的与计算机图形相关的示例程序开发与收集。 这个例子存在许多不完善的东西,只能参考代码,README文件的内容与代码不匹配。 ## Install ```bash conda create -n 3d-code-examples python=3.8 conda activate 3d-code-examples conda install vedo # 安装 vedo 后,可以不再安装 numpy 与 vtk conda install numpy=1.19 # numpy>=1.20 后,vtk 使用 numpy.bool 会报错 conda install vtk=9.0.3 -c conda-forge conda install trimesh pyglet shapely -c conda-forge conda install scikit-learn, scikit-image -c anaconda conda install pytransform3d -c conda-forge conda install plyfile -c conda-forge # conda install open3d -c open3d-admin # 版本太旧了 conda install pyopengl -c conda-forge conda install point_cloud_utils -c conda-forge conda install pre-commit #pip install pymeshlab -i https://pypi.org/simple pip install pymeshlab pip install polyscope # 旧版本中以下安装失败,建议使用 pip 安装 # conda install opencv3 -c menpo ``` 注:如果安装后程序运行时报错,建议使用 pip 安装,如下: ```bash pip install vtk open3d pip install opencv-python PyOpenGL PyOpenGL_accelerate pip install point-cloud-utils ``` Windows 下 opencv, opengl, pyopengl_accelerate 的安装存在问题, 建议[下载安装包](https://www.lfd.uci.edu/~gohlke/pythonlibs/)。 ## Examples List of examples - Loading meshes and point clouds - Saving meshes and point clouds - Generating blue-noise samples on a mesh with Poisson-disk sampling - Generate random samples on a mesh - Downsample a point cloud to have a blue noise distribution - Downsample a point cloud on a voxel grid - Estimating normals from a point cloud - Computing mesh normals per vertex - Computing mesh normals per face - Consistently orienting faces of a mesh - Approximate Wasserstein (Sinkhorn) distance between two point clouds - Chamfer distance between two point clouds - Hausdorff distance between two point clouds - K-nearest-neighbors between two point clouds - Generating point samples in the square and cube with Lloyd relaxation - Compute shortest signed distances to a triangle mesh with fast winding numbers - Compute closest points on a mesh - Deduplicating point clouds and meshes - Removing unreferenced mesh vertices - Calculating face areas of a mesh - Smoothing a mesh - Computing connected components - Decimating a triangle mesh - Making a mesh watertight - Ray/Mesh intersection - Ray/Surfel intersection - Computing curvature on a mesh - Computing a consistent inside/outside for a triangle soup - Voxelizing a triangle mesh - Flood filling a dense grid - Generating a mesh for a voxel grid