Closed jo-chemla closed 2 months ago
@jo-chemla This sounds like a good addition! Would you be up for making a PR? The bindings for the 'optimize' command are defined in packages/cli/src/cli.ts
-
Thanks for the pointer! Just did a PR here: https://github.com/donmccurdy/glTF-Transform/pull/1354
Don't hesitate if anything is missing, I added both simplifyRatio
and simplifyLockBorder
arguments to the gltf-transform optimize
CLI command.
Is your feature request related to a problem? Please describe. Using the
gltf-transform optimize
cli, exposing thesimplifyError
argument is useful to control the simplify operation amount. When using thesimplify
without priorweld
yields to bad simplification results, where ratio is not correctly used - which is expected since the vertices are not weld'ed, which optimize chains under-the-hood.Describe the solution you'd like It could be useful to also expose
simplifyRatio
as a CLI flag to theoptimize
command, so optimize command could be used as a single all-in-one operation to aim for a target simplification amount, constrained or not by error.Describe alternatives you've considered A simple workaround as of today is to either run
gltf-transform weld && gltf-transform simplify
orgltf-transform optimize && gltf-transform simplify
subsequently. Exposing the simplifyRatio to the optimize CLI would just be a nice-to-have.Additional context Reference to the simplify doc: