KinDrape

A simple and compact kinematic draping algorithm.
42 Downloads
Updated 13 Apr 2022
This project is about a simple implementation of a kinematic draping algorithm developed for fiber-reinforced composites and described in the journal paper:
Krogh, C., Bak, B.L.V., Lindgaard, E. et al. A simple MATLAB draping code for fiber-reinforced composites with application to optimization of manufacturing process parameters. Struct Multidisc Optim (2021). https://doi.org/10.1007/s00158-021-02925-z
The paper can be accessed in a free read-only version at: https://rdcu.be/clPiQ
Given a mold definition (either in the form of a point cloud or an analytical expression), dimensions of the fabric/ply to be draped and some draping parameters, the main code will predict the draped fabric/ply pattern on the mold under kinematic assumptions. A second code included can be used to optimize the draping pattern. Please refer to the paper for a more elaborate description. The function input/output are also briefly described below.
Various versions of the codes are available with this submission and are organized in the following folders:
  • Original code from paper (the original MATLAB version presented in the paper)
  • Code with improved effiency (a more efficient version of the original code)
Original code from the paper
This folder contains the following files from the journal paper:
  1. KinDrape.m (original draping code, Appendix A of the paper).
  2. KinDrapeOptimization.m (optimization script, Appendix B of the paper)
  3. KinDrape_with_ext.m (original draping code with extensions from Sec. 4.1-4.3 implemented).
Code with improved effiency
This folder contains the following files:
  1. KinDrape_eff.m (an updated and more efficient version of the original draping code, KinDrape)
The updates concern the method for locating constrained nodes in Step 3. As discussed in the journal paper, it can be done more efficiently by setting up two spheres, centered in vertex 2 and vertex 4, respectively and with a radius equal to the discretization distance, d. The two spheres will intersect in a circle and the problem of locating vertex 3 thus reduces to finding the intersection between the intersection circle and the mold surface. This is achieved with a simple bi-section algorithm. The bi-section method is also being used to locate the second node in Step 1. The new additions are implemented in a new auxiliary function, MoldCircIntersecFun.
Also, the PreShear angle has been included in the initial guess for the first cell in arm 1 and 3 in Step 2 (l. 20), which adds robustness for high values of pre-shear angles.
Brief overview of input and output
Input parameters to KinDrape:
  • d: discretization distance (scalar)
  • Grid: Dimensions of fabric grid (two-component vector with number of rows and columns)
  • Org: x,y origin point on mold (two-component vector with x,y)
  • Ang: Initial draping direction rel. to y-axis in degrees (scalar)
  • OrgNode: Origin node of grid (two-component vector with row and column)
The following two inputs are implemented with the extensions of the code
  • PreShear: Pre-shear angle in degrees (scalar)
  • Plt: Variable to enable/disable plotting (true/false)
Output parameters from KinDrape:
  • Node: 3D array with computed grid nodes (first two dimensions correspond to the location in the grid as row/column and the third dimension/page contains x,y,z-coordinates)
  • P: 3D array with data for plotting the draped cells as colored patches (the first dimension is the cell number, the second dimension is the vertices 1-4 of each cell and the third dimension has three coordinates and a shear angle)
Draping on the hemisphere mold in the original code can e.g. be executed as:
KinDrape(0.08,[24 24],-[0.04 0.04],0,[12 12]);
or
KinDrape(0.08,[24 24],[0.0 -0.9],60,[3 3]);
Please note that the main focus was to create a simple program with few lines of code that can be used for educational purposes together with the journal paper.
---
The code was developed at Department of Materials and Production at Aalborg University, Denmark by Christian Krogh, Brian L.V. Bak, Esben Lindgaard, Asbjørn M. Olesen, Sebastian M. Hermansen, Peter H. Broberg, Jørgen A. Kepler, Erik Lund, and Johnny Jakobsen.
Please feel free to use and adapt the codes but remember to give proper attribution, i.e. cite the journal paper and the code's DOI number: 10.5281/zenodo.4316860

Cite As

Krogh, Christian, et al. KinDrape. Zenodo, 2020, doi:10.5281/ZENODO.4316860.

View more styles
MATLAB Release Compatibility
Created with R2019b
Compatible with R2017b and later releases
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Code with improved efficiency

Octave implementation

Original code from paper

Versions that use the GitHub default branch cannot be downloaded

Version Published Release Notes
1.0.1

Updated description

1.0.0

To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.