Skip to main content

3D mesh to graph

Project description

Intro

This project is born to easily conduct static analysis on 3D mesh geometries. Meshgraph allows you to convert 3D objects into graphs and thus perform algorithms on them.

How to use Meshgraph

Install

Install the meshgraph package using:

python3 -m pip install meshgraph

Convert .obj to Graph

Load a .obj file and convert it to a graph using:

from meshgraph import ObjLoader

graph = ObjLoader.load_graph_from_file(path_to_obj_file)

or use a local string:

graph = ObjLoader.load_graph_from_string(obj_string)

Nodes

Nodes can be accessed using:

from meshgraph.Node import Node
#...
graph_nodes = graph.nodes
#Accessing by index:
node0 = graph.nodes[0]
#Or using the accessor function:
node1 = graph.get_node(1)

Access a node's position using:

print(node0.pos)

Get a distance between two nodes node0 and node1 using:

distance = node0.distance(node1)

Access the neighbors of a node using:

node0.neighbors

Copyright

Copyright(c) 2022 Sebastiano Campisi - ianovir.com. Read the LICENSE file for more details.

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

meshgraph-0.0.1.tar.gz (13.1 kB view details)

Uploaded Source

Built Distribution

meshgraph-0.0.1-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file meshgraph-0.0.1.tar.gz.

File metadata

  • Download URL: meshgraph-0.0.1.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for meshgraph-0.0.1.tar.gz
Algorithm Hash digest
SHA256 8899f206734595620c1022f861d55b7d222b291ea16af04836174d7d8cf88d68
MD5 8641bcc18b93ede0cdd730f562dfe61d
BLAKE2b-256 dc0bb1e50d61006dcf55befb3de3dbbe1d417c8bbb89c970b5365cacfbd2e80c

See more details on using hashes here.

File details

Details for the file meshgraph-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: meshgraph-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 12.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for meshgraph-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 daabcdb9bfe70d1e412aef8bc79fea6dd6fe849037caa24e972e8dff8308343e
MD5 2edba73499d86dbb6be863bb18aeafd2
BLAKE2b-256 694ae0366f79131c05f8663bbbfb1f7a5afb1d13cfe81b831cf31707889d50a4

See more details on using hashes here.

Supported by

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