cython wrapper around C++ library for fast triangular mesh reduction
Project description
Cython wrapper around sp4acerat’s quadrics mesh reduction algorithm.
Requirements:
Numpy
Cython (only for compilation, but not needed if installed from PyPI)
Installation :
pyfqmr can be installed via pip :
pip install pyfqmr
Compilation :
Run:
python setup.py install
Usage:
>>> #We assume you have a numpy based mesh processing software
>>> #Where you can get the vertices and faces of the mesh as numpy arrays.
>>> #For example Trimesh or meshio
>>> import pyfqmr
>>> import trimesh as tr
>>> bunny = tr.load_mesh('example/Stanford_Bunny_sample.stl')
>>> #Simplify object
>>> mesh_simplifier = pyfqmr.Simplify()
>>> mesh_simplifier.setMesh(bunny.vertices, bunny.faces)
>>> mesh_simplifier.simplify_mesh(target_count = 1000, aggressiveness=7, preserve_border=True, verbose=10)
iteration 0 - triangles 112402 threshold 2.187e-06
iteration 5 - triangles 62674 threshold 0.00209715
iteration 10 - triangles 21518 threshold 0.0627485
iteration 15 - triangles 9086 threshold 0.61222
iteration 20 - triangles 4692 threshold 3.40483
iteration 25 - triangles 2796 threshold 13.4929
iteration 30 - triangles 1812 threshold 42.6184
iteration 35 - triangles 1262 threshold 114.416
simplified mesh in 0.2518 seconds
>>> vertices, faces, normals = mesh_simplifier.getMesh()
Controlling the reduction algorithm
Parameters of the ‘’’simplify_mesh’’’ method that can be tuned.
- target_count
Target number of triangles.
- update_rate
Number of iterations between each update.
- max_iterations
Maximal number of iterations
- aggressiveness
Parameter controlling the growth rate of the threshold at each iteration when lossless is False.
- preserve_border
Flag for preserving the vertices situated on open borders. Applies the method described in this issue.
- alpha
Parameter for controlling the threshold growth. Exact implication described below.
- K
Parameter for controlling the threshold growth. Exact implication described below.
- lossless
Flag for using the lossless simplification method. Sets the update rate to 1 .
- threshold_lossless
Maximal error after which a vertex is not deleted, only when the lossless flag is set to True.
- verbose
Controls verbosity
Implications of the parameters of the threshold growth rate (when not in lossless mode) :
$$threshold = alpha * (iteration + K)^{agressiveness}$$
More information is to be found on Sp4cerat’s repository : Fast-Quadric-Mesh-Simplification
Huge thanks to Sp4cerat for making his code available!
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for pyfqmr-0.2.1-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad67ba1279d26d05ed0c434b1ecc3d0c4bf7d00031204fca333e43a360a237b1 |
|
MD5 | d696aeaae86db6c810e3d2c9e5584ec4 |
|
BLAKE2b-256 | 7c27f00cab1778df5ca685a56722e9954c0090b204afc24476922ddf1d0cfe3d |
Hashes for pyfqmr-0.2.1-cp312-cp312-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e36daf5c8e7fb7104c22f19bcad7a5d93fe27545f81059dcc982a066733586ad |
|
MD5 | 4dddb45bfadacbef7b7e71b8f1f14b5d |
|
BLAKE2b-256 | 8ba6507c41823c0bc7f093a94be3b85696fdd6158e915a412cf7909fcd351b11 |
Hashes for pyfqmr-0.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97872e9e0f6cde0778f36774d4fd5ca3edf3316a9b9c12717b05b8c4eef12707 |
|
MD5 | 51fcddd9828f5043d79a10de0d433f69 |
|
BLAKE2b-256 | 21f2c894031d60d2e4c9abc0f5b59ffc61354d621869a0ddf4177d21395fd412 |
Hashes for pyfqmr-0.2.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b6719cafcc264010d9bb924716e6926be1a678d2361b6277b7cafa384cacf9c |
|
MD5 | 07fa8fb8b9c41680c035531b69ed614e |
|
BLAKE2b-256 | 1f631e739f255feeb14761d939101f2d8f9a051795a29b4ab42bfae229caef30 |
Hashes for pyfqmr-0.2.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b48b33f89ed9f470974cd56f38cd383de187d9bdd3c82e6b1e52b0661e66403 |
|
MD5 | 5822cd192fbb3f11eedcf90bdcbd3171 |
|
BLAKE2b-256 | 32d9389cd01af29bb2905ee0644302465931ac705ec574ffa5963937337c9972 |
Hashes for pyfqmr-0.2.1-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f5657960c4f8fa4554ac23b495062e6122580298e62e45e24e1be43f5a26c71 |
|
MD5 | 57d7dc22b28fb0b74a6b6a0b50fe6d83 |
|
BLAKE2b-256 | cc4fa75723e8fd81448418b2cae1fa76dfd92d98f41aa69f7d419aedccff466e |
Hashes for pyfqmr-0.2.1-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f10084165570d4b934fb260c8e3e76a20c93b52e77ad786ef6b0f61626a419c |
|
MD5 | a415c52b65c9cccc74f9d0d1e62155a9 |
|
BLAKE2b-256 | 4067ee26ced5f383611a712fc41b4773f017d3e1aa8cef0f7df0df6ab46b1c7a |
Hashes for pyfqmr-0.2.1-cp311-cp311-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 910e6ca0aeb8531e398e72acb3f9389cf267e0e991f550dfed165f0e776017ee |
|
MD5 | 98a2e77a535557ae4104030b1cf7eb21 |
|
BLAKE2b-256 | eee1aa53b0f11d707f1425d518951ac3cee1a8f8a2e9658f286b3f7f8e4d8fb7 |
Hashes for pyfqmr-0.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b91f42ea59fdd274ebfd86415059f67ceb74cbc3d1d103f59a4c2795ddc0212a |
|
MD5 | 8493df70d0f5ccaabc9bc763677208bc |
|
BLAKE2b-256 | 920d8ac80018eb445e9397332ce6d394499529d13675a43882d5dbdeb367d587 |
Hashes for pyfqmr-0.2.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 645007b5bd2ce9387a7070f82b66b47dae20ab0fe4745c33e406a033402cb54c |
|
MD5 | f75ff44103bcf10ebd0cd1a024863e91 |
|
BLAKE2b-256 | 83ace8c878bb8962c74866d2ab087af4f2c6062fca44fb7f63af3f368270cf03 |
Hashes for pyfqmr-0.2.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eeea2b472215fea64b7f3bb2f0087c1ce32f6b551b334983452fa999ef70b4ba |
|
MD5 | 6807183e05261983baf4e2e585215fbd |
|
BLAKE2b-256 | 0c105ed1984da3a87f68e02e018e6f195263145582171d006810988bc07b400d |
Hashes for pyfqmr-0.2.1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09e9f38d4ab8cb9871915ff52c2d04ae27f46025fe2000f4d87c394617d7cbba |
|
MD5 | b74bcc85cd26b15992ebb8370b533b48 |
|
BLAKE2b-256 | a3f6b185e6d905d27f5875c6027feeab4b8453f151e866af25311dfb238fb450 |
Hashes for pyfqmr-0.2.1-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbfd4f99dde211f18d18cc3ea803a4804b9d86eb1c6167b61809fb087b68d171 |
|
MD5 | c030223f50ada77a9376e02acb02eb3e |
|
BLAKE2b-256 | 7c780a14276bd4efe17cca3b1a7856854c667cb2d2572a529ff9cf906b549368 |
Hashes for pyfqmr-0.2.1-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e213154d4086359e4bdb2540ed86568fa08f8abe12172257cbf27252ba8f8e69 |
|
MD5 | 263aabe256f00b29a987d1cce4be2aac |
|
BLAKE2b-256 | e7c15b62991f964d98761f9ea72f98393b7bb307593c63a7e77070995801e40f |
Hashes for pyfqmr-0.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | efc8ba0cbe99da1fbb51f4ccb4f101a7a684411f7a8629d9129c2a8be2cafc23 |
|
MD5 | 5f98a044b4dee8d99dbe596f1cca258a |
|
BLAKE2b-256 | 12891f9e445745554de45b0a4be974ccb12ac60960896c83df8e02ff57b5e609 |
Hashes for pyfqmr-0.2.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04963071e05109703005bae647512c37a011587067b0105451d7dd4d2307fdaf |
|
MD5 | 65d1e76b12dc30bd866065528d4da8e3 |
|
BLAKE2b-256 | 0ab3490733dbe5c026a1520da43a7af685b8481a00510fb5ed4e74454c51ef4e |
Hashes for pyfqmr-0.2.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6beabedc500adffe4498defcccdf9e2e86f8a874ba96403cb573a6404302ace |
|
MD5 | fb5b54c4fa63ddf02c0ac83066b38275 |
|
BLAKE2b-256 | f2efaa5a3f797408c60a6d20d3daa2c43ebbd39abefc6ccad27f8b62da2ef143 |
Hashes for pyfqmr-0.2.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 215b1f12fc840097dc984bbfa76c9d4251030ec874b1e41a591c5e23b0c8846a |
|
MD5 | 0c1b2cdd17396e95839d1fd83465f282 |
|
BLAKE2b-256 | 305fe43495b870cf3973d0ffa53a93fb98eba7d5eeaf86e86d99e53659d6c9f1 |
Hashes for pyfqmr-0.2.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e13854548a99669fc5569cb3842d11472a47463be48c16ef0600c1f021c7804a |
|
MD5 | ebde586dc2fe3054a1298cf6bca2e1a8 |
|
BLAKE2b-256 | 3828ff0d0de9d65d18d45b8d669a6c16f75ad87b41ccca7ee9aaa88f6a56324a |
Hashes for pyfqmr-0.2.1-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 634621b400e850fa656b948e2dd738e989d51528ad07fc59dae9386e57adf9bd |
|
MD5 | d7385e322978b7b716df7e79ad1867e9 |
|
BLAKE2b-256 | 0563e2674078735eb0ae0eb442a4255c0415300f8c90fa0a9f5968a8f0abbfc2 |
Hashes for pyfqmr-0.2.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | adee07d15755ad4c145cf80598cc7129a857b18b879191e3fbd3e25d55278632 |
|
MD5 | efd63030318f4c77d476bff2103ec6d4 |
|
BLAKE2b-256 | 7e5a8d66de3f3b85db4564f7cc780c6d0ea24bc2c1f8a402f468b8d3bdc39b1d |
Hashes for pyfqmr-0.2.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2dab6a53ff239b39ca4a078acc2b51733f586d6a2281ad5ee4bece0caa1a409a |
|
MD5 | 1b8fad4ec3c9774d3c1e76cba7b2ee9a |
|
BLAKE2b-256 | 9bf3080bff0e1d6710c028ae36fd0e359c94fecb5245f902008ad045742ffc8c |
Hashes for pyfqmr-0.2.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d0c7e8944bbfd8c3168d52156b76ae40c3336ffc85e0e2d25099d5507b2c87c |
|
MD5 | 480357a1c2060fd831c5653d162597d2 |
|
BLAKE2b-256 | 3200ba586c5e528c9ecabdc021e75faa17f4a73e3445b8da3184d2da35509662 |
Hashes for pyfqmr-0.2.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 329aa99a383db99898eebcce4e538f048b7f1b7125176fd912fdf3facbe8b21d |
|
MD5 | 7b5802b88ce4a1fc333dc116cd9200e8 |
|
BLAKE2b-256 | 7a70e76a4b4169bc1ccf290714db4a0ac3f372709f916463de5da43685c79399 |
Hashes for pyfqmr-0.2.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24c786d39355817db16d5e33ea72eb7e4fdeb6a45ae8f3c05477efe0c106962c |
|
MD5 | 0257728588fdd8264fed4275eb3eb2a3 |
|
BLAKE2b-256 | e0ff69a65eae6db11b6e1030cdd7aaee458d8c7a627449cd92032506859a1e5c |
Hashes for pyfqmr-0.2.1-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5013b858683b5709ba7ccb552b14d43462b88be921f4d3c48e5a0747fab49e5c |
|
MD5 | 55894bde471e103c991335e45bbf5159 |
|
BLAKE2b-256 | 06fd95d80ed6454375b4016be1c1c98eb0fd3af949513329622858dee1f4d04d |
Hashes for pyfqmr-0.2.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8930b0580aac3ec68fcbe4562b29962552cfe46e189ea11f857922ca9f8ee4cf |
|
MD5 | 61c5ba6ecc9059e748178662683bac4b |
|
BLAKE2b-256 | feb3fdb206b5aae9286eb3fae0ff8536571d27d9dfc4eb044902599a2ff42c13 |
Hashes for pyfqmr-0.2.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f136f4634ff46f2475ad4ef33cf948481c4ef95b39119dcb26f6958c32bb8deb |
|
MD5 | 5b390b21ad7dd3996345f7b52bcd4428 |
|
BLAKE2b-256 | 0443b6af370fb75f96f30fd215d16947ed03d1b6d24a4cd2af056cda310761e8 |
Hashes for pyfqmr-0.2.1-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d869530fab4b8204d86132f023c0efeefffd9bdd6002a02cf62e46be832c963 |
|
MD5 | 0674e6061183161bdf6198cd3e207103 |
|
BLAKE2b-256 | ab4bdceaaf2d4912680377619dcf31bd4601baa303d7ad93f8bd66edf1faf09d |
Hashes for pyfqmr-0.2.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b2bfb6afdb8d5de09dc1c9804f5eaca2621ddb80853cae9d814ec38aa88bdbc |
|
MD5 | acd33a09476811facceba151ec4bd4b4 |
|
BLAKE2b-256 | 61189c6c90f15569b5fb2bbbcd57cd1d323c390cb5a219291d6a094bf7c98db4 |
Hashes for pyfqmr-0.2.1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8fabf879b7391a916c63349dfbdcf1b41176276d299f491c9b861072938f0653 |
|
MD5 | 9debdeb0752eff7c3c18137d07192171 |
|
BLAKE2b-256 | 39bf30385964d3a503ccf36d3a9bc94f688a2b4c445f0d949b527300fc534399 |
Hashes for pyfqmr-0.2.1-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37abbd0745747016bc90d994415035d18b27b967d2ef1d9cfbaa28aa3d70c4d6 |
|
MD5 | 2ffdd64023c325439ed106f7fa856132 |
|
BLAKE2b-256 | b81d309d0838c48bf6592585523abf35b109cb84b1358bcefed6b4131343f387 |
Hashes for pyfqmr-0.2.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a59c80fba956ea968e472d63a892638ea58419848876cb0dc02aed47abd9345d |
|
MD5 | a545d0348e485603ef96e203f53f62fd |
|
BLAKE2b-256 | 3d139ad9ef98225fcc181f031503b166878ce03abe5902d9bb540168c5edbea3 |
Hashes for pyfqmr-0.2.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea6d26e1c79cd2333aff1ba85dd3c1434ed79a054ca35356faf2c1aed6173e46 |
|
MD5 | bde4e5541c8c0c690e34f8afb31152f7 |
|
BLAKE2b-256 | b61a7eff8945a5c83beada1185bb2f83b671f7aa4836b9afb329794d670857ef |
Hashes for pyfqmr-0.2.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13a01c89dd9c1e34cfe198b6be67007f1ef293b7e02e7de9110c983607658692 |
|
MD5 | 244b69ef68d22c63007ce65ff20ed21f |
|
BLAKE2b-256 | 5467150d213aa6011829664984990dce79ee048835ecdbc4162185116dd19b0c |