Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Community
integration-cfmesh
Commits
2cd934d4
Commit
2cd934d4
authored
Jun 02, 2015
by
Franjo
Browse files
Merge branch 'enhancement-surfaceUtilities' into developmentPublicRepo
parents
d4448723
3c8d80b9
Changes
1
Hide whitespace changes
Inline
Side-by-side
utilities/surfaceGenerateBoundingBox/surfaceGenerateBoundingBox.C
View file @
2cd934d4
...
...
@@ -29,14 +29,14 @@ Description
#include
"argList.H"
#include
"IFstream.H"
#include
"fileName.H"
#include
"triSurface.H"
#include
"triSurf.H"
#include
"triSurfModifier.H"
#include
"boundBox.H"
#include
"OFstream.H"
#include
<cstdlib>
#include
<sstream>
#include
"triSurfaceDetectFeatureEdges.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
using
namespace
Foam
;
...
...
@@ -67,8 +67,9 @@ int main(int argc, char *argv[])
<<
exit
(
FatalError
);
}
triSurface
origSurface
(
inFileName
);
const
pointField
&
points
=
origSurface
.
points
();
triSurf
origSurface
(
inFileName
);
triSurfModifier
sMod
(
origSurface
);
pointField
&
points
=
sMod
.
pointsAccess
();
const
boundBox
bb
(
points
);
...
...
@@ -100,36 +101,33 @@ int main(int argc, char *argv[])
//- generate bounding box points
const
label
nPoints
=
points
.
size
();
pointField
newPoints
(
nPoints
+
8
);
forAll
(
points
,
pointI
)
newPoints
[
pointI
]
=
points
[
pointI
];
points
.
setSize
(
nPoints
+
8
);
newP
oints
[
nPoints
]
=
newBB
.
min
();
newP
oints
[
nPoints
+
1
]
=
p
oints
[
nPoints
]
=
newBB
.
min
();
p
oints
[
nPoints
+
1
]
=
point
(
newBB
.
max
().
x
(),
newBB
.
min
().
y
(),
newBB
.
min
().
z
());
newP
oints
[
nPoints
+
2
]
=
p
oints
[
nPoints
+
2
]
=
point
(
newBB
.
min
().
x
(),
newBB
.
max
().
y
(),
newBB
.
min
().
z
());
newP
oints
[
nPoints
+
3
]
=
p
oints
[
nPoints
+
3
]
=
point
(
newBB
.
max
().
x
(),
newBB
.
max
().
y
(),
newBB
.
min
().
z
());
newP
oints
[
nPoints
+
4
]
=
p
oints
[
nPoints
+
4
]
=
point
(
newBB
.
min
().
x
(),
newBB
.
min
().
y
(),
newBB
.
max
().
z
());
newP
oints
[
nPoints
+
5
]
=
p
oints
[
nPoints
+
5
]
=
point
(
newBB
.
max
().
x
(),
newBB
.
min
().
y
(),
newBB
.
max
().
z
());
newP
oints
[
nPoints
+
6
]
=
p
oints
[
nPoints
+
6
]
=
point
(
newBB
.
min
().
x
(),
newBB
.
max
().
y
(),
newBB
.
max
().
z
());
newP
oints
[
nPoints
+
7
]
=
newBB
.
max
();
p
oints
[
nPoints
+
7
]
=
newBB
.
max
();
//- generate bounding bound triangles
const
label
nTriangles
=
origSurface
.
size
();
List
<
labelledTri
>
newTriangles
(
nTriangles
+
12
);
forAll
(
origSurface
,
triI
)
newTriangles
[
triI
]
=
origSurface
[
triI
];
LongList
<
labelledTri
>&
newTriangles
=
sMod
.
facetsAccess
();
newTriangles
.
setSize
(
nTriangles
+
12
);
//- create patches
geometricSurfacePatchList
&
newPatches
=
sMod
.
patchesAccess
();
const
label
nPatches
=
origSurface
.
patches
().
size
();
geometricSurfacePatchList
newPatches
(
nPatches
+
6
);
forAll
(
origSurface
.
patches
(),
patchI
)
newPatches
[
patchI
]
=
origSurface
.
patches
()[
patchI
];
newPatches
.
setSize
(
nPatches
+
6
);
newPatches
[
nPatches
].
name
()
=
"xMin"
;
newPatches
[
nPatches
+
1
].
name
()
=
"xMax"
;
newPatches
[
nPatches
+
2
].
name
()
=
"yMin"
;
...
...
@@ -169,8 +167,7 @@ int main(int argc, char *argv[])
labelledTri
(
nPoints
+
4
,
nPoints
+
5
,
nPoints
+
7
,
nPatches
+
5
);
//- write the surface
triSurface
newSurface
(
newTriangles
,
newPatches
,
newPoints
);
newSurface
.
write
(
outFileName
);
origSurface
.
writeSurface
(
outFileName
);
Info
<<
"End
\n
"
<<
endl
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment