Danesfield icon indicating copy to clipboard operation
Danesfield copied to clipboard

how to generate exactly meshes as 3D tileset from OBJ file

Open rev-yuji opened this issue 8 months ago • 4 comments

Hi,

I see that this repository can generate 3D Tilesets without relying on Cesium’s conversion tools.

I tested it with an OBJ mesh produced by COLMAP, together with its MTL and texture files. Inside the kitware/danesfield Docker container, after activating the Python environment, I ran:

python danesfield/tools/tiler.py /mnt/input_glb/model_dec_nr.obj
-o /mnt/output_tiles/model_dec_nr_tileset
--content_gltf
--translation 0 0 0
--utm_zone 1
--utm_hemisphere N
--input_type 1
-t 500000

The command finishes successfully, but the resulting GLB appears to contain only points rather than a textured mesh (verified in the Three.js editor—see screenshot).

Image

Could you advise how to preserve the mesh geometry and its materials in each tile?

rev-yuji avatar May 08 '25 16:05 rev-yuji

btw when I ran --input_type 0, will show the error

(499 ms) ERROR:invalid literal for int() with base 10: ''
Traceback (most recent call last):
  File "danesfield/tools/tiler.py", line 739, in <module>
    main(sys.argv[1:])
  File "danesfield/tools/tiler.py", line 691, in main
    args.property_texture_png_index, args.property_texture_tiff_directory, args.quantization_percentile)
  File "danesfield/tools/tiler.py", line 532, in tiler
    quantization_percentile)
  File "danesfield/tools/tiler.py", line 262, in read_buildings_obj
    files.sort(key=lambda f: int(re.sub('\\D', '', f)))
  File "danesfield/tools/tiler.py", line 262, in <lambda>
    files.sort(key=lambda f: int(re.sub('\\D', '', f)))
ValueError: invalid literal for int() with base 10: ''```

rev-yuji avatar May 08 '25 16:05 rev-yuji

hi, I noticed my understanding is a little wrong for using the execution. my file that big obj mesh file don't have any number in file name. I renamed it then passed to execute.

however, it generated 1 glb file only....

currently tiler.py with OBJ mesh will not process mesh decimation(for making multiple LOD) and mesh division(for making split 3d tile files)?

rev-yuji avatar May 11 '25 07:05 rev-yuji

We currently do not handle mesh decimation or multiple LODs.

Here is a shell script we used for testing that may clarify how to pass the command line parameters. https://github.com/Kitware/Danesfield/blob/master/tools/tiler-test.sh

danlipsa avatar May 12 '25 14:05 danlipsa

In this blog, we have an example with data: https://www.kitware.com/3d-tiles-generation-using-vtk/

danlipsa avatar May 12 '25 18:05 danlipsa