Edge extraction for triangle meshes
Project description
fast-edges-extraction
Cython implementation of edges extraction from triangles as well as adjacency information (edge degrees and adjacent points/triangles for manifold and boundary edges).
Example
- Extract the edges from the triangles
from fast_edges_extraction import extract_edges
triangles = [
[0, 1, 2],
[1, 2, 3],
]
edges = extract_edges(triangles)
print(edges)
Out:
[[0 1]
[0 2]
[1 2]
[1 3]
[2 3]]
- Also extract adjacency information
# Extract edges, degrees, and adjacency information (triangles and points)
edges, degrees, t_a, p_a = extract_edges(triangles, return_adjacency=True)
# Extract manifold (2 adjacent triangles) and boundary (1 adjacent triangle) edges
manifold_edges = edges[degrees == 2]
boundary_edges = edges[degrees == 1]
other = edges[degrees > 2]
# For each manifold edge, extract the adjacent triangles and points
manifold_adjacent_triangles = t_a[degrees == 2]
manifold_adjacent_points = p_a[degrees == 2]
# For each boundary edge, extract the adjacent triangle and point
boundary_adjacent_triangles = t_a[degrees == 1][:, 0]
boundary_adjacent_points = p_a[degrees == 1][:, 0]
print("Number of manifold edges:", len(manifold_edges))
print("Number of boundary edges:", len(boundary_edges))
print("Number of other edges:", len(other))
print()
print("Manifold edges:\n---------------")
for i in range(len(manifold_edges)):
adjacent_triangles_indices = manifold_adjacent_triangles[i]
adjacent_points_indices = manifold_adjacent_points[i]
adjacent_triangles = [triangles[i] for i in adjacent_triangles_indices]
print(f"Edge {manifold_edges[i]}, ", end="")
print(f"adjacent triangles: {adjacent_triangles}, ", end="")
print(f"adjacent points: {adjacent_points_indices}")
print("\nBoundary edges:\n---------------")
for i in range(len(boundary_edges)):
adjacent_triangle_indice = boundary_adjacent_triangles[i]
adjacent_point_indice = boundary_adjacent_points[i]
adjacent_triangle = triangles[adjacent_triangle_indice]
print(f"Edge {boundary_edges[i],}", end=" ")
print(f"adjacent triangles: {adjacent_triangle},", end=" ")
print(f"adjacent points: {adjacent_point_indice}")
Out:
Number of manifold edges: 1
Number of boundary edges: 4
Number of other edges: 0
Manifold edges:
---------------
Edge [1 2], adjacent triangles: [[0, 1, 2], [1, 2, 3]], adjacent points: [0 2]
Boundary edges:
---------------
Edge (array([0, 1]),) adjacent triangles: [0, 1, 2], adjacent points: 2
Edge (array([0, 2]),) adjacent triangles: [0, 1, 2], adjacent points: 1
Edge (array([1, 3]),) adjacent triangles: [1, 2, 3], adjacent points: 1
Edge (array([2, 3]),) adjacent triangles: [1, 2, 3], adjacent points: 0
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
fast_edges_extraction-0.1.1.tar.gz
(158.7 kB
view hashes)
Built Distributions
Close
Hashes for fast_edges_extraction-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18ee8cc3aa8cbc694bf53a7c346a6d06a8f04de77e026b3f4e27f01052adb7e0 |
|
MD5 | c6b32e133c774da276f279e626f8ea30 |
|
BLAKE2b-256 | a0876bc46c27832d6a8750740246db7e59661c5802fa8afc6e1e93996c8f2632 |
Close
Hashes for fast_edges_extraction-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1fcd753c6b32c53bb34e9dec96b6ac36872cbc1b0df60a754cf71d7f67244f51 |
|
MD5 | 8b25e5d5d186d75317d0797fa08054ac |
|
BLAKE2b-256 | c71ba7d3ab6584d7e63ef906bc5afe74fa9773d311015d10afaef1a557260897 |
Close
Hashes for fast_edges_extraction-0.1.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c3c21a5603ed5222e4e349c2dbac6c3d46e90ea5a30a30f0ca22bfc3fd0510e |
|
MD5 | f1ba70e7b5f2aa0e519e5ed245fc9204 |
|
BLAKE2b-256 | 7ef56fe68bbe4002eb114a593699812a2b805f5320ea0bf684622f903fb95138 |
Close
Hashes for fast_edges_extraction-0.1.1-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae1f62968950a8e8cc87a8a19298b5d69d9955e3f28ef86441c7c2fe2daf5bd2 |
|
MD5 | fb39abf53e7b867ebaaaa03f965e1826 |
|
BLAKE2b-256 | af514f450d9ae63861939b823048eadef0c46e5c28c8eb9a6cb5be1d4e791313 |
Close
Hashes for fast_edges_extraction-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83e1a3981841106f409473b57e53a453c4322d2b7e991dd319c473dbea0848c1 |
|
MD5 | 576744ab553012863322f367783173ab |
|
BLAKE2b-256 | aa8ebb59b17b0cf0e3827a46bc24a622c5f1fad3d66aefd0204cccf74fddf132 |
Close
Hashes for fast_edges_extraction-0.1.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f790d6e83fbf642e89e2fe8bfb9ebc94651edf12597eebe3808f8daa1be1510b |
|
MD5 | 158a8e5fabfb12ea001852051517798f |
|
BLAKE2b-256 | bf8b9eb14e42ef15f83192db0497b27a3ecd0ac8b0f606b67651f324ec8e8a2b |
Close
Hashes for fast_edges_extraction-0.1.1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5773d3b0575fb396e39954d43c0cfc54db56b0bdfabeb6a008391c537663c556 |
|
MD5 | 2532a6722ee85f2a5dea9ca95f81bcff |
|
BLAKE2b-256 | 82191e4f60842b03f96c9be82dfb0d8567af85c910fb317f374bab624ee38f04 |
Close
Hashes for fast_edges_extraction-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 827a1d0abecc5061c0f3d5833938d7666b78bff686759d21adfc1b3808d51e5f |
|
MD5 | 2f4ff67a6d53ae68a8298f960dd5dfc9 |
|
BLAKE2b-256 | d0bce0d9b2d4918ed2fefb747793da93a3868b586a5e0286c74f4d2f7e567fa4 |
Close
Hashes for fast_edges_extraction-0.1.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80ab8dcb1dbf99479f449d64ec11dfc9b2687788c723e82d811bd62d86fb1a74 |
|
MD5 | c179d01b4c3d08e87a9d517456da7f20 |
|
BLAKE2b-256 | e0dca8bf1c92a1bd29e12da039013eb60a8d58f2fad5ebc10d2fc0cdb9189603 |
Close
Hashes for fast_edges_extraction-0.1.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0037a1ab2108ea9e3f55061bad059dcc836f2413ddf5f6792da8dfc41428f945 |
|
MD5 | 09b046af6bc51bf514623bffbe11ea05 |
|
BLAKE2b-256 | d69ca22c6c6e54abfab0dd35832210b6a4fb74258d205bc36d7e9fea050c8149 |
Close
Hashes for fast_edges_extraction-0.1.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db5793088e07fc0d4ece7fdac08d72c5c1ed2b2a31950132a975bed482d5faee |
|
MD5 | 609ba6c530c3ce8604f50b07b665b4c4 |
|
BLAKE2b-256 | 590b01cc33714f5c36f50deb5cec51b605cd995e3f0240101d71b627fac84425 |
Close
Hashes for fast_edges_extraction-0.1.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73a15bcd9233218fae98f9b6a304787c76c33ac0ec1a6e1c57d1f0f944003212 |
|
MD5 | dec27c5af35c7523fe054ad5ff1864ac |
|
BLAKE2b-256 | 4b3052b7f4b06c270067da8f813f986d9b79b9bd9a8320d08366cabe190b2a6e |
Close
Hashes for fast_edges_extraction-0.1.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f1ec31b79207a74db79450573775e2cb1f3dec9af051d59d258343a1d04f694 |
|
MD5 | 4d81d09797631086409565b2a6097025 |
|
BLAKE2b-256 | 392eac16b0317af02f57637733a065ed0f8411ef95751165980f98cb226c8e9c |
Close
Hashes for fast_edges_extraction-0.1.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 894cd19f503ef455833fb808acce8c2f18a27b3c551ca1d3b06f45c4e18042fa |
|
MD5 | cc4f98259dffba28e3e9b6262dca8f7d |
|
BLAKE2b-256 | 9bd6880b564758aebcae12b17a51cef41fe9b333bf6fd04c972d064acc3a57b1 |
Close
Hashes for fast_edges_extraction-0.1.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4deeaa9f15c7032ac4499a25dc4ee5375758b60b961f38aca23c7ff8b698aa37 |
|
MD5 | 4c1c74f03e4067e9bb85aab36e4b3f38 |
|
BLAKE2b-256 | c0ffe7766fba4f3c2b864a0af33e5a7272bc68c7daccb0f2e3972fecec1f8943 |
Close
Hashes for fast_edges_extraction-0.1.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a5b7297167a692d84b9187ca1d3c44bd8a38e07259a72d4d179dd8103a7cbb6 |
|
MD5 | 74d21b5b67e9ce6ae0772c5b05d66454 |
|
BLAKE2b-256 | 32ee6e49df4c40e7503ddfae610e21444b02256656d1856bbc280d2d7027b6ec |