Skip to main content

A set of commandline tools for manipulating UFF files.

Project description

UFF Utils

This library contains a set of pipeline tools for manipulating UFF files. It works a bit like this:

uffutils modify my_original_file.uff my_subset_file.uff --node-step 100 --node-count 1000
$nodes = $(uffutils inspect my_subset_file.uff --nodes-only)
uffutils modify my_file.uff my_output.uff `
    --node-selection $nodes `
    --scale-length 1000 `
    --to-global-frame `
    --rotate 90,90,90 `
    --translate 100,100,100

Installing

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.2.0.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.2.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: uffutils-0.2.0.tar.gz
  • Upload date:
  • Size: 14.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.21

File hashes

Hashes for uffutils-0.2.0.tar.gz
Algorithm Hash digest
SHA256 1110a1dba209db577bab88efac29bf74e56628aafea782a2ba89d0cd9cd92f35
MD5 3b3e1a8fb5cc33daf8b9c4316d72e2e9
BLAKE2b-256 c600566d1b2dcad843f91495f2d7f71c35fb9091049cc65f6d56a13e46ef723b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uffutils-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.21

File hashes

Hashes for uffutils-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ed5e66f5d04d87bcdfd96b0700e139d4714fad420af73288f09534ff7fd96078
MD5 1590ac0a9591c2220d19abea8b49dd01
BLAKE2b-256 e450265e0242bd387df6e7050fa99a074c2b05592a24c1336b725fbff7864e06

See more details on using hashes here.

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