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
Development
openfoam
Commits
46421f7e
Commit
46421f7e
authored
Jan 04, 2012
by
laurence
Browse files
ENH: objToVTK: Add support for vertex normals (vn)
parent
d7fcc076
Changes
1
Hide whitespace changes
Inline
Side-by-side
applications/utilities/mesh/manipulation/objToVTK/objToVTK.C
View file @
46421f7e
...
...
@@ -127,6 +127,7 @@ int main(int argc, char *argv[])
// Points and lines
DynamicList
<
point
>
points
;
DynamicList
<
vector
>
pointNormals
;
DynamicList
<
labelList
>
polyLines
;
DynamicList
<
labelList
>
polygons
;
...
...
@@ -151,6 +152,14 @@ int main(int argc, char *argv[])
points
.
append
(
point
(
x
,
y
,
z
));
}
else
if
(
cmd
==
"vn"
)
{
scalar
x
,
y
,
z
;
lineStream
>>
x
>>
y
>>
z
;
pointNormals
.
append
(
vector
(
x
,
y
,
z
));
}
else
if
(
cmd
==
"l"
)
{
polyLines
.
append
(
parseVertices
(
line
));
...
...
@@ -264,6 +273,14 @@ int main(int argc, char *argv[])
}
}
outFile
<<
nl
<<
"NORMALS pointNormals float
\n
"
;
forAll
(
pointNormals
,
i
)
{
const
vector
&
n
=
pointNormals
[
i
];
outFile
<<
n
.
x
()
<<
' '
<<
n
.
y
()
<<
' '
<<
n
.
z
()
<<
nl
;
}
Info
<<
"End
\n
"
<<
endl
;
return
0
;
...
...
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