Skip to main content

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

uffutils-0.3.1.tar.gz (14.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

uffutils-0.3.1-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file uffutils-0.3.1.tar.gz.

File metadata

  • Download URL: uffutils-0.3.1.tar.gz
  • Upload date:
  • Size: 14.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for uffutils-0.3.1.tar.gz
Algorithm Hash digest
SHA256 029d6e134c930b04ab0610750d277d075a784a24c208c423154074cd3953c338
MD5 054c9e88ea0cca03da945b5b62ce664b
BLAKE2b-256 62010792febc6de5a3ea3e6b11d3b8aadc2448c29a4356e67d5cb960d50bdaee

See more details on using hashes here.

Provenance

The following attestation bundles were made for uffutils-0.3.1.tar.gz:

Publisher: python-publish.yml on janheindejong/uffutils

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uffutils-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: uffutils-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for uffutils-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 801dc69b070102604e38ba58a9f5369018c751fb353a9a0f7a5be0f5bf041e90
MD5 4134caaf874acb3161369ea9d8ce87bc
BLAKE2b-256 19388d1f900a9ce7f9d99949a40f412f8c127f05248523e0a55806b21a9ca4f8

See more details on using hashes here.

Provenance

The following attestation bundles were made for uffutils-0.3.1-py3-none-any.whl:

Publisher: python-publish.yml on janheindejong/uffutils

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page