{"id":13678828,"url":"https://github.com/OpenDroneMap/Obj2Tiles","last_synced_at":"2025-04-29T15:33:14.570Z","repository":{"id":45265832,"uuid":"485743890","full_name":"OpenDroneMap/Obj2Tiles","owner":"OpenDroneMap","description":"Converts OBJ files to OGC 3D tiles by performing splitting, decimation and conversion","archived":false,"fork":false,"pushed_at":"2024-02-22T09:52:22.000Z","size":48721,"stargazers_count":221,"open_issues_count":42,"forks_count":64,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-10-29T22:45:21.963Z","etag":null,"topics":["3d-tiles","3dtiles","cesiumjs","generator","mesh","model"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OpenDroneMap.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-04-26T10:47:13.000Z","updated_at":"2024-10-25T20:19:45.000Z","dependencies_parsed_at":"2024-04-09T19:36:44.987Z","dependency_job_id":"ba1e64f2-ba1e-4bf4-84f9-5d9188fdff1b","html_url":"https://github.com/OpenDroneMap/Obj2Tiles","commit_stats":{"total_commits":153,"total_committers":7,"mean_commits":"21.857142857142858","dds":0.261437908496732,"last_synced_commit":"1909c8fd00fde3956da42de4495426813d9fcb2c"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenDroneMap%2FObj2Tiles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenDroneMap%2FObj2Tiles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenDroneMap%2FObj2Tiles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenDroneMap%2FObj2Tiles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenDroneMap","download_url":"https://codeload.github.com/OpenDroneMap/Obj2Tiles/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224041781,"owners_count":17245946,"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":["3d-tiles","3dtiles","cesiumjs","generator","mesh","model"],"created_at":"2024-08-02T13:00:58.807Z","updated_at":"2024-11-11T21:31:31.752Z","avatar_url":"https://github.com/OpenDroneMap.png","language":"C#","funding_links":[],"categories":["Tile creation (Community)"],"sub_categories":[],"readme":"\n# Obj2Tiles - Converts OBJ file to 3D Tiles format\n\n![license](https://img.shields.io/github/license/HeDo88TH/Obj2Tiles) \n![commits](https://img.shields.io/github/commit-activity/m/HeDo88TH/Obj2Tiles) \n![languages](https://img.shields.io/github/languages/top/HeDo88TH/Obj2Tiles)\n[![Build \u0026 Test](https://github.com/OpenDroneMap/Obj2Tiles/actions/workflows/build-test.yml/badge.svg)](https://github.com/OpenDroneMap/Obj2Tiles/actions/workflows/build-test.yml)\n[![Publish](https://github.com/OpenDroneMap/Obj2Tiles/actions/workflows/publish.yml/badge.svg)](https://github.com/OpenDroneMap/Obj2Tiles/actions/workflows/publish.yml)\n\nObj2Tiles is a fully fledged tool to convert OBJ files to 3D Tiles format. \nIt creates multiple LODs, splits the mesh and repacks the textures.\n\n## Installation\n\nYou can download precompiled binaries for Windows, Linux and macOS from https://github.com/OpenDroneMap/Obj2Tiles/releases.\n\n## Command line parameters\n\n```\n  Input (pos. 0)         Required. Input OBJ file.\n  Output (pos. 1)        Required. Output folder.\n  \n  -s, --stage            (Default: Tiling) Stage to stop at (Decimation, Splitting, Tiling)\n  \n  -l, --lods             (Default: 3) How many levels of details\n\n  -d, --divisions        (Default: 2) How many tiles divisions\n  -z, --zsplit           (Default: false) Splits along z-axis too\n  -k, --keeptextures     (Default: false) Keeps original textures\n  \n  --lat                  Latitude of the mesh\n  --lon                  Longitude of the mesh\n  --alt                  (Default: 0) Altitude of the mesh (meters)\n  -e, --error            (Default: 100), baseError value for root node\n  --scale                (Default: 1), scale for data if using units other than meters ( 1200.0/3937.0 for survey ft)  \n  \n  --y-up-to-z-up         (Default: false) Converts Y-up to Z-up\n  \n  --use-system-temp      (Default: false) Uses the system temp folder\n  --keep-intermediate    (Default: false) Keeps the intermediate files (do not cleanup)\n      \n  --help                 Display this help screen.\n  --version              Display version information.\n```\n\nThe pipeline is composed of the following steps:\n\n### Decimation\n\nThe source obj is decimated using the `Fast Quadric Mesh Simplification` algorithm (by [Mattias Edlund](https://github.com/Whinarn)). \nThe algorithm was ported from .NET Framework 3.5 to .NET Core 6.0. The original repo is [here](https://github.com/Whinarn/MeshDecimator). \n\nYou can specify how many LODs (levels of detail) you want to generate using the `--lods` parameter. The decimation levels are generated using this formula:\n\n`quality[i] = 1 - ((i + 1) / lods)`\n\nFor example: with 5 LODs the program will use the following quality levels: 80%, 60%, 40%, 20%.\nIf you specify 1 LOD, the decimation will be skipped.\n\n### Splitting\n\nFor every decimated mesh, the program splits it recursively along x, y and z axis (optional using the `--zsplit` flag).\nEvery split is a new mesh with repacked textures (to save space), the [bin pack](https://github.com/juj/RectangleBinPack/) algorithm is by [Jukka Jylänki](https://github.com/juj).\nIf you want to preserve the original textures, use the `--keeptextures` flag (not recommended)\n\nYou can control how many times the split is performed by using the `--divisions` flag. The model will be split into `divisions^2` meshes (or `divisions^3` if `--zsplit` is used).\n\n### 3D Tiles conversion\n\nEach split mesh is converted to B3DM format using [ObjConvert](https://github.com/SilentWave/ObjConvert). \nThen the `tileset.json` is generated using the resulting files. You can specify the `--lat` and `--lon` and `--alt` parameters to set the location of the model.\nSee the [Remarks](#Remarks) section to find out how to rotate the model.\n\n## Running\n\nObj2Tiles is built using [.NET Core 8.0](https://dotnet.microsoft.com/en-us/download/dotnet/8.0). Releases are available on [GitHub](https://github.com/OpenDroneMap/Obj2Tiles/releases) for a multitude of platforms (win / linux / mac).\nYou can download the [latest release](https://github.com/OpenDroneMap/Obj2Tiles/releases/latest) or compile it yourself using the following commands:\n\n```\ngit clone https://github.com/OpenDroneMap/Obj2Tiles.git\ncd Obj2Tiles\ndotnet build -c Release\n```\n\n------------\n\n## Examples\n\nYou can download the test obj file [here](https://github.com/DroneDB/test_data/raw/master/brighton/odm_texturing.zip). \nThe Brighton Beach textured model generated using [OpenDroneMap](https://github.com/OpenDroneMap/ODM).\n\n### Basic usage (using defaults)\n\nIt runs all the pipeline stages and generates the `tileset.json` file in the output folder.\n\n```\nObj2Tiles model.obj ./output\n```\n\n### Decimation\n\nStop the pipeline at the decimation stage and generate 8 LODs\n\n```\nObj2Tiles --stage Decimation --lods 8 model.obj -o ./output\n```\n\n### Splitting\n\nStop the pipeline at the splitting stage and generate 3 divisions per axis\n\n```\nObj2Tiles --stage Splitting --divisions 3 model.obj ./output\n```\n\n### Full pipeline\n\nRun all the pipeline stages and generate the `tileset.json` file in the output folder.\n\n```\nObj2Tiles --lods 8 --divisions 3 --lat 40.689434025350025 --lon -74.0444987716782 --alt 120 model.obj ./output\n```\n\n## Rotating the model\n\nAfter generating `tileset.json`, you can edit the file and change the 4x4 Transform matrix to account for translation, rotation and scaling. This is the matrix structure:\n\n![TransformationMatrix1](https://user-images.githubusercontent.com/7868983/169370131-18575153-4023-4a82-8ffd-3b5e2476dce2.png)\n\nThe tiling stage uses this matrix to place the model in the requested geo location:\n\n![Translation-Matrix1](https://user-images.githubusercontent.com/7868983/169369875-3e337eb2-4168-4b43-b9dc-fef2cf6aecb0.png)\n\nBut you can add scaling:\n\n![Scaling-Matrix1](https://user-images.githubusercontent.com/7868983/169370506-16878adf-ce0c-4ba7-a107-5315693b80d8.png)\n\nOr rotation around any of the 3 axes:\n\n![RotationX-Matrix1](https://user-images.githubusercontent.com/7868983/169370741-9ba79f00-90cf-429a-b5b4-26c8d3d3e355.png)\n\n![RotationY-Matrix1](https://user-images.githubusercontent.com/7868983/169370750-6cb3b744-e2fb-4606-912a-49e4a03905ae.png)\n\n![RotationZ-Matrix1](https://user-images.githubusercontent.com/7868983/169370755-03f016ca-ca8c-461d-a6e9-8643885cd624.png)\n\nBy combining these matrices, you can rotate, scale and translate the model.\n\nYou can find more details about this topic on [BrainVoyager](https://www.brainvoyager.com/bv/doc/UsersGuide/CoordsAndTransforms/SpatialTransformationMatrices.html)\n\n## Remarks\n\nAll the pipeline stages are multi threaded to speed up the process.\nYou can stop the pipeline at any stage by providing the `--stage` flag.\nIf you need to keep the intermediate files, use the `--keep-intermediate` flag.\nYou can use the `--use-system-temp` flag to use the system temp folder instead of the output folder.\n\n## Gallery\n\n![cesium](https://user-images.githubusercontent.com/7868983/170308702-14b32953-c3fd-4eb5-8b86-b40688dc354e.png)\n\n![split-brighton](https://user-images.githubusercontent.com/7868983/169304507-5ccd970d-9fd2-4d09-81a1-e7f701cb913a.png)\n\n![z-split](https://user-images.githubusercontent.com/7868983/169304532-7b46712a-7bb7-4c2e-a799-12df6c227ee9.png)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOpenDroneMap%2FObj2Tiles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FOpenDroneMap%2FObj2Tiles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOpenDroneMap%2FObj2Tiles/lists"}