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).
pip install fast-edges-extraction
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.2.tar.gz
(159.1 kB
view hashes)
Built Distributions
Close
Hashes for fast_edges_extraction-0.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4cce9d6aa65287f16d07614df8c1e1cd1693ccf46304b074b0458d777af6f01 |
|
MD5 | 9a6e2adfb5bffba86e54079421e0d483 |
|
BLAKE2b-256 | 223266eb25f7b0142eb4eea2a3447e5e5d96056e8d4dc7737845b125ebe2e198 |
Close
Hashes for fast_edges_extraction-0.1.2-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 117df56df0ffb8198000457e7b900a7a6494705b73248d82fa4fbc6861c5ab93 |
|
MD5 | ad72bc885cfb1229c73d03d7f449bb49 |
|
BLAKE2b-256 | e3b5c2f0e742e2a3d9d8ef28e55f25182ac55ea63a124ed8f1c218283d3b8582 |
Close
Hashes for fast_edges_extraction-0.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b2db5169e8b34e601c313a7a73162521523115f52848ddd0551dc39595897e9 |
|
MD5 | a1a457acfb23d1f39aa9ec94143746c1 |
|
BLAKE2b-256 | e9bf5d0b631965907c4a4cc003541c7c0026397a15e73634663718c85b674ff7 |
Close
Hashes for fast_edges_extraction-0.1.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0d4b989f076213a896ecf67d4126bc951af65d8adeb89f27e2e2ae65bef6144 |
|
MD5 | 017f4fd6a54802da1e41e303b4695aa4 |
|
BLAKE2b-256 | 5edd1cbbc494c550bca7e0ca397e78effa68a1fccfd26eee6aa614c66424c6a9 |
Close
Hashes for fast_edges_extraction-0.1.2-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98a3ab9ae4b0f3c49519be73d3a602fab0cf324278e795d8fff576a77481859b |
|
MD5 | cad83eab530538675bb292ae3d64d433 |
|
BLAKE2b-256 | edcd50fbd872995bce5140231e3b890d72e78832dbe50e6b7304605973c0cbcb |
Close
Hashes for fast_edges_extraction-0.1.2-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39f533aabc0630c3141a6a6a4cecd30c4297b822720169cdfa2278cca24abfa6 |
|
MD5 | a9d852f1b1319683652585286ae9a990 |
|
BLAKE2b-256 | 772d94ea887c7b4a820fcd2794fa2150741d736d1089ec720d75792c634debe0 |
Close
Hashes for fast_edges_extraction-0.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a93a74193e3f55a0ef919f2d8bb521e2da8b6e15340b622c15e2165e946dc18 |
|
MD5 | fbb492a3988732da3b4ac03a3872835b |
|
BLAKE2b-256 | b11b7a0ada29d1a0465af24425eb3dce0bf10fb13ca599913ca70681d4371728 |
Close
Hashes for fast_edges_extraction-0.1.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 776fca4c13cbe5a8d4fd014b133576ed4c84f5806ddac54a6e0b828cfb7f68dd |
|
MD5 | 69e924fc1b035c8064b04f8983f2ba7c |
|
BLAKE2b-256 | eb89e4173f93b8226e10ce3c6d406cb636df4ba24427b20cf5ef6c4e24a64f21 |
Close
Hashes for fast_edges_extraction-0.1.2-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b5248e99237fc2f2cb34c58ef0b3017dc1e05e7271d09c75285ed40718581a7 |
|
MD5 | e73560d6d70ddae323f7fc9dd4c9b8cb |
|
BLAKE2b-256 | 45a9f5ee87921335fea588e9d567ed33843c5e86b967a92e8157e39fd1041db3 |
Close
Hashes for fast_edges_extraction-0.1.2-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0915caad7948ba1ee8101596f423842113b2419a15df2455cb94938587a35e7 |
|
MD5 | 5f874f0a2ab1135fb5f26e84c76f520a |
|
BLAKE2b-256 | 3d6ff616ef5e4503c84a12a13ae536f6e25194126f07b32facfce824d110ee95 |
Close
Hashes for fast_edges_extraction-0.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d85ef13c72fe25d175c4a2345d0474735b73df8b54e32c2edda0586abad3e548 |
|
MD5 | dae07a362760dea34d02fe769b4711e2 |
|
BLAKE2b-256 | c4cfb70afd16be9acbb37d32f2bb6004c58e8f6a1ca12007317bb5f086ce31c0 |
Close
Hashes for fast_edges_extraction-0.1.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa83d0e0629a50e1a5b7b29bbdd7bb49317b27cdcd12b1237784e2201837bc60 |
|
MD5 | 800523c6eca3af85a999f1f84ad0779c |
|
BLAKE2b-256 | 7d64b6f062bdde1172ea34aa3af500c7296ac0622b940bfc31897bffb849f51f |
Close
Hashes for fast_edges_extraction-0.1.2-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70632a3687f65ccba4142c3302ae354acd52243dace83c18e72426cca90f20f7 |
|
MD5 | ffd2720a4a0b0849e5f1a16b3609485c |
|
BLAKE2b-256 | 063b57516795ba7d9732bbae90c9833298386c40a7fb71ce376a9fd1ec77b14d |
Close
Hashes for fast_edges_extraction-0.1.2-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cbcf22691504966376e8e9a13f7954dbeb5e49611bd19358b5484e1e5f8d40ed |
|
MD5 | 9ba5df40e45a2937a44ffcf4cfb5cc61 |
|
BLAKE2b-256 | 29e6408033c1538e1ae9bb3fc245aeac52e8e5fb050fb8c6752c6b04d942be30 |
Close
Hashes for fast_edges_extraction-0.1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63bc230c38b479c54ca1d1e73b6b2a90ffecf6cf362f24425e78025995c7bb8d |
|
MD5 | b5a69c978ee2ee822ebc357b6e85d1fa |
|
BLAKE2b-256 | c43dcd87f93f1e9b977f5d1e36fa027ac3f254bf6732a6b1d4d8c11b58a7b81a |
Close
Hashes for fast_edges_extraction-0.1.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8eb33e01af52218378e4fe1447462f9854af3454692d0e15a0273130d0174ac |
|
MD5 | 53bba68a6fc7f9021b6f805d5cece2a4 |
|
BLAKE2b-256 | fe1b2af2d7517d9a8fca054becdeb1f8cd373f8970bb11684aa396b18fe2b3df |
Close
Hashes for fast_edges_extraction-0.1.2-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12a3bfc52ef37a72c2f837357d0002d457fbff8ee57d03ce55470cf967948a80 |
|
MD5 | 4c70b090cd4ac5c4594bd4ed958c7c1e |
|
BLAKE2b-256 | 0ecd5dba9ae0c4c5b499b56ba4a7b9cbac405cbee88d1e4bf948ebdebe5c8418 |
Close
Hashes for fast_edges_extraction-0.1.2-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bdea6a4c4af452f0566fafe22170a689e41c044c94e041cbcd7a3af9fbafb379 |
|
MD5 | 4de786d0bc13aef5b0d870aec0cf590f |
|
BLAKE2b-256 | 7db191a3d6ac5653cb2ce8deaf10deba0abb57b74253ebf6f51d8bb669979911 |
Close
Hashes for fast_edges_extraction-0.1.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67a951d6475b8b474f9893c58a9e0dbaf1148b094e6e3bd49ee94015c0a760e0 |
|
MD5 | 0bfe0b0003a8999fd79c1d31ea9c0efe |
|
BLAKE2b-256 | 78abd2a095a6d78e8e8dc6a5bf465e795759d8b9b856b2f7111642fe9a176c84 |
Close
Hashes for fast_edges_extraction-0.1.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93891f493d7200d8aac179cadda830f868a625d418803e63341ec5cb34f54a46 |
|
MD5 | 47dfcee76114fa8bfa8fc7542e9d56d9 |
|
BLAKE2b-256 | 853ac0e473ebc5c0d5e5e333c69093625cb62aadae39416b959941a4ef13442b |
Close
Hashes for fast_edges_extraction-0.1.2-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 498cbbca30a8e28a11357261ddf46c563ce49cc6238b99f62598c85670a2f3ec |
|
MD5 | a985cedf630c9435674f3766062d9607 |
|
BLAKE2b-256 | 19da6a89c6583b9d4a185c37dd7a9dbf18f1a9db518454514d04e480ef28765d |