Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/dbukenberger/HexahedralLattice
20 November 2024, 08:15:20 UTC
  • Code
  • Branches (1)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/main
    No releases to show
  • dec04bd
  • /
  • README.md
Raw File Download
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge Iframe embedding
swh:1:cnt:5341a6bc8e4930b754fa024a7db97d5e0bccc54c
origin badgedirectory badge Iframe embedding
swh:1:dir:dec04bd62de6ca0b3abc19ae3d00a74dbe9177e4
origin badgerevision badge
swh:1:rev:991ca6893ac1feec28f491429111e0fbdcefccc0
origin badgesnapshot badge
swh:1:snp:2df996fe5f309874504f9e2eaff26085dad17e10

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: 991ca6893ac1feec28f491429111e0fbdcefccc0 authored by dbukenberger on 20 November 2024, 07:08:57 UTC
Update requirements.txt
Tip revision: 991ca68
README.md
<img src='https://bukenberger.net/papers/hexahedralLattice.png' align="right" width="220">

# Stress-Aligned Hexahedral Lattice Structures
[![PDF](https://img.shields.io/badge/PDF-green)](https://bukenberger.net/pdfs/2024_bukenberger_stress-aligned_hexahedral_lattice_structures.pdf)
[![CGF Paper](https://img.shields.io/badge/DOI-10.1111/cgf.15265-blue)](https://doi.org/10.1111/cgf.15265)

With this implementation you can generate stress-aligned hexahedral lattice structures as described in the paper.

## Dependencies

Used libraries can be easily installed with `pip install -r requirements.txt`.

**Required** are
* [scikit-fem](https://github.com/kinnala/scikit-fem) for all FEM related things (requires [meshio](https://github.com/nschloe/meshio))
* [NumPy](https://github.com/numpy/numpy) for vectorized arrays,
* [SciPy](https://github.com/scipy/scipy) for (sparse) matrix operations,
* [libigl](https://github.com/libigl/libigl-python-bindings) for fast winding numbers and
* [drbutil](https://github.com/dbukenberger/drbutil) for various utilities.

**Optional** and recommended are 
* [CuPy](https://github.com/cupy/cupy) for CUDA accelerated NumPy,
* [PyPardiso](https://github.com/haasad/PyPardiso) for a parallelized CPU solver,
* [embreex](https://github.com/trimesh/embreex) for fast ray intersections,
* [trimesh](https://github.com/mikedh/trimesh) as fallback option for other methods,
* [tqdm](https://github.com/tqdm/tqdm) for progress bars,
* [Mayavi](https://github.com/enthought/mayavi) and [Polyscope](https://github.com/nmwsharp/polyscope) for nice visuals.


## Run Examples
In the main directory you can run `python runExamples.py` to generate example results.
This script contains basic setups to recreate results (2D & 3D) from the paper and an overview of the required steps.

# Usage
To create structures of your own objects you'll need a triangular (2D planar) `.obj` file or a tetrahedral (3D volume) `.msh` file as input, respectively.
Suitable tet-inputs can be generated using [fTetWild](https://github.com/wildmeshing/fTetWild) using the `--no-binary` option.

## Generating a Stress Field
Boundary conditions, i.e., fixed vertices and applied forces, can be defined in a `.frc` file using the following structure:
* First, the input file `file` (`file.obj/msh`) and mesh type `type` (`tri/quad/tet/hex`) are specified.
* Keywords `fix` and `flx` at the start of a line specify if selected vertices are either fixed or flexible (where forces are applied).
* Vertex selection has two modes `d` (dimension) and `r` (radius).
Thereby, `d` is followed by two numbers, the first (int) indicating the dimension (`0=x`, `1=y`, `2=z`) and the second (float) to specify the position of the selection plane.
This will select all vertices on the positive side of the plane, i.e., above the threshold.
For the inverse, precede the dimension with a `-`.
The radius selection is defined by a point coordinate (two floats in 2D, three in 3D) and a radius.
* The forces acting on the flexible vertices are given with the `vec` keyword as simple 2D or 3D vectors, respectively.
Multiple selections can be given different force vectors and are simply assigned by their order in the force-file.

Lets examine the included `bar2D.frc` as an example:
```python
file bar2D.obj		# the input file
type tri		# input type
fix d -0 -1		# fixed vertex selection
flx r 1 0 0.01		# flex vertex selection A
flx r 0 -0.5 0.01	# flex vertex selection B
vec 1 0			# force acting on A
vec 0 -1		# force acting on B
```
* The `-0` in the fixed vertex selection indicates that we want to select all vertices below a threshold (`-`) in x-dimension (`0`), using a threshold value of `-1`.
* Vertex selection `A` includes all vertices around a point `(1, 0)` within a radius of `0.01`.
* Vertex selection `B` includes all vertices around a point `(0, -0.5)` within a radius of `0.01`.
* Force vectors applied on selected vertices `A` and `B` are `(1, 0)` and `(0, -1)`, respectively.

Fixed and flexible vertex selections include only vertices from the objects boundary hull.
One can specify multiple force-files for the same input object, i.e., as exemplified with the included buddha.
Lines can be commented-out using `#`.
Once the forces are applied by the `FemObject.py`, the FEM simulation data is stored in a `.stress` file.

## Generating a Hexahedral Lattice
Starting from the stress field just created, we can initialize a cubification object using various parameters, as exemplified in the `CubeObject.py` file.
By default, these settings are stored in `.cfg` files, thus can be reloaded again.
Parameters are self-explanatory and described in the paper.
Resulting quad- or hex-meshes are stored in `.ply` or `.mesh` files, respectively.

## Evaluation
Optimized results from the cubification are still solid objects.
To produce actual lightweight designs, they are again loaded as `FemObject.py` using the same initial force-file but setting the `loadResult = True` flag.
Then we can materialize the object using micro-structures and evaluate the compliance of the new optimized design by reapplying the specified boundary conditions.

## Citation
You can cite the paper with:
```
@Article{bukenberger2024stress,
  author    = {Bukenberger, Dennis R. and Wang, Junpeng and Wu, Jun and Westermann, Rüdiger},
  journal   = {Computer Graphics Forum},
  title     = {{Stress-Aligned Hexahedral Lattice Structures}},
  year      = {2024},
  issn      = {1467-8659},
  pages     = {e15265},
  volume    = {43.7},
  doi       = {10.1111/cgf.15265},
  publisher = {The Eurographics Association and John Wiley & Sons Ltd.},
}
```

back to top

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API