Unknown argument: convertB3dmToGlb error while executing 3d-tiles-tools
yadunandan6176 opened this issue · 1 comments
Hi I'm trying to convert B3dm file to glb using 3d-tiles-tools.
I tried using the convertB3dmToGlb command as I wanted to convert the batch table information to feature table, I used the following command:
npx 3d-tiles-tools convertB3dmToGlb -i ./data/example.b3dm -o ./data/example.glb
But when I execute the above command it throws the following error:
Usage: npx 3d-tiles-tools <command> [options]
Commands:
convert Convert between tilesets and tileset package formats. The
input and output can be paths to tileset JSON files,
'.3tz', or '.3dtiles' files.
glbToB3dm Repackage the input glb as a b3dm with a basic header.
glbToI3dm Repackage the input glb as a i3dm with a basic header.
b3dmToGlb Extract the binary glTF asset from the input b3dm.
i3dmToGlb Extract the binary glTF asset from the input i3dm.
cmptToGlb Extract the binary glTF assets from the input cmpt.
optimizeB3dm Pass the input b3dm through gltf-pipeline. To pass options
to gltf-pipeline, place them after --options. (--options -h
for gltf-pipeline help)
optimizeI3dm Pass the input i3dm through gltf-pipeline. To pass options
to gltf-pipeline, place them after --options. (--options -h
for gltf-pipeline help)
gzip Gzips the input tileset directory.
ungzip Ungzips the input tileset directory.
combine Combines all external tilesets into a single tileset.json
file.
merge Merge any number of tilesets together into a single
tileset.
upgrade Upgrades the input tileset to the latest version of the 3D
Tiles spec. Embedded glTF models will be upgraded to glTF
2.0.
pipeline Execute a pipeline that is provided as a JSON file
analyze Analyze the input file, and write the results to the output
directory. This will accept B3DM, I3DM, PNTS, CMPT, and GLB
files (both for glTF 1.0 and for glTF 2.0), and write files
into the output directory that contain the feature table,
batch table, layout information, the GLB, and the JSON of
the GLB
tilesetToDatabase Create a sqlite database for a tileset. (Deprecated - use
'convert' instead)
databaseToTileset Unpack a tileset database to a tileset folder. (Deprecated
- use 'convert' instead)
Options:
--version Show version number [boolean]
-h, --help Show help [boolean]
-f, --force Output can be overwritten if it already exists.
[boolean] [default: false]
Unknown arguments: i, o, convertB3dmToGlb
As per the help convertB3dmToGlb is not listed in options but it is listed in readme file. May I know know to use this functionality.
(Sorry for the delay here)
First, a minor comment: You said that you are using the command
npx 3d-tiles-tools ...
and I see that this is also written as the "Usage: ..."
part of the output, but this is not the right thing to print - that help message will have to be updated to match the information from the README
Beyond that, the details depend on whether you installed the 3D Tiles Tools, or whether you cloned the repository.
When you installed the 3D Tiles tools:
If you installed the 3D Tiles Tools with npm install -g 3d-tiles-tools
, then you might want to type
3d-tiles-tools --version
at the command line. It should print 0.3.2
(which is currently the latest version)
If it does not print 0.3.2
, then it means that you have an older verison of the 3D Tiles Tools installed. You should run
npm update -g 3d-tiles-tools
Afterwards, you can run
3d-tiles-tools --version
again to confirum that you have the latest version.
The latest version should offer the convertB3dmToGlb
command.
When you cloned the repository
Running npx 3d-tiles-tools...
will by default run any version of the 3D Tiles Tools that are installed globally. And (similar to the point above), you can run
3d-tiles-tools --version
to see whether there is a potentially older version of the tools installed.
In oder to directly execute the code of the cloned repository, you have to write
npx ts-node ./src/main.ts convertB3dmToGlb ...
(This is mentioned briefly in the Developer Setup section of the README. The point here is that npx ts-node...
has to be used to "directly execute the .ts
file from the repo", so to speak...)
In any case, I'll leave this issue open as a reminder that
- Some of this could be mentioned more explicitly in the README (for example, the
npm update...
call) - The help message has to be changed to not say
npx 3d-tiles-tools...
, but only3d-tiles-tools...