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
VTK
VTK
Commits
54b68818
Commit
54b68818
authored
Jun 28, 1994
by
Will Schroeder
Browse files
ERR: Fixed disatnce2 evaluation bug.
parent
842d5741
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Hexa.cc
View file @
54b68818
...
...
@@ -127,11 +127,13 @@ int vlHexahedron::EvaluatePosition(float x[3], float closestPoint[3],
}
else
{
if
(
pcoords
[
0
]
>=
-
1.0
&&
pcoords
[
1
]
<=
1.0
&&
pcoords
[
1
]
>=
-
1.0
&&
pcoords
[
1
]
<=
1.0
&&
pcoords
[
2
]
>=
-
1.0
&&
pcoords
[
2
]
<=
1.0
)
// shift to (0,1)
for
(
i
=
0
;
i
<
3
;
i
++
)
pcoords
[
i
]
=
0.5
*
(
pcoords
[
i
]
+
1.0
);
if
(
pcoords
[
0
]
>=
0.0
&&
pcoords
[
0
]
<=
1.0
&&
pcoords
[
1
]
>=
0.0
&&
pcoords
[
1
]
<=
1.0
&&
pcoords
[
2
]
>=
0.0
&&
pcoords
[
2
]
<=
1.0
)
{
for
(
i
=
0
;
i
<
3
;
i
++
)
pcoords
[
i
]
=
0.5
*
(
pcoords
[
i
]
+
1.0
);
// shift to (0,1)
closestPoint
[
0
]
=
x
[
0
];
closestPoint
[
1
]
=
x
[
1
];
closestPoint
[
2
]
=
x
[
2
];
dist2
=
0.0
;
// inside hexahedron
return
1
;
...
...
@@ -140,11 +142,10 @@ int vlHexahedron::EvaluatePosition(float x[3], float closestPoint[3],
{
for
(
i
=
0
;
i
<
3
;
i
++
)
{
if
(
pcoords
[
i
]
<
-
1
.0
)
pcoords
[
i
]
=
-
1
.0
;
if
(
pcoords
[
i
]
<
0
.0
)
pcoords
[
i
]
=
0
.0
;
if
(
pcoords
[
i
]
>
1.0
)
pcoords
[
i
]
=
1.0
;
}
this
->
EvaluateLocation
(
subId
,
pcoords
,
closestPoint
,
weights
);
for
(
i
=
0
;
i
<
3
;
i
++
)
pcoords
[
i
]
=
0.5
*
(
pcoords
[
i
]
+
1.0
);
// shift to (0,1)
dist2
=
math
.
Distance2BetweenPoints
(
closestPoint
,
x
);
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