Skip to main content

gcs

Report a Bug Request a Feature Read the Paper

MacOS Build Status Ubuntu Build Status Windows Build Status

Teaser

gcs is a Python library for creating generalized cylindrical shells (GCS).

The GCS design space uses eleven continuous parameters to generate trillions of geometrically diverse, manufacturable cylindrical-shell structures. This compact parameterization enables large-scale optimization while capturing the nonlinear buckling, plasticity, and self-contact mechanisms that govern energy absorption. This library is used in our paper:

Kelsey L. Snapp, Benjamin Verdier, Aldair E. Gongora, Samuel Silverman, Adedire D. Adesiji, Elise F. Morgan, Timothy J. Lawton, Emily Whiting, Keith A. Brown
Superlative mechanical energy absorbing efficiency discovered through self-driving lab-human partnership
Nature Communications (2024)

Installation

The package requires Python 3.10 or later and is available on PyPI. Install it with:

pip install gcs-shape

You can then import the package in Python:

import gcs

GCS Design Parameters

GCS are parameterized by 11 values:

Syntax Description
c4_base Parameter controlling the size and shape of the base $4$-lobe feature.
c8_base Parameter controlling the size and shape of the base $8$-lobe feature.
c4_top Parameter controlling the size and shape of the top $4$-lobe feature.
c8_top Parameter controlling the size and shape of the top $8$-lobe feature.
twist_linear Rotation (rad) of the top. This creates a linear twist between the base and top.
twist_amplitude Amplitude (rad) of the oscillating twist between the base and top.
twist_cycles Number of cycles of the oscillating twist between the base and top.
perimeter_ratio Ratio between the top and base perimeters.
height Height (mm).
mass Mass (g).
thickness Wall thickness (mm).

c4 and c8 Relationship

The geometry of each top or bottom face is described by a polar equation whose shape is controlled by the parameters c4 and c8. This parameterization was adopted from Overvelde and Bertoldi (2014).

c4 & c8 relationship

twist_linear, twist_amplitude, and twist_cycles Relationship

The parameters twist_linear, twist_amplitude, and twist_cycles control how the cross-section rotates as it is interpolated from the base face to the top face. twist_linear sets the linear rotation, while twist_amplitude and twist_cycles control the amplitude and frequency of the oscillatory rotation along the height.

twist relationship

Quickstart

import gcs

# Create a generalized cylindrical shell
shape = gcs.GCS(c4_base=0.3,
                c8_base=-0.2,
                c4_top=0.4,
                c8_top=-0.3,
                twist_linear=2,
                twist_amplitude=0.05,
                twist_cycles=3,
                perimeter_ratio=1.5,
                height=20,
                mass=2.1,
                thickness=0.48)

# Assert the shape is valid
print(shape.valid)

# Save shape to STL file
gcs.io.save_mesh(file='shape.stl', shape=shape)

Documentation

Documentation is provided in NumPy-style docstrings throughout the codebase. Docstrings can be viewed interactively with Python's built-in help() function. For example:

import gcs
help(gcs.GCS)

Contributing

The contribution guidelines can be found in CONTRIBUTING.md.

Maintainers

Citation

@article{Snapp:2024:SuperlativeMechanicalEnergy,
author={Snapp, Kelsey L. and Verdier, Benjamin and Gongora, Aldair E. and Silverman, Samuel and Adesiji, Adedire D. and Morgan, Elise F. and Lawton, Timothy J. and Whiting, Emily and Brown, Keith A.},
title={Superlative mechanical energy absorbing efficiency discovered through self-driving lab-human partnership},
journal={Nature Communications},
year={2024},
month={May},
day={21},
volume={15},
number={1},
pages={4290},
issn={2041-1723},
doi={10.1038/s41467-024-48534-4},
url={https://doi.org/10.1038/s41467-024-48534-4}
}

Metadata

Release files for gcs-shape 2.0.0

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

Source distribution (sdist)

Source distribution for gcs-shape 2.0.0
File Size Uploaded
gcs_shape-2.0.0.tar.gz 16.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gcs-shape 2.0.0
File Interpreter ABI Platform
gcs_shape-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 36.8 kB

Release files / gcs_shape-2.0.0.tar.gz

Download URL gcs_shape-2.0.0.tar.gz
Size 16.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0020d0a56d3319d014433346bcb0876008d55c85ad42b3e312dffcec0d707038
BLAKE2b-256 checksum
How to use checksums
e483cf9c7d56096317e86aeb4d15ce48fd47c1907be57f9a794cd43e4b982d22
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 26, 2026.

Transparency log

Release files / gcs_shape-2.0.0-py3-none-any.whl

Download URL gcs_shape-2.0.0-py3-none-any.whl
Size 20.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
55137439d32b46f27a4902e22511668fa526d16f3d5db84924046be3742af245
BLAKE2b-256 checksum
How to use checksums
b5fecfa6051727ac6af749c45c8723cf17395f069389007267bf09be6f75d120
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 26, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.3.0

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

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