Skip to main content

Unusual mesh processing tools

Project description

Meshiki

A collection of unusual mesh processing algorithms.

Install

# from pypi, will build extension at first time
pip install meshiki

# locally
cd meshiki
pip install . 

Usage

Trigs-to-Quads

          Triangulate       We want this!
    Quads ----------> Trigs ------------> Quads
(obj, blender)   (glb, fbx, ...)

This algorithm is aimed for converting a triangulated quad-dominant mesh back to a mixed tri/quad mesh, with as many as possible reasonable quad faces. Our implementation is based on maximum weighted graph matching, and is usually better compared to the built-in tool (Edit Mode -> Face -> Tris to Quads) of blender.

from meshiki import Mesh

mesh = Mesh('mesh.glb', verbose=False)
mesh.quadrangulate()
mesh.export('mesh.obj') # must use obj for quad faces

Salient point sampling

This algorithm samples salient points from mesh surface as proposed in Dora.

from meshiki import Mesh, fps, load_mesh, triangulate

# load mesh
vertices, faces = load_mesh(mesh_path, clean=True)
# make sure it's pure-trig
faces = triangulate(faces)
mesh = Mesh(vertices, faces)
# sample 64K salient points
salient_points = mesh.salient_point_sample(64000, thresh_bihedral=30) # np.ndarray, [64000, 3]

We also implement uniform sampling and furthest point sampling:

# sample 128K uniform points
uniform_points = mesh.uniform_point_sample(128000) # np.ndarray, [128000, 3]
# use FPS to subsample 8K points from uniform points
fps_points = fps(uniform_points, N_FPS, backend='kdline') # np.ndarray, [8000, 3]

Acknowledgement

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

meshiki-0.0.2.tar.gz (47.4 kB view details)

Uploaded Source

File details

Details for the file meshiki-0.0.2.tar.gz.

File metadata

  • Download URL: meshiki-0.0.2.tar.gz
  • Upload date:
  • Size: 47.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for meshiki-0.0.2.tar.gz
Algorithm Hash digest
SHA256 686fd6d27b09c665f52cf8855e74402cf68fab5959719eaa469cb616efbf39e6
MD5 96d788b290bfc5a523d973286d15a857
BLAKE2b-256 b1a6a54a8e068bca21f9bd1de62f8d553c8ce352f154668bc3ed92041efd5173

See more details on using hashes here.

Provenance

The following attestation bundles were made for meshiki-0.0.2.tar.gz:

Publisher: pypi-publish.yml on ashawkey/meshiki

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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