Package for generating periodic truss based lattices
Project description
Description
LatticeGeometryLib is a python library for creating spacial lattice structures which consist of an interconnected network of nodes struts and plates. These individual entities are combined into a unitary cell which periodic repetition creates the lattice. Furthermore this lattice can be inserted into any shell-like CAD geometry. This library is based on the CADQuery library.
Requirements
Package |
Version |
|---|---|
cadquery |
2.2.0 |
Installation
Embedding the library into your python code is just as easy as for any other library Just call the following command from your python terminal:
pip install latticegeometrylib
Usage
Example
from latticegeometrylib.Generator import LatticeGenerator
# create a new generator for the lattice
generator = LatticeGenerator()
# import a geometry as STEP-file
# cylinder has a height and radius of 10.
generator.import_initial_model( "cylinder.STEP" )
# create a shell object from geometry
# thickness of wall is set to 1.0
generator.create_shell( 1.0 )
# define the sizes of the unit cell in every spacial direction
size = ( 2., 2., 2. )
# state, if the measurements shall be set exactly as given
strict = ( True, True, True )
# initialize unitary cell
generator.init_unitary_cell( size, strict )
# define the strut diameter
d = 0.25
# add entities to the cell, which are defined by node ids of the unit cell (cell type is called BCC here)
generator.add_entity( [ 1, 7, { 'diameter': d } ] )
generator.add_entity( [ 2, 6, { 'diameter': d } ] )
generator.add_entity( [ 3, 5, { 'diameter': d } ] )
generator.add_entity( [ 4, 8, { 'diameter': d } ] )
# create unitary cell object from given entities
generator.create_unitary_cell()
# create lattice from given unit cell
generator.create_lattice()
# create intersection of lattice and shell
generator.intersect_lattice()
# merge shell and intersected lattice
generator.unify()
# export the shell with lattice core
generator.export_unified( "cylinder_with_lattice.STEP" )
Additional Remarks
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file latticegeometrylib-0.0.19.tar.gz.
File metadata
- Download URL: latticegeometrylib-0.0.19.tar.gz
- Upload date:
- Size: 140.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d96aa8eb46ff651864240b4c302549a419cdf882fe39c502ee6411188201dd93
|
|
| MD5 |
22aa8a56518ddb432c05050dd93bed49
|
|
| BLAKE2b-256 |
0006a37d33eddb872ceb407c69a15e4aff7af6c0b06b4efd40828de3fa430024
|
File details
Details for the file latticegeometrylib-0.0.19-py3-none-any.whl.
File metadata
- Download URL: latticegeometrylib-0.0.19-py3-none-any.whl
- Upload date:
- Size: 13.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09243bb11d1f7e739cfdc35861392654d99d5c6be0c1454fdd3664eeab88383d
|
|
| MD5 |
17cea86d24f30ede8e6ccae44de294d2
|
|
| BLAKE2b-256 |
d214ba0c22aea13dd56cd8ca3a9f93d9b5e440dcc900c59e9c0c471706e51b47
|