• Stars
    star
    217
  • Rank 182,446 (Top 4 %)
  • Language
    C#
  • License
    GNU Affero Genera...
  • Created over 2 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Converts OBJ files to OGC 3D tiles by performing splitting, decimation and conversion

Obj2Tiles - Converts OBJ file to 3D Tiles format

license commits languages Build & Test Publish

Obj2Tiles is a fully fledged tool to convert OBJ files to 3D Tiles format. It creates multiple LODs, splits the mesh and repacks the textures.

Installation

You can download precompiled binaries for Windows, Linux and macOS from https://github.com/OpenDroneMap/Obj2Tiles/releases.

Command line parameters


  Input (pos. 0)         Required. Input OBJ file.
  Output (pos. 1)        Required. Output folder.
  
  -s, --stage            (Default: Tiling) Stage to stop at (Decimation, Splitting, Tiling)
  
  -l, --lods             (Default: 3) How many levels of details

  -d, --divisions        (Default: 2) How many tiles divisions
  -z, --zsplit           (Default: false) Splits along z-axis too
  -k, --keeptextures     (Default: false) Keeps original textures
  
  --lat                  Latitude of the mesh
  --lon                  Longitude of the mesh
  --alt                  (Default: 0) Altitude of the mesh (meters)
  
  --use-system-temp      (Default: false) Uses the system temp folder
  --keep-intermediate    (Default: false) Keeps the intermediate files (do not cleanup)
  
  --help                 Display this help screen.
  --version              Display version information.

The pipeline is composed of the following steps:

Decimation

The source obj is decimated using the Fast Quadric Mesh Simplification algorithm (by Mattias Edlund). The algorithm was ported from .NET Framework 3.5 to .NET Core 6.0. The original repo is here.

You can specify how many LODs (levels of detail) you want to generate using the --lods parameter. The decimation levels are generated using this formula:

quality[i] = 1 - ((i + 1) / lods)

For example: with 5 LODs the program will use the following quality levels: 80%, 60%, 40%, 20%. If you specify 1 LOD, the decimation will be skipped.

Splitting

For every decimated mesh, the program splits it recursively along x, y and z axis (optional using the --zsplit flag). Every split is a new mesh with repacked textures (to save space), the bin pack algorithm is by Jukka Jylรคnki. If you want to preserve the original textures, use the --keeptextures flag (not recommended)

You 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).

3D Tiles conversion

Each split mesh is converted to B3DM format using ObjConvert. Then 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. See the Remarks section to find out how to rotate the model.

Running

Obj2Tiles is built using .NET Core 6.0. Releases are available on GitHub for a multitude of platforms (win / linux / mac). You can download the latest release or compile it yourself using the following commands:

git clone https://github.com/OpenDroneMap/Obj2Tiles.git
cd Obj2Tiles
dotnet build -c Release

Examples

You can download the test obj file here. The Brighton Beach textured model generated using OpenDroneMap.

Basic usage (using defaults)

It runs all the pipeline stages and generates the tileset.json file in the output folder.

Obj2Tiles model.obj ./output

Decimation

Stop the pipeline at the decimation stage and generate 8 LODs

Obj2Tiles --stage Decimation --lods 8 model.obj -o ./output

Splitting

Stop the pipeline at the splitting stage and generate 3 divisions per axis

Obj2Tiles --stage Splitting --divisions 3 model.obj ./output

Full pipeline

Run all the pipeline stages and generate the tileset.json file in the output folder.

Obj2Tiles --lods 8 --divisions 3 --lat 40.689434025350025 --lon -74.0444987716782 --alt 120 model.obj ./output

Rotating the model

After 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:

TransformationMatrix1

The tiling stage uses this matrix to place the model in the requested geo location:

Translation-Matrix1

But you can add scaling:

Scaling-Matrix1

Or rotation around any of the 3 axes:

RotationX-Matrix1

RotationY-Matrix1

RotationZ-Matrix1

By combining these matrices, you can rotate, scale and translate the model.

You can find more details about this topic on BrainVoyager

Remarks

All the pipeline stages are multi threaded to speed up the process. You can stop the pipeline at any stage by providing the --stage flag. If you need to keep the intermediate files, use the --keep-intermediate flag. You can use the --use-system-temp flag to use the system temp folder instead of the output folder.

Gallery

cesium

split-brighton

z-split

More Repositories

1

ODM

A command line toolkit to generate maps, point clouds, 3D models and DEMs from drone, balloon or kite images. ๐Ÿ“ท
Python
4,603
star
2

WebODM

User-friendly, commercial-grade software for processing aerial imagery. ๐Ÿ›ฉ
JavaScript
2,662
star
3

FIELDimageR

FIELDimageR: A R package to analyze orthomosaic images from agricultural field trials. This package is a compilation of functions to analyze pos-mosaicking images from research fields, and allows to: crop the image; remove soil effect; build vegetation indices; rotate the image; build the plot shapefile; extract information for each plot; and evaluate stand count, canopy percentage, and plant height.
R
220
star
4

