Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
integration-cfmesh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Community
integration-cfmesh
Commits
3c8d80b9
Commit
3c8d80b9
authored
10 years ago
by
Franjo
Browse files
Options
Downloads
Patches
Plain Diff
surfaceBoundingBox can now use fms, too.
parent
483f38e1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
utilities/surfaceGenerateBoundingBox/surfaceGenerateBoundingBox.C
+21
-24
21 additions, 24 deletions
...s/surfaceGenerateBoundingBox/surfaceGenerateBoundingBox.C
with
21 additions
and
24 deletions
utilities/surfaceGenerateBoundingBox/surfaceGenerateBoundingBox.C
+
21
−
24
View file @
3c8d80b9
...
@@ -29,14 +29,14 @@ Description
...
@@ -29,14 +29,14 @@ Description
#include
"argList.H"
#include
"argList.H"
#include
"IFstream.H"
#include
"IFstream.H"
#include
"fileName.H"
#include
"fileName.H"
#include
"triSurface.H"
#include
"triSurf.H"
#include
"triSurfModifier.H"
#include
"boundBox.H"
#include
"boundBox.H"
#include
"OFstream.H"
#include
"OFstream.H"
#include
<cstdlib>
#include
<cstdlib>
#include
<sstream>
#include
<sstream>
#include
"triSurfaceDetectFeatureEdges.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
// Main program:
using
namespace
Foam
;
using
namespace
Foam
;
...
@@ -67,8 +67,9 @@ int main(int argc, char *argv[])
...
@@ -67,8 +67,9 @@ int main(int argc, char *argv[])
<<
exit
(
FatalError
);
<<
exit
(
FatalError
);
}
}
triSurface
origSurface
(
inFileName
);
triSurf
origSurface
(
inFileName
);
const
pointField
&
points
=
origSurface
.
points
();
triSurfModifier
sMod
(
origSurface
);
pointField
&
points
=
sMod
.
pointsAccess
();
const
boundBox
bb
(
points
);
const
boundBox
bb
(
points
);
...
@@ -100,36 +101,33 @@ int main(int argc, char *argv[])
...
@@ -100,36 +101,33 @@ int main(int argc, char *argv[])
//- generate bounding box points
//- generate bounding box points
const
label
nPoints
=
points
.
size
();
const
label
nPoints
=
points
.
size
();
pointField
newPoints
(
nPoints
+
8
);
points
.
setSize
(
nPoints
+
8
);
forAll
(
points
,
pointI
)
newPoints
[
pointI
]
=
points
[
pointI
];
newP
oints
[
nPoints
]
=
newBB
.
min
();
p
oints
[
nPoints
]
=
newBB
.
min
();
newP
oints
[
nPoints
+
1
]
=
p
oints
[
nPoints
+
1
]
=
point
(
newBB
.
max
().
x
(),
newBB
.
min
().
y
(),
newBB
.
min
().
z
());
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
());
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
());
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
());
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
());
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
());
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
//- generate bounding bound triangles
const
label
nTriangles
=
origSurface
.
size
();
const
label
nTriangles
=
origSurface
.
size
();
List
<
labelledTri
>
newTriangles
(
nTriangles
+
12
);
LongList
<
labelledTri
>&
newTriangles
=
sMod
.
facetsAccess
();
forAll
(
origSurface
,
triI
)
newTriangles
.
setSize
(
nTriangles
+
12
);
newTriangles
[
triI
]
=
origSurface
[
triI
];
//- create patches
//- create patches
geometricSurfacePatchList
&
newPatches
=
sMod
.
patchesAccess
();
const
label
nPatches
=
origSurface
.
patches
().
size
();
const
label
nPatches
=
origSurface
.
patches
().
size
();
geometricSurfacePatchList
newPatches
(
nPatches
+
6
);
newPatches
.
setSize
(
nPatches
+
6
);
forAll
(
origSurface
.
patches
(),
patchI
)
newPatches
[
patchI
]
=
origSurface
.
patches
()[
patchI
];
newPatches
[
nPatches
].
name
()
=
"xMin"
;
newPatches
[
nPatches
].
name
()
=
"xMin"
;
newPatches
[
nPatches
+
1
].
name
()
=
"xMax"
;
newPatches
[
nPatches
+
1
].
name
()
=
"xMax"
;
newPatches
[
nPatches
+
2
].
name
()
=
"yMin"
;
newPatches
[
nPatches
+
2
].
name
()
=
"yMin"
;
...
@@ -169,8 +167,7 @@ int main(int argc, char *argv[])
...
@@ -169,8 +167,7 @@ int main(int argc, char *argv[])
labelledTri
(
nPoints
+
4
,
nPoints
+
5
,
nPoints
+
7
,
nPatches
+
5
);
labelledTri
(
nPoints
+
4
,
nPoints
+
5
,
nPoints
+
7
,
nPatches
+
5
);
//- write the surface
//- write the surface
triSurface
newSurface
(
newTriangles
,
newPatches
,
newPoints
);
origSurface
.
writeSurface
(
outFileName
);
newSurface
.
write
(
outFileName
);
Info
<<
"End
\n
"
<<
endl
;
Info
<<
"End
\n
"
<<
endl
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment