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
Christian Butz
VTK
Commits
e04f7da4
Commit
e04f7da4
authored
Oct 21, 2015
by
T.J. Corona
Browse files
in vtkLine, Assign parametric return values for colinear lines.
parent
4f679659
Changes
1
Show whitespace changes
Inline
Side-by-side
Common/DataModel/vtkLine.cxx
View file @
e04f7da4
...
...
@@ -126,6 +126,25 @@ int vtkLine::Intersection (double a1[3], double a2[3],
// Solve the system of equations
if
(
vtkMath
::
SolveLinearSystem
(
A
,
c
,
2
)
==
0
)
{
// The lines are colinear. Therefore, one of the four endpoints is the
// point of closest approach
double
minDist
=
VTK_DOUBLE_MAX
;
double
*
p
[
4
]
=
{
a1
,
a2
,
b1
,
b2
};
double
*
l1
[
4
]
=
{
b1
,
b1
,
a1
,
a1
};
double
*
l2
[
4
]
=
{
b2
,
b2
,
a2
,
a2
};
double
*
uv1
[
4
]
=
{
&
v
,
&
v
,
&
u
,
&
u
};
double
*
uv2
[
4
]
=
{
&
u
,
&
u
,
&
v
,
&
v
};
double
dist
,
t
;
for
(
unsigned
i
=
0
;
i
<
4
;
i
++
)
{
dist
=
vtkLine
::
DistanceToLine
(
p
[
i
],
l1
[
i
],
l2
[
i
],
t
);
if
(
dist
<
minDist
)
{
minDist
=
dist
;
*
(
uv1
[
i
])
=
t
;
*
(
uv2
[
i
])
=
static_cast
<
double
>
(
i
%
2
);
}
}
return
VTK_ON_LINE
;
}
else
...
...
@@ -875,4 +894,3 @@ void vtkLine::PrintSelf(ostream& os, vtkIndent indent)
{
this
->
Superclass
::
PrintSelf
(
os
,
indent
);
}
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