Changes

Jump to navigation Jump to search

Geometry package

361 bytes added, 08:37, 8 March 2012
n = 1e6;
thrsd = 0.38;
while n>size (Ps,1)
n = size (Ps,1);
ds = sqrt (sumsq (Ps(1:end,:) - Ps([2:end 1],:),2));
Ps = Ps(ds>mean (ds)*(1-thrsd),:);
end
whos P Ps
<!-- </syntaxhighlight> -->
After this code finishes, the structure T contains our mesh. To plot the generated mesh we use the function {{Codeline|pdemesh}} from the {{Forge|fpl}} package. In general is a good idea to use the openGL render (called ''fltk'') to plot meshes.
{{Code|Plotting mesh with fpl package|<pre>
pkg load fpl
graphics_toolkit('fltk')pdemesh (T.p, T.e, T.t);view (2)axis tightaxis equal
</pre>}}
The output should look something like this
[[File:octave_meshed.png|600x400px|center]]
 
Questions? Ideas? Join us in the mailing list of in the IRC channel.
 
[[File:octave_meshed.png|200px|center]]
=== From piece-wise polynomial shapes to polygons ===
651

edits

Navigation menu