47 const pointField& sFeatLocalPts(surf.localPoints());
48 const edgeList& sFeatEds(surf.edges());
49 const labelListList edgeFaces = PatchTools::sortedEdgeFaces(surf);
51 const labelListList pointEdges = PatchTools::sortedPointEdges(surf);
59 label nFeatEds = featureEdges.
size();
60 label nFeatPts = featurePoints.
size();
72 forAll(featurePointFeatureEdges, pI)
74 featurePointFeatureEdges[pI] = pointEdges[featurePoints[pI]];
80 labelList pointMap(sFeatLocalPts.size(), -1);
94 label sFPI = featurePoints[i];
96 tmpPts.
append(sFeatLocalPts[sFPI]);
98 pointMap[sFPI] = tmpPts.size() - 1;
102 nonFeatureStart_ = tmpPts.size();
104 bitSet isRegionFeatureEdge(regionFeatureEdges);
108 label sFEI = featureEdges[i];
112 const edge& fE = sFeatEds[sFEI];
114 edgeDirections[i] = fE.
vec(sFeatLocalPts);
117 if (pointMap[fE.
start()] == -1)
121 pointMap[fE.
start()] = tmpPts.size() - 1;
124 eds[i].start() = pointMap[fE.
start()];
126 if (pointMap[fE.
end()] == -1)
130 pointMap[fE.
end()] = tmpPts.size() - 1;
133 eds[i].end() = pointMap[fE.
end()];
136 const labelList& eFaces = edgeFaces[sFEI];
138 edgeNormals[i].
setSize(eFaces.size());
139 normalDirections[i].
setSize(eFaces.size());
143 label eFI = eFaces[j];
150 faceMap[eFI] = norms.size() - 1;
153 edgeNormals[i][j] =
faceMap[eFI];
157 surf[eFI].
centre(surf.points())
158 - sFeatLocalPts[fE.
start()];
160 normalDirections[i][j] =
164 & (fC0tofE0/(
mag(fC0tofE0)+ VSMALL))
174 if (eFaces.size() == 2)
177 surf[eFaces[1]].
centre(surf.points())
178 - surf[eFaces[0]].centre(surf.points());
181 edStatus[i] = classifyEdge(norms, edgeNormals[i], fC0tofC1);
183 if (isRegionFeatureEdge.
test(i))
192 forAll(featurePointFeatureEdges, pI)
194 const labelList& fpfe = featurePointFeatureEdges[pI];
200 const label oldEdgeIndex = fpfe[eI];
202 const label newFeatureEdgeIndex = edgeMap[oldEdgeIndex];
204 if (newFeatureEdgeIndex != -1)
206 newFeatureEdges.
append(newFeatureEdgeIndex);
210 featurePointFeatureEdges[pI].
transfer(newFeatureEdges);
226 if (eStat == EXTERNAL)
230 else if (eStat == INTERNAL)
234 else if (eStat == FLAT)
238 else if (eStat == OPEN)
242 else if (eStat == MULTIPLE)
246 else if (eStat == NONE)
249 <<
nl <<
"classifyEdge returned NONE on edge "
251 <<
". There is a problem with definition of this edge."
256 internalStart_ = externalEds.size();
257 flatStart_ = internalStart_ + internalEds.size();
258 openStart_ = flatStart_ + flatEds.size();
259 multipleStart_ = openStart_ + openEds.size();
263 ListListOps::combine<labelList>
270 edMap =
invert(edMap.size(), edMap);
279 forAll(featurePointFeatureEdges, pI)
287 edgeMesh::operator=(
edgeMesh(pts, eds));
290 edgeDirections_ = edgeDirections/(
mag(edgeDirections) + VSMALL);
291 edgeNormals_ = edgeNormals;
292 normalDirections_ = normalDirections;
293 regionEdges_ = regionEdges;
307 for (label i = 0; i < nonFeatureStart_; i++)
311 if (ptStatus == CONVEX)
315 else if (ptStatus == CONCAVE)
319 else if (ptStatus == MIXED)
323 else if (ptStatus == NONFEATURE)
326 <<
nl <<
"classifyFeaturePoint returned NONFEATURE on point at "
328 <<
". There is a problem with definition of this feature point."
333 concaveStart_ = convexPts.size();
334 mixedStart_ = concaveStart_ + concavePts.size();
338 ListListOps::combine<labelList>
345 ftPtMap =
invert(ftPtMap.size(), ftPtMap);
354 ptMap[i] = ftPtMap[i];
368 edgeMesh newmesh(std::move(pts), std::move(eds));
369 edgeMesh::transfer(newmesh);
376 for (label i = 0; i < nonFeatureStart_; i++)
380 const labelList& ptEds = edgeMesh::pointEdges()[i];
384 const labelList& ptEdNorms(edgeNormals[ptEds[j]]);
388 if (!tmpFtPtNorms.found(ptEdNorms[
k]))
390 bool addNormal =
true;
397 (normals_[ptEdNorms[
k]] & normals_[tmpFtPtNorms[q]])
410 tmpFtPtNorms.
append(ptEdNorms[
k]);
416 featurePointNormals[i] = tmpFtPtNorms;
419 featurePointNormals_ = featurePointNormals;
420 featurePointEdges_ = featurePointFeatureEdges;