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
latticegeometrylib-0.0.13.tar.gz
(140.3 kB
view hashes)
Built Distribution
Close
Hashes for latticegeometrylib-0.0.13.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56f8ec71bbab44f3459f55f1a4fa16f5ef33c7fb8d4ed673fa65e4feec4e1b30 |
|
MD5 | c0cef4d7d88eea78e73dcbe1afc1535d |
|
BLAKE2b-256 | cb27f6b1bcb27f3b6b819f86d6df7e1d29842fade1ba1edbd5a0366d14f68d50 |
Close
Hashes for latticegeometrylib-0.0.13-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b13f79a0d0502d893ffde9e02ee99e295c202dc882bd99a35cb57a1878ddc9b |
|
MD5 | 15d73f5f3332336a9884898fc8f18111 |
|
BLAKE2b-256 | c2416c57f7527a8fa6414f2bb90aaca4505dbfedc0a197c8c6e914bbfbf03816 |