46 const point& pt = pts[i];
47 os <<
"v " << pt.
x() <<
' ' << pt.
y() <<
' ' << pt.
z() <<
nl;
65 const edge&
e = edges[edgeLabels[i]];
67 os <<
"l " <<
e.start()+1 <<
' ' <<
e.
end()+1 <<
endl;
77void Foam::edgeSurface::calcPointEdges()
85 const edge&
e = edges_[edgeI];
91 forAll(pointEdges_, pointi)
93 pointEdges_[pointi].
setSize(pointNEdges[pointi]);
100 const edge&
e = edges_[edgeI];
103 pEdges0[pointNEdges[
e[0]]++] = edgeI;
106 pEdges1[pointNEdges[
e[1]]++] = edgeI;
117 const bool isFirstSurface,
121 points_(surf.
nPoints() + inter.cutPoints().size()),
122 nSurfacePoints_(surf.
nPoints()),
124 nSurfaceEdges_(surf.
nEdges()),
126 faceEdges_(surf.size()),
127 pointEdges_(points_.size())
138 points_[pointi++] = surfPoints[i];
145 points_[pointi++] = cutPoints[i];
163 const edge&
e = surfEdges[edgeI];
169 label freeNewEdgeI = allEdges.
size();
171 if (extraVerts.
empty())
186 extraVerts[0] + nSurfacePoints_
190 for (label extraI = 1; extraI < extraVerts.
size(); extraI++)
196 extraVerts[extraI-1] + nSurfacePoints_,
197 extraVerts[extraI] + nSurfacePoints_
205 extraVerts.
last() + nSurfacePoints_,
216 for (label eI = freeNewEdgeI; eI < allEdges.
size(); eI++)
218 allParentEdges.
append(edgeI);
222 allFaceEdges[myFaces[myFacei]].
append(eI);
228 nSurfaceEdges_ = allEdges.
size();
237 const edge&
e = cutEdges[i];
239 allEdges.
append(
edge(
e[0] + nSurfacePoints_,
e[1] + nSurfacePoints_));
249 const label facei = iter.key()[isFirstSurface ? 0 : 1];
252 const label edgeI = iter.val();
255 allFaceEdges[facei].
append(edgeI + nSurfaceEdges_);
260 parentEdges_.
transfer(allParentEdges);
262 forAll(allFaceEdges, facei)
264 faceEdges_[facei].
transfer(allFaceEdges[facei]);
276 Pout<<
"edgeSurface : Dumping faceEdges to files" <<
endl;
280 const labelList& fEdges = faceEdges_[facei];
282 if (fEdges.
size() != 3)
285 Pout<<
"edgeSurface : Dumping faceEdges for face " << facei
286 <<
" to " << faceFName <<
endl;
293 Pout<<
"edgeSurface : Dumping edges to edges.obj" <<
endl;
296 Pout<<
"edgeSurface : Dumping intersectionEdges to"
297 <<
" intersectionEdges.obj" <<
endl;
299 OFstream intEdgesStream(
"intersectionEdges.obj");
303 for (label edgeI = nSurfaceEdges_; edgeI < edges_.
size(); edgeI++)
305 edgeLabels[i++] = edgeI;
323 Pout<<
"Old face consisted of edges:" <<
endl;
325 const labelList& fEdges = faceEdges_[facei];
328 const edge&
e = edges_[fEdges[i]];
330 Pout<<
" " << fEdges[i] <<
' ' <<
e
331 << points_[
e.start()] <<
' ' << points_[
e.
end()] <<
endl;
336 const label oldNEdges = edges_.size();
338 edges_.setSize(oldNEdges + additionalEdges.
size());
341 label newEdgeI = oldNEdges;
343 forAll(additionalEdges, i)
345 edges_[newEdgeI] = additionalEdges[i];
353 label nFEdges = fEdges.
size();
357 forAll(additionalEdges, i)
359 fEdges[nFEdges++] = oldNEdges + i;
369 const labelList& fEdges = faceEdges_[facei];
371 Pout<<
"New face consists of edges:" <<
endl;
374 const edge&
e = edges_[fEdges[i]];
376 Pout<<
" " << fEdges[i] <<
' ' <<
e
377 << points_[
e.start()] <<
' ' << points_[
e.
end()] <<
endl;
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void append(const T &val)
Copy append an element to the end of this list.
void transfer(List< T > &list)
void setSize(const label n)
Alias for resize()
void append(const T &val)
Append an element at the end of the list.
OFstream that keeps track of vertices.
virtual Ostream & write(const char c)
Write character.
Output to file stream, using an OSstream.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
label nEdges() const
Number of edges in patch.
const edgeList & edges() const
Return list of edges, address into LOCAL point list.
const Field< point_type > & localPoints() const
Return pointField of points in patch.
const labelListList & edgeFaces() const
Return edge-face addressing.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
bool empty() const noexcept
True if the UList is empty (ie, size() is zero)
iterator end() noexcept
Return an iterator to end traversing the UList.
void size(const label n)
Older name for setAddressableSize.
T & last()
Return the last element of the list.
const Cmpt & z() const
Access to the vector z component.
const Cmpt & y() const
Access to the vector y component.
const Cmpt & x() const
Access to the vector x component.
Description of surface in form of 'cloud of edges'.
void addIntersectionEdges(const label facei, const edgeList &)
Add intersection edges to a face. Used for connecting.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
A class for handling file names.
Basic surface-surface intersection description. Constructed from two surfaces it creates a descriptio...
const edgeList & cutEdges() const
The list of created edges.
const labelListList & edgeCuts(const bool isFirstSurf) const
Access either surf1EdgeCuts (isFirstSurface = true) or.
const labelPairLookup & facePairToEdgeId() const
Lookup of pairs of faces to created edges.
const pointField & cutPoints() const
The list of cut points.
Triangulated surface description with patch information.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
OBJstream os(runTime.globalPath()/outputName)
const labelList nEdges(UPstream::listGatherValues< label >(aMesh.nEdges()))
void writeObjEdges(const UList< point > &points, const edgeList &edges, const labelList &edgeLabels, Ostream &os)
List< label > labelList
A List of labels.
static void writeObjPoints(const UList< point > &pts, Ostream &os)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static constexpr const zero Zero
Global zero (0)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIters(container, iter)
Iterate across all elements of the container object with const access.