Ruppert's algorithm: Difference between revisions

Content deleted Content added
Monkbot (talk | contribs)
m External links: Task 16: replaced (1×) / removed (0×) deprecated |dead-url= and |deadurl= with |url-status=;
Line 36:
== Pseudocode ==
 
1 '''function''' Ruppert(''points'', ''segments'', ''threshold''): '''is'''
2 ''T'' := DelaunayTriangulation(''points'');
3 ''Q'' := the set of encroached segments and poor quality triangles;
4 '''while''' ''Q'' '''is not''' empty: ''// The main loop''
5 '''ifwhile''' ''Q'' contains'''is not''' empty: a segment ''s// The main loop'':
6 insert the midpoint of'''if''' ''sQ'' intocontains a segment ''Ts'';:
7 '''else''' insert the midpoint of ''Qs'' contains poor quality triangleinto ''tT'':
8 '''ifelse''' the circumcenter of ''tQ'' encroachescontains apoor segmentquality triangle ''st'':
9 '''if''' the circumcenter addof ''st'' toencroaches a segment ''Qs'';:
10 add ''s'' to 'else'Q'':;
11 '''else''':
insert the circumcenter of ''t'' into ''T'';
12 '''end if''';
13 '''end if''';
14 update ''Q'';
15 '''end while''';
16 '''return''' ''T'';
17 '''endreturn''' Ruppert.''T''
'''end''' Ruppert.
 
== Practical usage ==