Skip to content

Commit 61ed07b

Browse files
fsalmoirmtezzele
authored andcommitted
some theoretical background for ffd added to freeform class (#65)
* some theoretical background for ffd added to freeform class * missing a n in transformations
1 parent 3c4e839 commit 61ed07b

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

pygem/freeform.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,42 @@
11
"""
22
Utilities for performing Free Form Deformation (FFD)
3+
4+
:Theoretical Insight:
5+
6+
Free Form Deformation is a technique for the efficient, smooth and accurate geometrical
7+
parametrization. It has been proposed the first time in *Sederberg, Thomas W., and Scott
8+
R. Parry. "Free-form deformation of solid geometric models." ACM SIGGRAPH computer
9+
graphics 20.4 (1986): 151-160*. It consists in three different step:
10+
11+
- Mapping the physical domain to the reference one with map :math:`\\boldsymbol{\psi}`.
12+
In the code it is named *transformation*.
13+
14+
- Moving some control points to deform the lattice with :math:`\\hat{T}`.
15+
The movement of the control points is basically the weight (or displacement)
16+
:math:`\\boldsymbol{\mu}` we set in the *parameters file*.
17+
18+
- Mapping back to the physical domain with map :math:`\\boldsymbol{\psi}^-1`.
19+
In the code it is named *inverse_transformation*.
20+
21+
FFD map (:math:`T`) is the composition of the three maps, that is
22+
23+
.. math::
24+
T(\\cdot, \\boldsymbol{\\mu}) = (\\Psi^{-1} \\circ \\hat{T} \\circ \\Psi)
25+
(\\cdot, \\boldsymbol{\\mu})
26+
27+
In this way, every point inside the FFD box changes it position according to
28+
29+
.. math::
30+
\\boldsymbol{P} = \\boldsymbol{\psi}^-1 \\left( \\sum_{l=0} ^L \\sum_{m=0} ^M
31+
\\sum_{n=0} ^N \\mathsf{b}_{lmn}(\\boldsymbol{\\psi}(\\boldsymbol{P}_0))
32+
\\boldsymbol{\\mu}_{lmn} \\right)
33+
34+
where :math:`\\mathsf{b}_{lmn}` are Bernstein polynomials.
35+
We improve the traditional version by allowing a rotation of the FFD lattice in order
36+
to give more flexibility to the tool.
37+
38+
You can try to add more shapes to the lattice to allow more and more involved transformations.
39+
340
"""
441
import numpy as np
542
from scipy import special
@@ -31,6 +68,7 @@ class FFD(object):
3168
>>> free_form = ffd.FFD(ffd_parameters, original_mesh_points)
3269
>>> free_form.perform()
3370
>>> new_mesh_points = free_form.modified_mesh_points
71+
3472
"""
3573
def __init__(self, ffd_parameters, original_mesh_points):
3674
self.parameters = ffd_parameters

0 commit comments

Comments
 (0)