stepfg: STEP File Generator
Python 3.8+ | Zero dependencies | MIT License
Authors: E. Valetov and M. Berz Organization: Michigan State University Creation date: 03-Feb-2017
Introduction
stepfg converts lists of 2D polygons (specified by vertices in the x-y plane) into 3D STEP files (ISO 10303-242) by extruding the polygon interiors along the z-axis. Pure Python, no external dependencies.
Installation
pip install stepfg
Or from source:
git clone https://github.com/evvaletov/stepfg.git
cd stepfg
pip install -e .
Library usage
from stepfg import StepBuilder, generate_step
# Quick one-liner
content = generate_step(
polygons=[[[0, 0], [1, 0], [1, 1], [0, 1]]],
z_range=[0, 10],
scale=1,
)
# Or use StepBuilder for more control
builder = StepBuilder('output.stp')
builder.generate_assembly(
list_vert_list=[[[0, 0], [1, 0], [1, 1], [0, 1]]],
geom_depth_list=[0, 10],
p_coeff=1,
)
builder.to_file('output.stp')
Command-line usage
stepfg [input_file [output_file]]
python -m stepfg [input_file [output_file]]
Run with the included sample geometry (a Muon g-2 quadrupole):
stepfg part_geometry.txt quadrupole.stp
Input file format
The input file is a Python literal containing three elements:
[polygons, z_range, scale]
- polygons:
[[vertex, ...], ...]— each vertex is[x, y]or[x, y, 0] - z_range:
[z1, z2]— extrusion interval - scale: proportionality coefficient (output is in mm; use 10 for cm input)
A sample input file part_geometry.txt containing a Muon g-2 Collaboration
quadrupole cross-section is included.
Copyright Notice
© 2017 Eremey Valetov and Martin Berz
Metadata
Release files for stepfg 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| stepfg-2.0.0.tar.gz | 10.6 kB | Without provenance | Details for stepfg-2.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| stepfg-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for stepfg-2.0.0-py3-none-any.whl |
Total release size: 20.5 kB
Release files / stepfg-2.0.0.tar.gz
| Download URL | stepfg-2.0.0.tar.gz |
|---|---|
| Size | 10.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3f36671488002f57928a911232c4eff2371384e6c0bb6a5ce5bcd5936963f8e2
|
|
BLAKE2b-256 checksum How to use checksums |
6324a4193d36daad19ebf40df8a9411fd8c9ca0e75cb606eea237b5fae5b2298
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Release files / stepfg-2.0.0-py3-none-any.whl
| Download URL | stepfg-2.0.0-py3-none-any.whl |
|---|---|
| Size | 9.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e26da05e7fdc24579ab9bfb3092afbbf74dc0c3dc351429e84d4aa9586fa0d03
|
|
BLAKE2b-256 checksum How to use checksums |
b3663ae159309cff3b60900967fdaa42051aefdd2fc69b711acd33eafbfb495a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Security for stepfg 2.0.0
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.