Simplify meshes including vertex features.
Project description
Quadric mesh simplification
A leightweight package for simplifying a mesh containing node features. The algorithm from Surface Simplification Using Quadric Error Metrics was implemented using cython.
Only python versions >= 3.6 are supported
Installation
with pip
$ pip install quad_mesh_simplify
from source if distribution is not supported
Download this repository and build the package by running:
$ pip install -r requirements.txt
$ python setup.py build_ext --inplace
$ pip install .
Usage
This package provides one simple function to reduce a given mesh. This can be done for simple meshes or meshes with vertex features.
simplify_mesh(positions, face, num_nodes, features=None, threshold=0., max_err=np.Infinity)
positions
(numpy array): array of shape [num_nodes x 3] containing the x, y, z position for each node
face
(numpy array): array of shape [num_faces x 3] containing the indices for each triangular face
num_nodes
(int): number of nodes that the final mesh will have
threshold (number, optional): threshold of vertices distance to be a valid pair
features
(numpy array): features for all nodes [num_nodes x feature_length]
threshold
(double): if the distance between two vertices is below this threshold, they are considered as valid pairs that can be merged.
max_err
(double): no vertices are merged that have an error higher than this number. IMPORTANT: if provided it is not guaranteed that the output will have less than num_nodes vertices.
Returns: new_positions, new_face, (new_features)
Reduce a simple mesh
from quad_mesh_simplify import simplify_mesh
new_positions, new_face = simplify_mesh(positions, face, <final_num_nodes>)
Reduce a mesh with vertex features
from quad_mesh_simplify import simplify_mesh
new_positions, new_face = simplify_mesh(positions, face, <final_num_nodes>, features=features)
Reduce a mesh with a threshold for the minimal distance
from quad_mesh_simplify import simplify_mesh
new_positions, new_face = simplify_mesh(positions, face, <final_num_nodes>, threshold=0.5)
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 Distributions
Hashes for quad_mesh_simplify-1.1.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a435d54aa1559d54b9de2bc389d6b7cc6d8c40972b27d9b0cdda7de34cc79ae3 |
|
MD5 | 91b6d71c4d9e8d9ab5f6e5d0a98f2147 |
|
BLAKE2b-256 | 89caabb8a18e7fc41a4292a30c485307a9d858b4cef08d353904d37ed6ace970 |
Hashes for quad_mesh_simplify-1.1.4-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aae51dd381769428d859a599ebc719a7ad61298084ba1ff98ab31cb85d93664f |
|
MD5 | de1a484976439570504024172fb597bf |
|
BLAKE2b-256 | 04ec8374c402454cb69d51063fa2ba8778a7a961840b49356ec8a13cbf6cea5a |
Hashes for quad_mesh_simplify-1.1.4-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51cfe348c9458f2e996ead5a50175f396275482f742201a32e170f5c28347880 |
|
MD5 | b60f53f9f63c69c5776b4ebb32feb84b |
|
BLAKE2b-256 | 709d8d801680f4d067e980ecabf9aa82dabba0562ffc02683fcdddaa5d1da30d |
Hashes for quad_mesh_simplify-1.1.4-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff165fc0f0853d2f3f86ab95eb7b8608dbd4b606370aeb2515f8fd4bdbcdd20a |
|
MD5 | ac46acefdc342bd3c5f29a7363f0426b |
|
BLAKE2b-256 | 64ee780d5b88ec2b9972ed5308e9d90bca165c5a7508fabeaefb8075e04d7193 |
Hashes for quad_mesh_simplify-1.1.4-cp39-cp39-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7234e5d981cfa45d80e32a88a23b3c81d84d2bc154303cbb36e0b22b4e9a1010 |
|
MD5 | 7e79fe3858d9e3d21e7c91ca7ed96c30 |
|
BLAKE2b-256 | 535369084365857c358564c1840f8c59861b764d00d9ef735829aa216c1ab5f4 |
Hashes for quad_mesh_simplify-1.1.4-cp39-cp39-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3fbb8fd2a48a6538a12e3770b4407a2aa5bee71e74d5c39b6b294535a3c7bd9f |
|
MD5 | 7a3b8afce49eaa031611dd1037c0b6ed |
|
BLAKE2b-256 | 0d89494a5c99f56c2657ffbe99dcb036e3134ebf2f2252e6b71a54c87c69ff44 |
Hashes for quad_mesh_simplify-1.1.4-cp39-cp39-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | caa5d556612cfc962b686352b176896d018190c2b79f840edfc4c662e4c18a0d |
|
MD5 | d2141cfaa7dade65cb08078b38d6a6ac |
|
BLAKE2b-256 | c8d529b14617875bc6892ec48c62913f1709bf9b9eb07102e5210cde3f8d3bd1 |
Hashes for quad_mesh_simplify-1.1.4-cp39-cp39-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32d575a95f4e0410a96aff0089ec178a087b9366fd4b8e7ba6e57d07509177d4 |
|
MD5 | 00ec29ec0450a7266558335f026aa44e |
|
BLAKE2b-256 | 2d1a1a287e10220ab1fabc22f7800b079b2e9be71930924f1b4bb304ad915f0e |
Hashes for quad_mesh_simplify-1.1.4-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | afabaa6cf1ce55f3f3d6fec6522fed06cb8b346fb9e8a7cd614f54eaf5298f23 |
|
MD5 | 9b5591f906aca669c56608821bbbbe3d |
|
BLAKE2b-256 | 31e16884c3d8c4c5e577261b72576c2c569ab5bdc6e4470d2ed2cf6770f96ca1 |
Hashes for quad_mesh_simplify-1.1.4-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 613ff107977227f95ac3373e96d1b69b10f60d425cf1ac1013255da3c91a8dd0 |
|
MD5 | 6243d3bd8eded1d77b1db8f3a853b910 |
|
BLAKE2b-256 | 77d7c12e0ac962476c9e4e893afd0ae24e39c76825859b26c8c54ea40f14bd02 |
Hashes for quad_mesh_simplify-1.1.4-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57d64c907976a10923ed8291b7bc13f18505843348ed7b2ac42db332d26a4d81 |
|
MD5 | 16342513983a726dd3423ccca5c8d248 |
|
BLAKE2b-256 | e2c6f9b7281fdfc4bfe58b1ae2a8801105429affc81322ac3cb1638fdc712039 |
Hashes for quad_mesh_simplify-1.1.4-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fc2171fb9d31cdcdead6702bc6e89eb24b949b088ad5e1c88989dede6e904fb |
|
MD5 | 1d49d5fb40b98068122e6905a6bf4606 |
|
BLAKE2b-256 | a1f38286cee343d483db08295416e96cccbac1390dd344383885b842b2b6cb56 |
Hashes for quad_mesh_simplify-1.1.4-cp38-cp38-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9ddaf094f2bffb71fe8b8eaf2a9818541de72ee511b6274e4f902e29f88ec61 |
|
MD5 | 913b9a6a7aabc06a129aa1e86e34393c |
|
BLAKE2b-256 | 4617e50e2a432010f90dc2cf1c633af56a5facb094ab40f8bc0c3a1a8df4b354 |
Hashes for quad_mesh_simplify-1.1.4-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39c3409a6d9c479fd7fb2032c22e0209aa51c5f87e561e34096744f0fedc67f1 |
|
MD5 | 9875de636ef4cb9d7e84cafd5ed1d63b |
|
BLAKE2b-256 | cafab9cb0d531e2b9d43a174a56c7a56d40610327ffb489e6d61a645c4c7e41e |
Hashes for quad_mesh_simplify-1.1.4-cp38-cp38-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25db8d6c251526af25cd7c90659cc33d1a87f098c0a3ccee45dbb45164479fdc |
|
MD5 | 3eb79264ef72817eb0495dd194b5a56f |
|
BLAKE2b-256 | 36bf82e73fd3f7ea0709fa02169fcae39814e721465dd5dc88870340b4ab6974 |
Hashes for quad_mesh_simplify-1.1.4-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 017a025ed059a0155802e14c7ae3936388822743a1a92e0cd4d37cb3b6ad3922 |
|
MD5 | 3957a43a9d071f2211b2cd637f6489ab |
|
BLAKE2b-256 | 7f6326444c1a0a6cc06434c142f7442139758ff3c70b928e5b60b0da1d53fbf6 |
Hashes for quad_mesh_simplify-1.1.4-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd79220ecce6bcab2e2b99f9e5b3c64c51fcffc6625e0eac349c13c162ff988b |
|
MD5 | 6161d5e30e2fb63684efbf496c4221c4 |
|
BLAKE2b-256 | ba63f75399c08d0e6743289a5fa0c7792817eaaf2445c5528757fecc83ed4a43 |
Hashes for quad_mesh_simplify-1.1.4-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c752b42c1e57059a77f043430ae73d14d53f2e365fef7476ec837de2ff606ff3 |
|
MD5 | 60cba44d9cba5c2211c938d79513ebda |
|
BLAKE2b-256 | 54bcf1114beba85885d266b583221a939bf97c09c3c4ef0e20856acf5ee2e727 |
Hashes for quad_mesh_simplify-1.1.4-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9811f46d50463626df41d3dc3014114ae1e0174975fec58814243933b0c3b30f |
|
MD5 | b1e717b1bc6aff1ce01512f710ece729 |
|
BLAKE2b-256 | f62537c24d9ac2adcc24afb7c01753cc528aaf5945beb9ebfbb7a374ab62de7c |
Hashes for quad_mesh_simplify-1.1.4-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8a62ce84dd0d34e59332f63c0c0768f66a3de432c00f6a75709cf161ad45ab0 |
|
MD5 | 694474d2fbc581c71bd026bc260cf18c |
|
BLAKE2b-256 | 404e4e5ee51a49ec07e2e313d53308278b179861eaa31290d1a715a5d24cb9bd |
Hashes for quad_mesh_simplify-1.1.4-cp37-cp37m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25da6d894ddbfd77fb459ef5e24138f1922022f8895f6ac103fd10e65335ff6e |
|
MD5 | a584e8ca810a816cedbcef585f355aa4 |
|
BLAKE2b-256 | 69780c02936c7eab4002faab193a011821398d6e49bca8d704941c84290459a0 |
Hashes for quad_mesh_simplify-1.1.4-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a5296187627bfdf41ae27dc50614312c756b73ac04c7397f8226c655ece330b |
|
MD5 | 40f23d43518199416df52159ee91b75b |
|
BLAKE2b-256 | ccf9f50a1c2f010bf06b10fb81239087a8592caa48cb47603ef77174e517a5f7 |
Hashes for quad_mesh_simplify-1.1.4-cp37-cp37m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f84a252620a646e5b9e010f5fc8fb4f8ac66358ad6d9c7d23409127cdb115e60 |
|
MD5 | 701e977c86196aa552afbb84225f3cae |
|
BLAKE2b-256 | 19c62a9686d60db1f5b00a2daa14f7edf5ec6446f52a12e75dc4adc198a19839 |
Hashes for quad_mesh_simplify-1.1.4-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c2415fee40b0153a5199ddccb4be38d042b735be7fb63cda592c83ae5f107cf |
|
MD5 | 90c995f3035ff6b0303d8114117782d7 |
|
BLAKE2b-256 | ce790e494fc20b8009f8f94c1163abf53ed0b81bdf0fa583b8e165fc2e12b3d9 |
Hashes for quad_mesh_simplify-1.1.4-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28e30295e8557140f15a16d56443361455007fad99dce4e99cd4c27a30d0e65a |
|
MD5 | 4a30c134d03198e01172abf6306d3625 |
|
BLAKE2b-256 | 1cd10cba0580da7b3331a8dae813729dc261d35f54ff520a1577572ad2d2e418 |
Hashes for quad_mesh_simplify-1.1.4-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d62c050f2a8159dac1e9c0fb7430d6e884d2f483e2aaa355b06486ede0d82d2 |
|
MD5 | f1e5c8b9c7fa88db08e5c7e610009877 |
|
BLAKE2b-256 | c9c85331aa3d42c6f0a13e8d4a27be8ca4013586b011863fb1e022409976e70b |
Hashes for quad_mesh_simplify-1.1.4-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 697ff9a026ecda8af68028774d4b145d58379f1175eb2d54afce0f9b62ca0ba2 |
|
MD5 | 95143d5bb547dd9536c1a64bd32b0753 |
|
BLAKE2b-256 | ed3c8bc4acb46a8d32d2b77d3d160fc9f36904d9910bf9e218e08b5c5f62b109 |
Hashes for quad_mesh_simplify-1.1.4-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75cf93571bc311a5d47eb1e58b392177d4a339993120075638b29df6cff713f4 |
|
MD5 | 099266a70750d62c0bb9f3cc7e1325d6 |
|
BLAKE2b-256 | ac5dd78a8173686dba1a29378fa607bde1e06882a8c155ccaf5061b5a6cd5704 |
Hashes for quad_mesh_simplify-1.1.4-cp36-cp36m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a05415353a3f0418e82257bb3629ea4f6411f68c80e9d2dd9ec7665d2d7407f4 |
|
MD5 | 6a595ab1267f420243fedebe4d74badc |
|
BLAKE2b-256 | 23bc18dcb90682961abeb5f95cb883081f2d0dfb42b23bc2e3e53c398dea3df7 |
Hashes for quad_mesh_simplify-1.1.4-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 643df078fa00deade41926ab2c28c57051a85985504d231dac1a2c4391d8812f |
|
MD5 | 9a89596c148c0d673e9287aa3a9c493b |
|
BLAKE2b-256 | 932b9b9fcc71507288f05861a9049de4b9f132390f6b85466c233492493d1d8e |
Hashes for quad_mesh_simplify-1.1.4-cp36-cp36m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 684bbb03aee7896191d3f04d96ca74da8d0ee7297a3cb3f85698b10db855a842 |
|
MD5 | d2ed9e55b476d858dc1d894f79063a08 |
|
BLAKE2b-256 | de32a9d0dad06b059f6fae280bab67c269fc00c6aabb2412456378631554a30d |
Hashes for quad_mesh_simplify-1.1.4-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02dda4cb430ace20d86ac117e0e72bdcb380a07757595d7870e70c0cd72caf7d |
|
MD5 | 493318052a6fb6f5aaa39b2ae4c933ba |
|
BLAKE2b-256 | ec81479cb15f774f65646e59c6ddb50f7170aeb1aa3f054c36985436c347db75 |