NodeODM

A lightweight REST API to access aerial image processing engines such as ODM or MicMac
JavaScript
193
star
5

ODMdata

Example data for OpenDroneMap: https://OpenDroneMap.org sourced from a variety of sources
134
star
6

PyODM

A Python SDK for adding aerial image processing capabilities to your applications ๐Ÿ”Œ
Python
94
star
7

dem2mesh

Quickly generate 2.5D meshes from elevation models.
C++
84
star
8

NodeMICMAC

A Lightweight REST API to Access MICMAC Photogrammetry and SFM Engine.
JavaScript
83
star
9

ClusterODM

A NodeODM API compatible autoscalable load balancer and task tracker for easy horizontal scaling โ™†
JavaScript
80
star
10

CloudODM

A command line tool to process aerial imagery in the cloud. ๐ŸŒฉ
Go
62
star
11

LiveODM

Live DVD/USB ISO with ODM, node-ODM and WebODM pre-installed.
Shell
49
star
12

pypopsift

Python module for CUDA accelerated SIFT on GPUs
C++
32
star
13

docs

๐ŸŽ‰ Contribute to OpenDroneMap's documentation! Read how below! ๐ŸŽ‰
Python
25
star
14

python-WebODM

Python client for WebODM API
Python
22
star
15

UAVArena

Drone mapping software outputs compared side by side! Which will win? โš”๏ธ
JavaScript
20
star
16

odm_vagrant

Vagrant machine for using OpenDroneMap
19
star
17

posm-gcpi

Ground Control Point interface (GCPi) for OpenDroneMap
JavaScript
15
star
18

dem2points

Extract 3D points from digital elevation models
C++
14
star
19

ODMSemantic3D

An open photogrammetry dataset of classified 3D point clouds for automated semantic segmentation. CC BY-SA 4.0
Shell
12
star
20

odm_orthophoto

ODM Orthophoto Module - Rasterize Textured 3D Models to PNG
C++
10
star
21

SkyRemoval

Create sky masks to improve photogrammetric reconstruction
Python
10
star
22

odm_data_aukerman

10
star
23

FPCFilter

Fast Point Cloud Filtering
C++
10
star
24

odm-benchmarks

Benchmark data index for OpenDroneMap and WebODM
JavaScript
9
star
25

orthorectify

Orthorectify images from ODM reconstruction
C++
9
star
26

awesome-aerial-mapping

Awesome resources for learning about aerial mapping
8
star
27

airsim-generator

Generate synthetic drone photos and elevation models from Microsoft AirSim
Python
8
star
28

odm_data_zoo

7
star
29

presentations

JavaScript
7
star
30

RSCalibration

Docs and scripts to estimate a camera's rolling shutter readout time
HTML
7
star
31

oats

OpenDroneMap Automated Testing Suite
Shell
6
star
32

odm_data_langley

OpenDroneMap Langley dataset
5
star
33

opendronemap-ecs

Serverless API to get opendronemap tasks running on AWS Elastic Container Service (ECS)
JavaScript
5
star
34

WebODM-Locale

Localization files for WebODM
5
star
35

odm-start-deprecated

Tutorial / Startup doc for using OpenDroneMap
4
star
36

odm_data_bellus

4
star
37

odm_data_copr

odm_data copr dataset
3
star
38

odm_data_garfield_msp

3
star
39

odm_data_lewis

Lewis Road Riding Arena Flight
2
star
40

odm_data_caliterra

Submodule of ODM data for Caliterra dataset
2
star
41

odm_data_seneca

OpenDroneMap Seneca dataset
2
star
42

images2geojson

Convert OpenDroneMap's images.json image database to GeoJSON point collections.
JavaScript
2
star
43

odm_data_benchmark

OpenDroneMap benchmark dataset
2
star
44

WestCreekPleasantValley

Stream topography drone flight, taken with GoPro Hero 4 (3.37mm lens) on 3DR Solo
2
star
45

odm_data_helenenschacht

2
star
46

syntheticDSM

Synthetic georeferenced DSM files to verify volume calculation accuracy
2
star
47

wiki-assets

1
star
48

multispectral-docs

Resources for getting started in multispectral processing
1
star
49

opendronemap.github.io

1
star
50

odm_data_apt

Trail (sidewalk) OpenDroneMap test dataset
1
star
51

UAVArena-data

Tilesets for the UAVArena Web Application
1
star
52

WebODM-Plugins-Archive

Plugins waiting for a hero to fix them
JavaScript
1
star
53

odm_data_toledo

1
star
54

documents

The transparent bylaws, policies and rules of OpenDroneMap โš–๏ธ
1
star
55

odm_data_waterbury

1
star
56

odm_data_rv_nir

1
star