{"id":13439369,"url":"https://github.com/jiangwei221/obj2pcd","last_synced_at":"2025-03-20T08:30:41.531Z","repository":{"id":81191925,"uuid":"120818531","full_name":"jiangwei221/obj2pcd","owner":"jiangwei221","description":"Simple point cloud sampler for obj file","archived":false,"fork":false,"pushed_at":"2018-12-08T22:19:58.000Z","size":2085,"stargazers_count":30,"open_issues_count":3,"forks_count":7,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-08-01T03:29:13.487Z","etag":null,"topics":["mesh","pcd","pcl"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jiangwei221.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-02-08T21:11:15.000Z","updated_at":"2023-12-25T06:43:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"bc593a5b-a33c-42b2-9753-5744ac01da94","html_url":"https://github.com/jiangwei221/obj2pcd","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiangwei221%2Fobj2pcd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiangwei221%2Fobj2pcd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiangwei221%2Fobj2pcd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiangwei221%2Fobj2pcd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jiangwei221","download_url":"https://codeload.github.com/jiangwei221/obj2pcd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221739700,"owners_count":16872775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mesh","pcd","pcl"],"created_at":"2024-07-31T03:01:13.346Z","updated_at":"2024-10-27T22:30:48.222Z","avatar_url":"https://github.com/jiangwei221.png","language":"C++","funding_links":[],"categories":["C++"],"sub_categories":[],"readme":"# obj2pcd\nSimple point cloud sampler for obj files.\n### Introduction\n\n**obj2pcd** is a simple c++ program to sample a obj mesh to its point cloud representation. \n\nIt depends on GLM and PCL libraries. GML is provided in this repo, but you need to install PCL on your own. For Mac user, you can use `brew install pcl` to get the library.\n\nSome converter on the web directly convert the mesh vertices into a point cloud. It works for fine meshes, but not good for coarse meshes.\n\nIn this implementation, we sample the point cloud on the surface of a triangle, not the 3 vertices.\n\nHere is a visualization of the sampling of a cube consists of 12 traingles.\n\n![cube-vis](https://i.imgur.com/hnjpgQ1.png?1)\n\n### Build\n\n`cd build`\n\n`cmake ..`\n\n`make`\n\n### Usage\n\n`./obj2pcd ../models/monkey_v.obj ../output/monkey.pcd -sample_density 2000`\n\nThis command will sample the monkey_v.obj file (only vertex) into a pcd file, 2000 is the sample density. You can adjust the density.\n\nThere are two optional argvs. One is normal_flag, you need the interpolated normals in PCD or not, default is on. One is flip_flag, you need to flip the normal direction or not, default is off.\n\n### Note\n\nBecause I'm using a very simple model loader from [opengl-tutorial](opengl-tutorial.org), it can only handle the obj file with triangles, no quadrilateral support.\n\nIf you want to sample an obj mesh exported by Blender, make sure you triangulate it before you export.\n\n### convertall.py\n\nconvertall.py is a simple python script to convert all the obj files under one folder into PCD.\n\n```\nusage: convertall.py [-h] [--normals NORMALS] [--flip FLIP]\n                     models_dir output_dir sample_density\n\npositional arguments:\n  models_dir         models dir\n  output_dir         output dir\n  sample_density     sample density\n\noptional arguments:\n  -h, --help         show this help message and exit\n  --normals NORMALS  interpolate normals or not\n  --flip FLIP        flip the normals or not\n```\nSample usage: `python3 convertall.py ./models ./output 200 --normals 1`  where 200 is the sample density.\n\n### TO-DO\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjiangwei221%2Fobj2pcd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjiangwei221%2Fobj2pcd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjiangwei221%2Fobj2pcd/lists"}