|
18 | 18 | "cell_type": "markdown",
|
19 | 19 | "metadata": {},
|
20 | 20 | "source": [
|
21 |
| - "In this tutorial we will show the typical workflow. In particular we are going to parse the parameters file for the FFD, read an iges file of a cylinder, perform the FFD and write the results on a new iges file. We also provide the example of the show function which is not present in tutorial 1." |
| 21 | + "In this tutorial we will show the typical workflow. In particular we are going to parse the parameters file for the FFD, read an iges file of a cylinder, perform the FFD and write the results on a new iges file. We also provide the example of the `show` function which is not present in [Tutorial 1](https://github.com/mathLab/PyGeM/tutorials/tutorial-1-stl.ipynb)." |
22 | 22 | ]
|
23 | 23 | },
|
24 | 24 | {
|
25 | 25 | "cell_type": "markdown",
|
26 | 26 | "metadata": {},
|
27 | 27 | "source": [
|
28 |
| - "First of all we just import pygem package and we read a parameters file." |
| 28 | + "First of all we just import the required PyGeM classes and we read a parameters file." |
29 | 29 | ]
|
30 | 30 | },
|
31 | 31 | {
|
32 | 32 | "cell_type": "code",
|
33 | 33 | "execution_count": 1,
|
34 |
| - "metadata": { |
35 |
| - "collapsed": false |
36 |
| - }, |
| 34 | + "metadata": {}, |
37 | 35 | "outputs": [],
|
38 | 36 | "source": [
|
39 |
| - "import pygem as pg\n", |
| 37 | + "from pygem import FFDParameters, FFD, IgesHandler\n", |
40 | 38 | "\n",
|
41 |
| - "params = pg.params.FFDParameters()\n", |
| 39 | + "params = FFDParameters()\n", |
42 | 40 | "params.read_parameters(filename='../tests/test_datasets/parameters_test_ffd_iges.prm')"
|
43 | 41 | ]
|
44 | 42 | },
|
45 | 43 | {
|
46 | 44 | "cell_type": "markdown",
|
47 | 45 | "metadata": {},
|
48 | 46 | "source": [
|
49 |
| - "Now we have to load the iges file on which we will perform the FFD. Since it is an iges we use the IgesHandler() class. The parse method extract the control points (or poles) coordinate of the NURBS surfaces that represent each face of the iges geometry without touching the topology." |
| 47 | + "Now we have to load the iges file on which we will perform the FFD. Since it is an iges we use the `IgesHandler` class. The `parse` method extracts the control points (or poles) coordinate of the NURBS surfaces that represent each face of the iges geometry without touching the topology." |
50 | 48 | ]
|
51 | 49 | },
|
52 | 50 | {
|
53 | 51 | "cell_type": "code",
|
54 | 52 | "execution_count": 2,
|
55 |
| - "metadata": { |
56 |
| - "collapsed": false |
57 |
| - }, |
| 53 | + "metadata": {}, |
58 | 54 | "outputs": [],
|
59 | 55 | "source": [
|
60 |
| - "iges_handler = pg.igeshandler.IgesHandler()\n", |
| 56 | + "iges_handler = IgesHandler()\n", |
61 | 57 | "mesh_points = iges_handler.parse('../tests/test_datasets/test_pipe.iges')"
|
62 | 58 | ]
|
63 | 59 | },
|
|
79 | 75 | "\n",
|
80 | 76 | "For some \"backend\" issues we can show only one shape for session. Be careful when you try to show many geometries in the same script.\n",
|
81 | 77 | "\n",
|
82 |
| - "Finally we can actually perform the FFD with the freeform module and then we can write the modified iges file with the new control points (or poles)." |
| 78 | + "Finally we can actually perform the FFD and then we can write the modified iges file with the new control points (or poles)." |
83 | 79 | ]
|
84 | 80 | },
|
85 | 81 | {
|
86 | 82 | "cell_type": "code",
|
87 | 83 | "execution_count": 3,
|
88 |
| - "metadata": { |
89 |
| - "collapsed": false |
90 |
| - }, |
| 84 | + "metadata": {}, |
91 | 85 | "outputs": [],
|
92 | 86 | "source": [
|
93 |
| - "free_form = pg.freeform.FFD(params, mesh_points)\n", |
| 87 | + "free_form = FFD(params, mesh_points)\n", |
94 | 88 | "free_form.perform()\n",
|
95 | 89 | "new_mesh_points = free_form.modified_mesh_points\n",
|
96 | 90 | "\n",
|
|
114 | 108 | {
|
115 | 109 | "cell_type": "code",
|
116 | 110 | "execution_count": 4,
|
117 |
| - "metadata": { |
118 |
| - "collapsed": false |
119 |
| - }, |
| 111 | + "metadata": {}, |
120 | 112 | "outputs": [],
|
121 | 113 | "source": [
|
122 | 114 | "iges_handler.write(new_mesh_points, 'test_pipe_mod.iges', 1e-3)"
|
|
150 | 142 | "name": "python",
|
151 | 143 | "nbconvert_exporter": "python",
|
152 | 144 | "pygments_lexer": "ipython2",
|
153 |
| - "version": "2.7.10" |
| 145 | + "version": "2.7.13" |
154 | 146 | }
|
155 | 147 | },
|
156 | 148 | "nbformat": 4,
|
157 |
| - "nbformat_minor": 0 |
| 149 | + "nbformat_minor": 1 |
158 | 150 | }
|
0 commit comments