Jump to navigation Jump to search

Geometry package

3 bytes added, 08:27, 8 March 2012
small fixes
Now we have our SVG as a polygon compatible with the Geometry package format. You can plot the polygon using the function {{Codeline|drawPolygon}}.
{{Code|Plotting a polygon compatible with geometry package|<pre>
drawPolygon (P,'"-o'");
As you can see the polygon has lots of points. We need to simplify the polygon in order to obtain a mesh of reasonable size. Otherwise gmsh will have problems meshing and the result could be huge (or a segmentation fault :( ). THe The package geometry comes with a simplification function but as of version 1.4.0, this function is very naive naïve and wont fix this problem. If you know how to simplify polygons you can contribute!
We are going to reduce the amount of points of the polygon in a drastic and destructive way (i.e. the shape may be considerably damaged). The codes to do so follows, in the future a better procedure will be published here.
{{Code|Symplification of a polygon compatible with geometry package|<pre>
{{Code|Plotting mesh with fpl package|<pre>
pkg load fpl
pdemesh (T.p, T.e, T.t);
view (2)

Navigation menu