Skip to main content

Removal of too close curves in the GH/Rhino environment

Project description

Introduction

This python package tailored to the GH/Rhino environment allows for distance based removal of curves. When a bunch of curves are too close to adjacent curves the python package identifies the curves that have to be removed in order to fulfill the distance constraints but also keep as many curves as possible.

Theory

A group of curves can be representet as a graph where each curve is a vertex (curve = V) and each edge represents a distance violation between two curves (E(u,v) if dist(u,v)< dist_limit). To find the maximum set of curves that do not violate the distance constraint one has to identify the maximum independent set of vertices that do not have an edge (thus no distance violation). This is done utilizing a greedy MIS (maximum independent set) algorithm on the graph based. The heuristic removes the vertices with the most conflicts at first offering a approximation to the "perfect" solution as it is an NP-hard problem.

Input

The python package takes at most three inputs:

  1. A list of curves (Required)
  2. A distance threshold (Required)
  3. User-defined curves that should not be removed. (Optional)

The python package can just be called inside of a python3 grasshopper component.

Example files

A GH example file can be found on: https://github.com/Brandes21/PyPa/tree/main/Example_files

For any questions or in case of bugs feel free to contact me on: niclasbrandt97@gmail.com

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

mis_curves-0.1.4.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

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

mis_curves-0.1.4-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file mis_curves-0.1.4.tar.gz.

File metadata

  • Download URL: mis_curves-0.1.4.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.1

File hashes

Hashes for mis_curves-0.1.4.tar.gz
Algorithm Hash digest
SHA256 a6f740e2a0ff6e47a5c26c3bddee79a98a7c5ca1a3dc69d5db9b5000c2a08c9e
MD5 a6c9b33d9bbe19c66f946f1d6db10a5b
BLAKE2b-256 1b06d0e828f524826da9dca617cdd206d174043311a985f836f7f8b93feb5897

See more details on using hashes here.

File details

Details for the file mis_curves-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: mis_curves-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.1

File hashes

Hashes for mis_curves-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3935417a16838fcdaf31c85bc1d0c33ca4017b07ce360dbb79c9b51cb54a4313
MD5 de30c378559728fdd2b98c0294756d99
BLAKE2b-256 2aae9b34f34437461ffd52a418d4502aa1084cff1c7c1f449b37c12ca2226f89

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