Skip to main content

A Python implementation of the Doubly-Connected Edge List (DCEL) data structure.

Project description

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.

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

pydcel-1.0.3.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pydcel-1.0.3-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file pydcel-1.0.3.tar.gz.

File metadata

  • Download URL: pydcel-1.0.3.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.4

File hashes

Hashes for pydcel-1.0.3.tar.gz
Algorithm Hash digest
SHA256 2899e155096a01fd79b3521012dd2cfac704af55ee71db80002ff0662f65261c
MD5 2d0ee7137727df9c5ee2d5206654d83e
BLAKE2b-256 cc3e2b68dc87193cfab561cafd8ce28d6dbbcd00782a04c15f64c7be7b1d4d5c

See more details on using hashes here.

File details

Details for the file pydcel-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: pydcel-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.4

File hashes

Hashes for pydcel-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f05094a92fd84079b33b034c7532474d765261b8dbb1e80831540ec8db694dd4
MD5 3c6c3eeddef36592d8b34feeca13fe89
BLAKE2b-256 79c7554a020a383f3e6e8402501e1feda97039e27880b691c8fe26b40f5b9b80

See more details on using hashes here.

Supported by

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