-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMesh_3_2mesh_polyhedral_complex_8cpp-example.html
284 lines (282 loc) · 17.7 KB
/
Mesh_3_2mesh_polyhedral_complex_8cpp-example.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="canonical" href="https://doc.cgal.org/latest/Mesh_3/Mesh_3_2mesh_polyhedral_complex_8cpp-example.html"/>
<link rel="icon" type="image/png" href="../Manual/g-196x196-doc.png">
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=11">
<meta name="generator" content="Doxygen 1.9.6">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>CGAL 6.1 - 3D Mesh Generation: Mesh_3/mesh_polyhedral_complex.cpp</title>
<!-- <link href="../Manual/tabs.css" rel="stylesheet" type="text/css"/> -->
<script type="text/javascript" src="../Manual/jquery.js"></script>
<script type="text/javascript" src="../Manual/dynsections.js"></script>
<script src="../Manual/hacks.js" type="text/javascript"></script>
<!-- Manually include treeview and search to avoid bloat and to fix
paths to the directory Manual . -->
<!-- $.treeview -->
<!-- $.search -->
<link href="navtree.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="../Manual/resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</script>
<link href="../Manual/search/search.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="../Manual/search/searchdata.js"></script>
<script type="text/javascript" src="../Manual/search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="../Manual/search/search.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="../Manual/search/search.js"></script>
<!-- Manually done below. -->
<link href="../Manual/doxygen.css" rel="stylesheet" type="text/css">
<link href="../Manual/cgal_stylesheet.css" rel="stylesheet" type="text/css">
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
//<![CDATA[
MathJax.Hub.Config(
{
TeX: {
Macros: {
qprel: [ "{\\gtreqless}", 0],
qpx: [ "{\\mathbf{x}}", 0],
qpl: [ "{\\mathbf{l}}", 0],
qpu: [ "{\\mathbf{u}}", 0],
qpc: [ "{\\mathbf{c}}", 0],
qpb: [ "{\\mathbf{b}}", 0],
qpy: [ "{\\mathbf{y}}", 0],
qpw: [ "{\\mathbf{w}}", 0],
qplambda: [ "{\\mathbf{\\lambda}}", 0],
ssWpoint: [ "{\\bf #1}", 1],
ssWeight: [ "{w_{#1}}", 1],
dabs: [ "{\\parallel\\! #1 \\!\\parallel}", 1],
E: [ "{\\mathrm{E}}", 0],
A: [ "{\\mathrm{A}}", 0],
R: [ "{\\mathrm{R}}", 0],
N: [ "{\\mathrm{N}}", 0],
Q: [ "{\\mathrm{Q}}", 0],
Z: [ "{\\mathrm{Z}}", 0],
ccSum: [ "{\\sum_{#1}^{#2}{#3}}", 3],
ccProd: [ "{\\prod_{#1}^{#2}{#3}}", 3],
pyr: [ "{\\operatorname{Pyr}}", 0],
aff: [ "{\\operatorname{aff}}", 0],
Ac: [ "{\\cal A}", 0],
Sc: [ "{\\cal S}", 0],
},
equationNumbers: { autoNumber: "AMS" }
}
}
);
MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
var PARSE = MathJax.InputJax.TeX.Parse,
TEXT = PARSE.prototype.InternalText;
PARSE.Augment({
InternalText: function (text,def) {
text = text.replace(/\\/g,"");
return TEXT.call(this,text,def);
}
});
});
//]]>
</script>
<script type="text/javascript" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js"></script>
<script src="modules.js" type="text/javascript"></script>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="back-nav">
<ul>
<li><a href="https://www.cgal.org/">cgal.org</a></li>
<li><a href="../Manual/index.html">Top</a></li>
<li><a href="../Manual/general_intro.html">Getting Started</a></li>
<li><a href="../Manual/tutorials.html">Tutorials</a></li>
<li><a href="../Manual/packages.html">Package Overview</a></li>
<li><a href="../Manual/how_to_cite_cgal.html">Acknowledging CGAL</a></li>
</ul>
<!-- In a package SEARCHENGINE = false, so we cannot use
insertion. That's why we have to do it manually here. Notice
that we also take pngs from the Manual. -->
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<span id="MSearchSelect" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()">
</span>
<input type="text" id="MSearchField" value="" placeholder="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)">
</span>
<span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="../Manual/search/close.svg" alt=""></a>
</span>
</div>
</div>
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">CGAL 6.1 - 3D Mesh Generation
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Code below is usually inserted by doxygen when SEARCHENGINE =
true. Notice that the path to the search directory is adjusted to
the top-level.-->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../Manual/search/",'.html');
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.6 -->
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync" style="display: none"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
$(document).ready(function(){initNavTree('Mesh_3_2mesh_polyhedral_complex_8cpp-example.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<div class="header">
<div class="headertitle"><div class="title">Mesh_3/mesh_polyhedral_complex.cpp</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><span class="preprocessor">#include <CGAL/Exact_predicates_inexact_constructions_kernel.h></span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include <CGAL/Mesh_triangulation_3.h></span></div>
<div class="line"><span class="preprocessor">#include <CGAL/Mesh_complex_3_in_triangulation_3.h></span></div>
<div class="line"><span class="preprocessor">#include <CGAL/Mesh_criteria_3.h></span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include <CGAL/Polyhedral_complex_mesh_domain_3.h></span></div>
<div class="line"><span class="preprocessor">#include <CGAL/make_mesh_3.h></span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include <cstdlib></span></div>
<div class="line"><span class="preprocessor">#include <cassert></span></div>
<div class="line"> </div>
<div class="line"><span class="comment">// Domain</span></div>
<div class="line"><span class="keyword">typedef</span> <a id="_a0" name="_a0"></a><a class="code hl_classRef" href="../Kernel_23/classCGAL_1_1Exact__predicates__inexact__constructions__kernel.html">CGAL::Exact_predicates_inexact_constructions_kernel</a> K;</div>
<div class="line"><span class="keyword">typedef</span> <a id="_a1" name="_a1"></a><a class="code hl_classRef" href="../Manual/classunspecified__type.html">CGAL::Mesh_polyhedron_3<K>::type</a> Polyhedron;</div>
<div class="line"><span class="keyword">typedef</span> <a id="_a2" name="_a2"></a><a class="code hl_class" href="classCGAL_1_1Polyhedral__complex__mesh__domain__3.html">CGAL::Polyhedral_complex_mesh_domain_3<K></a> Mesh_domain;</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#ifdef CGAL_CONCURRENT_MESH_3</span></div>
<div class="line"><span class="keyword">typedef</span> <a id="_a3" name="_a3"></a><a class="code hl_structRef" href="../STL_Extension/structCGAL_1_1Parallel__tag.html">CGAL::Parallel_tag</a> Concurrency_tag;</div>
<div class="line"><span class="preprocessor">#else</span></div>
<div class="line"><span class="keyword">typedef</span> <a id="_a4" name="_a4"></a><a class="code hl_structRef" href="../STL_Extension/structCGAL_1_1Sequential__tag.html">CGAL::Sequential_tag</a> Concurrency_tag;</div>
<div class="line"><span class="preprocessor">#endif</span></div>
<div class="line"> </div>
<div class="line"><span class="comment">// Triangulation</span></div>
<div class="line"><span class="keyword">typedef</span> <a class="code hl_classRef" href="../Manual/classunspecified__type.html">CGAL::Mesh_triangulation_3<Mesh_domain,CGAL::Default,Concurrency_tag>::type</a> Tr;</div>
<div class="line"> </div>
<div class="line"><span class="keyword">typedef</span> <a id="_a5" name="_a5"></a><a class="code hl_classRef" href="../SMDS_3/classCGAL_1_1Mesh__complex__3__in__triangulation__3.html">CGAL::Mesh_complex_3_in_triangulation_3</a><</div>
<div class="line"> Tr,Mesh_domain::Corner_index,Mesh_domain::Curve_index> C3t3;</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Criteria</span></div>
<div class="line"><span class="keyword">typedef</span> <a id="_a6" name="_a6"></a><a class="code hl_class" href="classCGAL_1_1Mesh__criteria__3.html">CGAL::Mesh_criteria_3<Tr></a> Mesh_criteria;</div>
<div class="line"> </div>
<div class="line"><span class="keyword">namespace </span>params = <a class="code hl_namespaceRef" href="../STL_Extension/namespaceCGAL_1_1parameters.html">CGAL::parameters</a>;</div>
<div class="line"> </div>
<div class="line"><span class="keyword">const</span> <span class="keywordtype">char</span>* <span class="keyword">const</span> filenames[] = {</div>
<div class="line"> <span class="stringliteral">"meshes/patch-01.off"</span>,</div>
<div class="line"> <span class="stringliteral">"meshes/patch-13.off"</span>,</div>
<div class="line"> <span class="stringliteral">"meshes/patch-20.off"</span>,</div>
<div class="line"> <span class="stringliteral">"meshes/patch-21.off"</span>,</div>
<div class="line"> <span class="stringliteral">"meshes/patch-23.off"</span>,</div>
<div class="line"> <span class="stringliteral">"meshes/patch-30.off"</span></div>
<div class="line">};</div>
<div class="line"> </div>
<div class="line"><span class="keyword">const</span> std::pair<int, int> incident_subdomains[] = {</div>
<div class="line"> std::make_pair(0, 1),</div>
<div class="line"> std::make_pair(1, 3),</div>
<div class="line"> std::make_pair(2, 0),</div>
<div class="line"> std::make_pair(2, 1),</div>
<div class="line"> std::make_pair(2, 3),</div>
<div class="line"> std::make_pair(3, 0),</div>
<div class="line">};</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> main()</div>
<div class="line">{</div>
<div class="line"> <span class="keyword">const</span> std::size_t nb_patches = <span class="keyword">sizeof</span>(filenames) / <span class="keyword">sizeof</span>(<span class="keyword">const</span> <span class="keywordtype">char</span>*);</div>
<div class="line"> assert(<span class="keyword">sizeof</span>(incident_subdomains) == nb_patches * <span class="keyword">sizeof</span>(std::pair<int, int>));</div>
<div class="line"> std::vector<Polyhedron> patches(nb_patches);</div>
<div class="line"> <span class="keywordflow">for</span>(std::size_t i = 0; i < nb_patches; ++i) {</div>
<div class="line"> std::ifstream input(<a id="a7" name="a7"></a><a class="code hl_functionRef" href="../Manual/namespaceCGAL.html#acdae9a147ad2a3998cc21f88bc292dac">CGAL::data_file_path</a>(filenames[i]));</div>
<div class="line"> <span class="keywordflow">if</span>(!(input >> patches[i])) {</div>
<div class="line"> std::cerr << <span class="stringliteral">"Error reading "</span> << <a class="code hl_functionRef" href="../Manual/namespaceCGAL.html#acdae9a147ad2a3998cc21f88bc292dac">CGAL::data_file_path</a>(filenames[i]) << <span class="stringliteral">" as a polyhedron!\n"</span>;</div>
<div class="line"> <span class="keywordflow">return</span> EXIT_FAILURE;</div>
<div class="line"> }</div>
<div class="line"> }</div>
<div class="line"> <span class="comment">// Create domain</span></div>
<div class="line"> Mesh_domain domain(patches.begin(), patches.end(),</div>
<div class="line"> incident_subdomains, incident_subdomains+nb_patches);</div>
<div class="line"> </div>
<div class="line"> domain.detect_features(); <span class="comment">//includes detection of borders</span></div>
<div class="line"> </div>
<div class="line"> <span class="comment">// Mesh criteria</span></div>
<div class="line"> Mesh_criteria criteria(params::edge_size(8).</div>
<div class="line"> facet_angle(25).facet_size(8).facet_distance(0.2).</div>
<div class="line"> cell_radius_edge_ratio(3).cell_size(10));</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// Mesh generation</span></div>
<div class="line"> C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria);</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// Output</span></div>
<div class="line"> std::ofstream medit_file(<span class="stringliteral">"out.mesh"</span>);</div>
<div class="line"> <a id="a8" name="a8"></a><a class="code hl_functionRef" href="../SMDS_3/group__PkgSMDS3IOFunctions.html#ga9e9fc0fac6919241501c228e438fa2b2">CGAL::IO::write_MEDIT</a>(medit_file, c3t3);</div>
<div class="line"> medit_file.close();</div>
<div class="line"> </div>
<div class="line"> <span class="keywordflow">return</span> EXIT_SUCCESS;</div>
<div class="line">}</div>
<div class="ttc" id="aclassCGAL_1_1Exact__predicates__inexact__constructions__kernel_html"><div class="ttname"><a href="../Kernel_23/classCGAL_1_1Exact__predicates__inexact__constructions__kernel.html">CGAL::Exact_predicates_inexact_constructions_kernel</a></div></div>
<div class="ttc" id="aclassCGAL_1_1Mesh__complex__3__in__triangulation__3_html"><div class="ttname"><a href="../SMDS_3/classCGAL_1_1Mesh__complex__3__in__triangulation__3.html">CGAL::Mesh_complex_3_in_triangulation_3</a></div></div>
<div class="ttc" id="aclassCGAL_1_1Mesh__criteria__3_html"><div class="ttname"><a href="classCGAL_1_1Mesh__criteria__3.html">CGAL::Mesh_criteria_3</a></div><div class="ttdoc">The class gathers the refinement criteria for mesh tetrahedra and surface facets where surface facets...</div><div class="ttdef"><b>Definition:</b> Mesh_criteria_3.h:186</div></div>
<div class="ttc" id="aclassCGAL_1_1Polyhedral__complex__mesh__domain__3_html"><div class="ttname"><a href="classCGAL_1_1Polyhedral__complex__mesh__domain__3.html">CGAL::Polyhedral_complex_mesh_domain_3</a></div><div class="ttdoc">The class Polyhedral_complex_mesh_domain_3 implements a domain defined by a collection of polyhedral ...</div><div class="ttdef"><b>Definition:</b> Polyhedral_complex_mesh_domain_3.h:120</div></div>
<div class="ttc" id="aclassunspecified__type_html"><div class="ttname"><a href="../Manual/classunspecified__type.html">unspecified_type</a></div></div>
<div class="ttc" id="agroup__PkgSMDS3IOFunctions_html_ga9e9fc0fac6919241501c228e438fa2b2"><div class="ttname"><a href="../SMDS_3/group__PkgSMDS3IOFunctions.html#ga9e9fc0fac6919241501c228e438fa2b2">CGAL::IO::write_MEDIT</a></div><div class="ttdeci">void write_MEDIT(std::ostream &os, const T3 &t3, const NamedParameters &np=parameters::default_values())</div></div>
<div class="ttc" id="anamespaceCGAL_1_1parameters_html"><div class="ttname"><a href="../STL_Extension/namespaceCGAL_1_1parameters.html">CGAL::parameters</a></div></div>
<div class="ttc" id="anamespaceCGAL_html_acdae9a147ad2a3998cc21f88bc292dac"><div class="ttname"><a href="../Manual/namespaceCGAL.html#acdae9a147ad2a3998cc21f88bc292dac">CGAL::data_file_path</a></div><div class="ttdeci">std::string data_file_path(const std::string &filename)</div></div>
<div class="ttc" id="astructCGAL_1_1Parallel__tag_html"><div class="ttname"><a href="../STL_Extension/structCGAL_1_1Parallel__tag.html">CGAL::Parallel_tag</a></div></div>
<div class="ttc" id="astructCGAL_1_1Sequential__tag_html"><div class="ttname"><a href="../STL_Extension/structCGAL_1_1Sequential__tag.html">CGAL::Sequential_tag</a></div></div>
</div><!-- fragment --> </div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.9.6-->
<!-- start footer part -->
<!-- The footer div is not part of the default but we require it to
move the footer to the bottom of the page. -->
<div id="footer">
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"></a> 1.9.6 </li>
</ul>
</div>
</div>
</body>
</html>