Skip to main content

pydcel: A Data Structure for Doubly-Connected Edge List (DCEL)

Project Overview

pydcel is a Python library that provides an implementation of the Doubly-Connected Edge List (DCEL) data structure. The doubly connected edge list (DCEL), also known as half-edge data structure, is a data structure to represent an embedding of a planar graph in the plane, and polytopes in 3D [1].

pydcel allows for efficient traversal and modification of the graph, making it ideal for applications such as geometric modeling, mesh processing, and algorithms related to computational geometry. By maintaining connectivity information for vertices, edges, and faces, the DCEL facilitates operations like edge flipping, face traversal, and vertex splitting, among others. This structure is particularly valuable in areas such as computer graphics, geographic information systems (GIS), and 3D modeling, where efficient representation and manipulation of geometric data are crucial.

Features

  • DCEL Data Structure: A complete and efficient implementation of the DCEL data structure.
  • Point and Vertex Handling: Functions for creating, manipulating, and managing points and vertices within the DCEL.
  • Edge and Face Operations: Support for edge insertion, deletion, traversal, and finding twins, along with face manipulation.

Installation

To install the library, using pip, run the following command:

pip install pydcel

If you prefer using pipenv, you can install the library using the following command:

pipenv install pydcel

Usage

The library provides classes for Point, Vertex, and Edge which can be used to construct a DCEL.

The Dcel takes 2 arguments:

  • list containing tuples of points as input.
  • list containing tuples of edges as input.
from dcel import Dcel

# Define vertices for the polygon as a list of tuples
vertex_coords = [
    (0, 0), (2, 2), (4, 0),
    (3, -2), (1, -2)
]

# Define edges connecting the vertices
edges = [
    (0, 1), (1, 2), (2, 3), (3, 4), (4, 0)
]

# Create DCEL from vertices and edges
dcel = Dcel(vertex_coords, edges)

# Print DCEL Statistics
print(dcel.statistics)

More detailed usage examples can be found in the examples directory.

Acknowledgements

pydcel builds upon the theoretical insights provided by Dr. Sanjoy Pratihar and takes inspiration from the work of Angel Yanguas-Gil on the DCEL data structure.

Contributing

To contribute to pydcel, please follow the guidelines mentioned in the CONTRIBUTING.md file.

License

pydcel is distributed under the BSD 3-Clause License. For more information, please refer to the LICENSE file.

Release files for pydcel 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pydcel 1.0.3
File Size Uploaded
pydcel-1.0.3.tar.gz 5.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pydcel 1.0.3
File Interpreter ABI Platform
pydcel-1.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 12.7 kB

Release files / pydcel-1.0.3.tar.gz

Download URL pydcel-1.0.3.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
2899e155096a01fd79b3521012dd2cfac704af55ee71db80002ff0662f65261c
BLAKE2b-256 checksum
How to use checksums
cc3e2b68dc87193cfab561cafd8ce28d6dbbcd00782a04c15f64c7be7b1d4d5c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.4

Release files / pydcel-1.0.3-py3-none-any.whl

Download URL pydcel-1.0.3-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f05094a92fd84079b33b034c7532474d765261b8dbb1e80831540ec8db694dd4
BLAKE2b-256 checksum
How to use checksums
79c7554a020a383f3e6e8402501e1feda97039e27880b691c8fe26b40f5b9b80
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.4

Release history Release notifications | RSS feed

This release

1.0.3 This release

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page