Skip to content
GitLab
Menu
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
b68cba19
Commit
b68cba19
authored
Jul 15, 1995
by
Will Schroeder
Browse files
ERR: Fixed minor distance bugs.
parent
143675ac
Changes
2
Show whitespace changes
Inline
Side-by-side
src/Quad.cc
View file @
b68cba19
...
...
@@ -159,18 +159,22 @@ int vtkQuad::EvaluatePosition(float x[3], float closestPoint[3],
if
(
pcoords
[
0
]
<
0.0
&&
pcoords
[
1
]
<
0.0
)
{
dist2
=
math
.
Distance2BetweenPoints
(
x
,
pt1
);
for
(
i
=
0
;
i
<
3
;
i
++
)
closestPoint
[
i
]
=
pt1
[
i
];
}
else
if
(
pcoords
[
0
]
>
0
.0
&&
pcoords
[
1
]
<
0.0
)
else
if
(
pcoords
[
0
]
>
1
.0
&&
pcoords
[
1
]
<
0.0
)
{
dist2
=
math
.
Distance2BetweenPoints
(
x
,
pt2
);
for
(
i
=
0
;
i
<
3
;
i
++
)
closestPoint
[
i
]
=
pt2
[
i
];
}
else
if
(
pcoords
[
0
]
>
0
.0
&&
pcoords
[
1
]
>
0
.0
)
else
if
(
pcoords
[
0
]
>
1
.0
&&
pcoords
[
1
]
>
1
.0
)
{
dist2
=
math
.
Distance2BetweenPoints
(
x
,
pt3
);
for
(
i
=
0
;
i
<
3
;
i
++
)
closestPoint
[
i
]
=
pt3
[
i
];
}
else
if
(
pcoords
[
0
]
<
0.0
&&
pcoords
[
1
]
>
0
.0
)
else
if
(
pcoords
[
0
]
<
0.0
&&
pcoords
[
1
]
>
1
.0
)
{
dist2
=
math
.
Distance2BetweenPoints
(
x
,
pt4
);
for
(
i
=
0
;
i
<
3
;
i
++
)
closestPoint
[
i
]
=
pt4
[
i
];
}
else
if
(
pcoords
[
0
]
<
0.0
)
{
...
...
@@ -184,7 +188,7 @@ int vtkQuad::EvaluatePosition(float x[3], float closestPoint[3],
{
dist2
=
line
.
DistanceToLine
(
x
,
pt1
,
pt2
,
t
,
closestPoint
);
}
else
if
(
pcoords
[
1
]
>
0
.0
)
else
if
(
pcoords
[
1
]
>
1
.0
)
{
dist2
=
line
.
DistanceToLine
(
x
,
pt3
,
pt4
,
t
,
closestPoint
);
}
...
...
src/Triangle.cc
View file @
b68cba19
...
...
@@ -110,14 +110,17 @@ int vtkTriangle::EvaluatePosition(float x[3], float closestPoint[3],
if
(
pcoords
[
0
]
<
0.0
&&
pcoords
[
1
]
<
0.0
)
{
dist2
=
math
.
Distance2BetweenPoints
(
x
,
pt3
);
for
(
i
=
0
;
i
<
3
;
i
++
)
closestPoint
[
i
]
=
pt3
[
i
];
}
else
if
(
pcoords
[
1
]
<
0.0
&&
pcoords
[
2
]
<
0.0
)
{
dist2
=
math
.
Distance2BetweenPoints
(
x
,
pt1
);
for
(
i
=
0
;
i
<
3
;
i
++
)
closestPoint
[
i
]
=
pt1
[
i
];
}
else
if
(
pcoords
[
0
]
<
0.0
&&
pcoords
[
2
]
<
0.0
)
{
dist2
=
math
.
Distance2BetweenPoints
(
x
,
pt2
);
for
(
i
=
0
;
i
<
3
;
i
++
)
closestPoint
[
i
]
=
pt2
[
i
];
}
else
if
(
pcoords
[
0
]
<
0.0
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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