Skip to main content

Overview

This Python package provides code regarding the RDG networks project.

License Python Version

Table of Contents

Features

No thickness

  • generate_line_segments: Function that determines the linesegments of a RDG network.
  • generate_line_network: Function that makes the underlying network of the linesegments.
  • get_intersection_segments: Function that determines the intersection segments of a RDG network.
  • generate_line_segments_dynamic: Function that determines the segments of a dynamic RDG network (with increasing linelengths in time).
  • draw_segments: Function that draws the segments.

Thickness

  • generate_line_segments_thickness: Generates segment network with thicknesses

  • orientate_network: Generates various rotated versions of the initial network.

  • save_to_stl: Saves the network as a stl file.

  • save_to_json: Saves data as a json file.

  • load_from_json: Loads data as a json file.

Installation

You can install the package using pip:

pip install RDG-networks

Usage

Output

The main function is called generate_line_segments_thickness and outputs the following data:

data_dict = {'segments_dict': segments_dict, 
             'polygon_arr': polygon_arr, 
             'segment_thickness_dict': segment_thickness_dict, 
             'jammed': jammed,
             'generated_config': generated_config}
  • segment_thickness_dict: contains the generated network, represented by multiple polygons.
  • segments_dict: contains auxilliary information of the generated network.
  • polygon_arr: contains auxilliary information of the generated network.
  • jammed: A boolean indicating if the system is jammed.
  • generated_config: An array containing all nucleation points and orientations of the segments.

Code example

import matplotlib.pyplot as plt
import numpy as np
import os
import sys
import random
from RDG_networks.thickness.generate_line_segments_thickness import generate_line_segments_thickness
from RDG_networks import save_to_stl
from RDG_networks.save_data import save_to_json, load_from_json

size = 15
lamb0 = 0.2
alpha = 0.52
thickness_arr = [lamb0 * t**(-alpha) for t in range(1, size + 1)]
box_size = 1
angles = [random.random() * 2 * np.pi for _ in range(size)]

# Generate initial structure with specified parameters
data_dict = generate_line_segments_thickness(size=size, thickness_arr=thickness_arr, angles=angles, box_size=box_size)

# Setup plot
fig, ax1 = plt.subplots(nrows=1, ncols=1, figsize=(5, 5))

segment_thickness_dict = data_dict['segment_thickness_dict']
for key, segment in segment_thickness_dict.items():
    segment.draw(ax1)
    middle_segment = segment.middle_segment
    if middle_segment:
        middle_segment.draw(ax1)

# Set plot limits and disable ticks
ax1.set(xlim=(0, 1), ylim=(0, 1))
ax1.set_xticks([])
ax1.set_yticks([])

# Save to STL and JSON files
save_to_stl(segment_thickness_dict, thickness=0.2, name=os.path.join(sys.path[0], 'network.stl'), frame_thickness=0.1)
file_path = os.path.join(sys.path[0], 'data.json')
save_to_json(data_dict, file_path)
data = load_from_json(file_path)

# Display the plot
plt.show()

Configuration

No specific configuration is required.

License

All Rights Reserved

The following code and its accompanying documentation are the property of Martijn (Niek) Mooij. All rights are reserved. No part of this code may be reproduced, distributed, or transmitted in any form or by any means, including photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the author, except in the case of brief quotations embodied in critical reviews and certain other noncommercial uses permitted by copyright law. For permission requests, write to the author at mooij.niek@gmail.com.

Copyright 2024 Niek Mooij

Contact

You can contact me at mooij.niek@gmail.com for any questions or suggestions.

Metadata

Release files for RDG-Networks 0.3.15

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

Source distribution (sdist)

Source distribution for RDG-Networks 0.3.15
File Size Uploaded Provenance Actions
rdg_networks-0.3.15.tar.gz 29.6 kB Without provenance Details for rdg_networks-0.3.15.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for RDG-Networks 0.3.15
File Interpreter ABI Platform Actions
rdg_networks-0.3.15-py3-none-any.whl Python 3 none any Details for rdg_networks-0.3.15-py3-none-any.whl

Total release size: 70.1 kB

Release files / rdg_networks-0.3.15.tar.gz

Download URL rdg_networks-0.3.15.tar.gz
Size 29.6 kB
Tags Source
SHA-256 checksum
How to use checksums
351f36a3ca431d41dc4b4440cda5b140e6049326e1552e1d5e5d0cc5d4244241
BLAKE2b-256 checksum
How to use checksums
7517328aac344809003a02f464cc471984a9f48dba960d926484222c396f913a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / rdg_networks-0.3.15-py3-none-any.whl

Download URL rdg_networks-0.3.15-py3-none-any.whl
Size 40.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b49fd0914cf0d9257f27ead5715866fbcf0167b5a004d704cd1fe859f741a8f1
BLAKE2b-256 checksum
How to use checksums
013ae366a485d29362518e5e6ec1e772a1a42d6d77fac1664b8b0754603a0824
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Security for RDG-Networks 0.3.15

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.15 This release

2 release files No provenance

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