A set of commandline tools for manipulating UFF files.
Project description
UFF Utils
UFF Utils is a command-line tool for manipulating UFF files. For example:
uffutils modify input.uff output.uff --scale-length 100 --rotate 90,90,90 --translate 100,100,100
Installing
A good way to run UFF utils is through uv. Once you have installed uv, you can run uffutils like so:
uvx uffutils --help
The inspect command
The inspect command allows you to view the contents of a UFF file. Example usage:
uffutils inspect my_file.uff # Print nice overview
uffutils inspect my_file.uff --nodes # Print full list of nodes
The modify command
The modify command allows you to modify a UFF file. For example, you can create a file with a subset of nodes in various ways:
uffutils modify my_file.uff list_of_nodes.uff --node-selection "1, 2, 3"
uffutils modify my_file.uff first_ten_nodes.uff --node-count 10
uffutils modify my_file.uff every_tenth_node.uff --node-step 10
You can scale length:
uffutils modify my_file.uff m_to_mm.uff --scale-length 1000
And do various other operations:
uffutils modify my_file.uff in_global_frame.uff --to-global-frame
uffutils modify my_file.uff rotated_euler_xyz.uff --rotate "90,90,90"
uffutils modify my_file.uff translated_xyz.uff --translate "10,20,30"
And you do all these things at once:
uffutils modify my_file.uff my_output.uff `
--node-selection "1,2,3" `
--scale-length 1000 `
--to-global-frame `
--rotate 90,90,90 `
--translate 100,100,100
Alternative implementation
I considered doing something with piping, but got stuck in the fact the the PyUFF library I'm using can't handle streams. It would've looking something like this:
uffutils subset my_original_file.uff my_subset_file.uff --step 100
uffutils subset my_file.uff - --nodes $(uffutils describe my_subset_file.uff --nodes) |
uffutils scale - my_output.uff --length 1000
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file uffutils-0.3.0.tar.gz.
File metadata
- Download URL: uffutils-0.3.0.tar.gz
- Upload date:
- Size: 14.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2cd5013045b6c3074809c1b8f3898eaffc31fd63ddc938c62ec6c1ad9ef58c18
|
|
| MD5 |
dfe6f86fef22d206b9063eccd66056ed
|
|
| BLAKE2b-256 |
7f8bde1d0a51ec2e1414aeb0a1a45b9ff4c63ee01a0cdcdb7e891075e14ef4ff
|
File details
Details for the file uffutils-0.3.0-py3-none-any.whl.
File metadata
- Download URL: uffutils-0.3.0-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52e1f1ac4d94c66f19e30be2843e1484c039af9c6b4957b8031d37e19300c648
|
|
| MD5 |
72bc8e09c058b467c395321587f38526
|
|
| BLAKE2b-256 |
445e24e633fd43a08174e6d5419669e6b6c26ab38c1787e3ccbe0ec96e68a10e
|