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 Distributions
Built Distributions
Hashes for quad_mesh_simplify-1.1.5-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37fc2aeb7363a3b52d218d214eb4cc60b2d67e0bf20d80cc53a4543f2ac18917 |
|
MD5 | 9c0e84cbed49b0c72703ada9f7c40024 |
|
BLAKE2b-256 | 63f0da87d33b6c31d82b7697c229ae4137ac60e896241ee4182f979935832929 |
Hashes for quad_mesh_simplify-1.1.5-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed804ed1ef7aa5ffa6d1f5fa47e432f5ae1f80c97a3798d28307bd8583ba7e6e |
|
MD5 | c8d1b3eefe0e44d497826758c2048e6c |
|
BLAKE2b-256 | d8958b5c3cfc7b1bfd6412aac6fd044d08576ac74b2711bde8c31b7ccd902862 |
Hashes for quad_mesh_simplify-1.1.5-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 586964cd0f7d2dc91753cef8b440139d07db0626dddee7107f5ce6d056676e32 |
|
MD5 | ca495fd09635bcd935f9977cb7419189 |
|
BLAKE2b-256 | dff8d524d2bd415c7e7046e7439d2cd119c527df075ea8c9cdac623efa9ddc67 |
Hashes for quad_mesh_simplify-1.1.5-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76f413301ca998df6944910dfdadb261fe087e701edfbbb582cbf9eb1007a4e7 |
|
MD5 | 3a86ade4f5c660baeeaf5545763be699 |
|
BLAKE2b-256 | 14396ca2a563a39a7afc87544012c952380db88e03914e3e2b75e2e62ce665e6 |
Hashes for quad_mesh_simplify-1.1.5-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c06fbcba583537c14df266dd3b8af542046678ca3f82b2379d781d82878b6af |
|
MD5 | 33792755006760b4283f7538a23d1b78 |
|
BLAKE2b-256 | a2f9419b9172d5ac7a428daf1fe1614fac3f1eab96b58fbaa4ffa32f7a020437 |
Hashes for quad_mesh_simplify-1.1.5-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a70da5f67b43e9dbda07e80683de6fca9b5fc268f3c8cb3af0c600f72ee27f48 |
|
MD5 | 602e3ddfbfe63c1b87709e74a095524e |
|
BLAKE2b-256 | a5db3f9434716abda7eeef0771c5d0aa2a1614782a562d9d0c138c19b7724d75 |
Hashes for quad_mesh_simplify-1.1.5-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5aa56b02b7fb7146194e6dbec336493044fc4ef150a574c4e1456a55f16b427 |
|
MD5 | 40f01c4bda31dd40d6c6806ea24a402b |
|
BLAKE2b-256 | 2887911ee4c60c558cd8e3f5062ef71fc5a84b756423d65887dc147c0be6fec9 |
Hashes for quad_mesh_simplify-1.1.5-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95be2317dd236ed6d9286599c0e795abb57c31befbe79e31a9c1b8950e616ae6 |
|
MD5 | 5fc3851d692fcaeae63d2fa27ae541f4 |
|
BLAKE2b-256 | fd56a93fb1907cbcf89218ad7a1306e20748ffc2d4e30b9bbcbe91a98a0d20ce |
Hashes for quad_mesh_simplify-1.1.5-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35645282e2b0b0ab684a4ecf6d93868818598da73da4df1bf796a150a0a6e4af |
|
MD5 | 00d2e6679a2d276d40e4d64194692648 |
|
BLAKE2b-256 | b719383c77b0549d4b9e3cf6f9dcf7e141bcfd93bb6eaad0df8565a2483f6599 |
Hashes for quad_mesh_simplify-1.1.5-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24a6193335ffc31e6df9930a58da976fd1a4db1cb19364d9178ef5b7b4ac9c2a |
|
MD5 | 6f319a74d54c15a65eadd1c1a64d8f85 |
|
BLAKE2b-256 | 61e647e86ef3827e87b55a7e819394e16ee62b6c00d4c86600854cb31e758f40 |
Hashes for quad_mesh_simplify-1.1.5-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d226e82af542a5ab15e610d742478d0b006d80628e9001fea01ddf2126f0820 |
|
MD5 | a30ef761e519d50d90b6f00ed086af5e |
|
BLAKE2b-256 | 68342612e6b72698ba9ea834c3c4291d0b1f02a76a022cd8dd21021d9c2508bf |
Hashes for quad_mesh_simplify-1.1.5-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8183b7b919539a0326901a16884a45ebd95d16c7bc1936043976bc8f3c0efcc |
|
MD5 | fb9f0e42b9048ff248c6e11562755897 |
|
BLAKE2b-256 | a7f931423e945d38d52e135f5f0f345bb19a6e00bcd460cc543e611c95882e70 |
Hashes for quad_mesh_simplify-1.1.5-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42742668926e56860866deb7ae27da6f568b2044bb9c8e1448afc3d524db1fba |
|
MD5 | 57a2b122e01391984d62c8e6bc23d33b |
|
BLAKE2b-256 | a7b35aac8b2919b551648529c5c87fe7150030d863f3d507e5a424916e1e8e7a |
Hashes for quad_mesh_simplify-1.1.5-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50a35f905852d03b7a14a16eb480bd006c02e717c2b66f687b1b2c85850e7d19 |
|
MD5 | f971266eb6c68b19ff8bb9d856ebd741 |
|
BLAKE2b-256 | 077229d9676d80c2d9de00d0efea8f48ba05650d49caa96e2c4586c0beff8fe1 |
Hashes for quad_mesh_simplify-1.1.5-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7f9b36a9c71a79e32a7c1c983d4ebd6f477b1472a99fec2f0d84bbc3f39ba8b |
|
MD5 | aa66407c13f82abe48ea52d54592d3de |
|
BLAKE2b-256 | a0a874b344756df4e1ee622a842ac8c2541dc5dc818ea1e3262b497e2096a856 |