Skip to main content

A minimal ply conversion tools

Project description

About ply_convert

ply_convert is a command line tool to manipulae ply meshes 

Developed by Serge Dmitrieff. https://www.biophysics.fr

Installation

Installing with pip3 (recommended)

$ pip3 install ply_convert

Required packages

ply_convert requires Sklearn, Numpy, plyfile, and sio_tools. They will be downloaded when installed with pip3.

Syntax

   ply_convert [INPUT_FILE [INPUT_FILE_2 _3 ... ]] [out=OUTPUT_FILE] [OPTION=VALUE]  [-ADDITIONAL_OPTIONS]

OPTIONS

Options are to be written as opt=value or -option  
Unless mentioned otherwise, options are not applied by default  

Supported options :  
    out=            : name of output file (single file job) // extension of output file (multiple files)  
    scale=          : scale to be applied to points (float or 3x1 vector)  
    length=         : length of object on dimension of maximal variance  
    thickness=      : adds to each point a vector thickness*normal  
    batch=          : apply to all files of a certain type  
    path=           : path in which to look for files for batch operation  
    label=          : label of mesh, added when saving mesh files  
    orientation=    : orientation of normals (+1 : towards outside, -1 : towards inside)  
    prefix=         : add a prefix to output file name (multiple files)  
    suffix=         : add a suffix to output file name (multiple files)  
    -center         : center the data around [0,0,0]  
    -align          : aligns data to dimension x  
    -normals        : computes normals from faces  
    -verbose        : verbose output  
    -fixnorms       : makes sure normals are inwards (equivalent to option orientation=-1)  
    -fixuint        : fixes format to meshlab-friendly  

    batch=          : extension of files to process in batch (support multiple)  
    ** batch only **  
    path=            : folder in which to look for files (support multiple)  
    include=         : string that *must* be included in file name (support multiple)  
    exclude=         : string that *must not* be included in file name (support multiple)  
    -recursive       : searches recursively for files  

EXAMPLES :

            ply_convert file.ply out=file.mesh  

converts a ply file file.ply to a mesh file file.mesh

            ply_convert.py file.mesh normals=1 out=file.ply  

converts a mesh file to a ply file, and computes the normal at each point

            ply_convert file_1.ply file_2.ply file_3.ply out=.mesh  

converts file_1.ply file_2.ply file_3.ply into mesh files

            ply_convert file.ply -center -align -normals length=7 -verbose thickness=0.15 scale='1.0 1.0 2.0'
                                verbose=1 out=thickened.mesh out=thickened.ply  

converts a ply file to a ply and a mesh file after centering, aligning, computing normals, scaling the object to a length of 7, and adding an extra thickness of 0.15, then scaling the z axis with a factor 2

            ply_convert.py batch=.ply path='/home/user/simulations/' out='.ply' scale=0.1 -recursive prefix=scaled_   

Recursively find ply files in '/home/user/simulations/', scales them to a factor of 0.1, and saves them to FOLDER/suffix_NAME.ply with NAME the filename and FOLDER the folder name

            ply_convert.py file.ply out=fixed_file.ply -fixuint  

fixes the header of a mesh file saved by tinyply (C++) so that it doesn't crash with meshlab.

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

ply_convert-0.0.3.tar.gz (26.6 kB view details)

Uploaded Source

Built Distribution

ply_convert-0.0.3-py3-none-any.whl (42.7 kB view details)

Uploaded Python 3

File details

Details for the file ply_convert-0.0.3.tar.gz.

File metadata

  • Download URL: ply_convert-0.0.3.tar.gz
  • Upload date:
  • Size: 26.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.9

File hashes

Hashes for ply_convert-0.0.3.tar.gz
Algorithm Hash digest
SHA256 eb53bb827e2fc2a8f8de401169ed2e2f2d43a6cd71328ba7df52e971d04c5b13
MD5 0687275604b079e985d242b516412b6a
BLAKE2b-256 31ae724662e82fd1b268ecca812d4abce420ab0aff243ed60e0ea90ff92e049e

See more details on using hashes here.

File details

Details for the file ply_convert-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: ply_convert-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 42.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.9

File hashes

Hashes for ply_convert-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 11450ac4860100a8f6f4f23b4d2d4a587067f2a3a635ebb46b2d75d13fd35e1a
MD5 8cbedfe35d6ff30c6682b491d70c92c0
BLAKE2b-256 8467babf1eaac432b2cdc0500c07f6d28870b1df1c2b1823a5ff3b6cbffcb470

See more details on using hashes here.

Supported by

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