A MATLAB–Abaqus workflow for curved-rod voxel lattice generation, dual-scale 2x2x2 / 4x4x4 compression simulation, automatic force–displacement and stress–strain extraction, and STL preparation for 3D printing.
This repository is the original voxel-based curved-rod lattice workflow. It is kept as a complete reference pipeline for voxel lattice generation, compact Abaqus .inp export, automated compression simulation, and printing-oriented STL export.
Current version: V2.0 Dual-scale simulation and 3D-printing workflow
Main updates:
- Separated
2x2x2and4x4x4workflows - Added STL export for Bambu Studio / 3D printing
- Added compact Abaqus
.inpexporter - Added separated
Output,STL,Abaqus_Work, andResultsfolders - Added practical 3D printing notes
curved-X topology
→ voxel lattice generation
→ 2x2x2 / 4x4x4 voxel repetition
→ compact Abaqus INP export
→ Abaqus compression simulation
→ force-displacement and stress-strain curves
→ STL export for 3D printing
Curved_Rod_Voxel_Model/
├─ 2x2x2/
│ ├─ batch_generate_curved_x.m
│ ├─ batch_repeat222_and_export_inp.m
│ ├─ batch_export_mat_voxel_to_stl_222.m
│ ├─ export_mat_voxel_to_abaqus_inp.m
│ ├─ export_one_mat_to_stl.m
│ ├─ export_voxel_to_stl_binary.m
│ ├─ GenerateVoxel.m
│ ├─ write_curved_x_topology.m
│ ├─ save_sample_mat.m
│ ├─ save_repeat222_mat.m
│ ├─ abaqus_batch_run_all.py
│ ├─ postprocess_summary_and_plots.py
│ ├─ batch_curved_x/
│ ├─ Output/
│ ├─ STL/
│ ├─ Abaqus_Work/
│ └─ Results/
│
├─ 4x4x4/
│ ├─ batch_generate_curved_x.m
│ ├─ batch_repeat444_and_export_inp.m
│ ├─ batch_export_mat_voxel_to_stl_444.m
│ ├─ export_mat_voxel_to_abaqus_inp.m
│ ├─ export_one_mat_to_stl.m
│ ├─ export_voxel_to_stl_binary.m
│ ├─ GenerateVoxel.m
│ ├─ write_curved_x_topology.m
│ ├─ save_sample_mat.m
│ ├─ save_repeat444_mat.m
│ ├─ abaqus_batch_run_all.py
│ ├─ postprocess_summary_and_plots.py
│ ├─ batch_curved_x/
│ ├─ Output/
│ ├─ STL/
│ ├─ Abaqus_Work/
│ └─ Results/
│
├─ README.md
└─ 3D_print_note.txt
For 2x2x2:
cd('D:\Simulation\Curved_Rod_Voxel_Model\2x2x2')
batch_generate_curved_x
batch_repeat222_and_export_inp
batch_export_mat_voxel_to_stl_222For 4x4x4:
cd('D:\Simulation\Curved_Rod_Voxel_Model\4x4x4')
batch_generate_curved_x
batch_repeat444_and_export_inp
batch_export_mat_voxel_to_stl_444For 2x2x2:
Set-Location "D:\Simulation\Curved_Rod_Voxel_Model\2x2x2"
abaqus cae noGUI=abaqus_batch_run_all.pyFor 4x4x4:
Set-Location "D:\Simulation\Curved_Rod_Voxel_Model\4x4x4"
abaqus cae noGUI=abaqus_batch_run_all.pyFor 2x2x2:
Set-Location "D:\Simulation\Curved_Rod_Voxel_Model\2x2x2"
python postprocess_summary_and_plots.pyFor 4x4x4:
Set-Location "D:\Simulation\Curved_Rod_Voxel_Model\4x4x4"
python postprocess_summary_and_plots.py| Folder | Description |
|---|---|
batch_curved_x/mat/ |
Base single-cell voxel .mat samples |
batch_curved_x/topology/ |
Curved-X topology text files |
batch_curved_x/preview/ |
Preview images for selected samples |
batch_curved_x/2x2x2_mat/ |
Repeated 2x2x2 voxel .mat files |
batch_curved_x/4x4x4_mat/ |
Repeated 4x4x4 voxel .mat files |
Output/ |
Abaqus .inp files |
STL/ |
STL files for 3D printing |
Abaqus_Work/ |
Abaqus job folders and ODB files |
Results/ |
Curve CSV files, summary metrics, and figures |
| Script | Function |
|---|---|
batch_generate_curved_x.m |
Generates random curved-X voxel samples |
GenerateVoxel.m |
Converts topology definitions into voxel grids |
write_curved_x_topology.m |
Writes curved-X topology files |
save_sample_mat.m |
Saves accepted base samples |
batch_repeat222_and_export_inp.m |
Builds 2x2x2 repeated specimens and exports Abaqus .inp files |
batch_repeat444_and_export_inp.m |
Builds 4x4x4 repeated specimens and exports Abaqus .inp files |
export_mat_voxel_to_abaqus_inp.m |
Converts repeated voxel .mat files into compact Abaqus mesh-only .inp files |
batch_export_mat_voxel_to_stl_222.m |
Exports 2x2x2 STL files |
batch_export_mat_voxel_to_stl_444.m |
Exports 4x4x4 STL files |
abaqus_batch_run_all.py |
Runs Abaqus compression jobs and extracts curve CSV files |
postprocess_summary_and_plots.py |
Generates summary metrics and plots |
Modify these parameters in batch_generate_curved_x.m if needed:
targetN
nVoxel
radiusMin / radiusMax
bendMin / bendMax
densityMin / densityMax
desiredWorkersFor practical 3D printing, a thicker rod range is recommended:
radiusMin = 0.075; % approximately 3.0 mm rod diameter
radiusMax = 0.100; % approximately 4.0 mm rod diameterOriginal smaller simulation setting:
radiusMin = 0.032;
radiusMax = 0.041;% 2x2x2 branch
repeatN = [2 2 2];
% 4x4x4 branch
repeatN = [4 4 4];Default voxel size:
voxelSize = [0.25 0.25 0.25];Default compression setup:
2x2x2: H0 = 40 mm, compression displacement = -8 mm
4x4x4: H0 = 80 mm, compression displacement = -16 mm
Recommended Abaqus testing setting:
MAX_CASES = 1Run all cases after validation:
MAX_CASES = Nonepostprocess_summary_and_plots.py reads curve CSV files in Results/ and generates:
summary_metrics.csv
correlation_matrix.csv
top10_by_energy_absorption.csv
top10_by_SEA.csv
figures/
Typical curve outputs include:
*_force_displacement.csv
*_stress_strain.csv
*_all_response.csv
For STL slicing and Bambu Studio settings, see:
3D_print_note.txt
Recommended initial workflow:
1) Generate STL files from MATLAB
2) Import one STL file into Bambu Studio
3) Use TPU as the main material
4) Use PVA support if needed
5) Start with 2x2x2 specimens for faster printing tests
For practical TPU printing, the original 1.3–1.6 mm rod diameter may be too thin. A thicker 3–4 mm rod diameter range is recommended for initial fabrication tests.
2x2x2is recommended for fast simulation and printing validation.4x4x4is used for larger-scale mechanical simulation and dataset generation.- Keep Abaqus work and scratch folders on a large disk rather than the system drive.
- This voxel branch is useful as a complete reference workflow for voxel-based curved-rod lattice generation.
- For faster solid-strut stress contour generation, use the newer
CurviStrut-Latticetube-solid workflow.
Initial MATLAB–Abaqus workflow for curved-rod voxel lattice generation, 4x4x4 specimen export, Abaqus compression simulation, and automatic curve extraction.
Dual-scale simulation and 3D-printing workflow.
Main updates:
- Added separated
2x2x2and4x4x4workflows - Added STL export for 3D printing
- Added compact Abaqus
.inpexport - Added separated
Output,STL,Abaqus_Work, andResultsfolders - Added practical 3D printing note
This project is released under the MIT License.