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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file meshgraph-1.0.0.tar.gz.
File metadata
- Download URL: meshgraph-1.0.0.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5784dd7408901c9bbb33f9c8cfc72812fade7c513587113eedeeec67ec563742
|
|
| MD5 |
32e15ca4880551dd71378b7a6d4d7384
|
|
| BLAKE2b-256 |
51888c527bf6cac207bd130224f8b52d8b6209aa4b3f882160dbd9b057fddc23
|
File details
Details for the file meshgraph-1.0.0-py3-none-any.whl.
File metadata
- Download URL: meshgraph-1.0.0-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d7249ae3fc4d66b93e7d975ab647e4d410760d843a16192451959a75c505f86b
|
|
| MD5 |
353232e440f816bf5b9728ccd6aaac60
|
|
| BLAKE2b-256 |
f06d50df5f6a4f31a3a96197c5264d12d5cccf48aa5db9c80e30cead48ebee9e
|