Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
c1dd67b8
Commit
c1dd67b8
authored
Aug 12, 2009
by
mattijs
Browse files
if miss calculate triangle-plane intersection
parent
42082f42
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H
View file @
c1dd67b8
...
...
@@ -376,16 +376,29 @@ inline pointHit triangle<Point, PointRef>::ray
return
ray
(
p
,
q1
-
n
,
alg
,
intersection
::
VECTOR
);
}
// Intersection point with triangle plane
point
pInter
;
// Is intersection point inside triangle
bool
hit
;
{
// Reuse the fast ray intersection routine below in FULL_RAY
// mode since the original intersection routine has rounding problems.
pointHit
fastInter
=
intersection
(
p
,
q1
,
intersection
::
FULL_RAY
);
pInter
=
fastInter
.
rawPoint
();
hit
=
fastInter
.
hit
();
if
(
hit
)
{
pInter
=
fastInter
.
rawPoint
();
}
else
{
// Calculate intersection of ray with triangle plane
vector
v
=
a_
-
p
;
pInter
=
p
+
(
q1
&
v
)
*
q1
;
}
}
// Distance to intersection point
scalar
dist
=
q1
&
(
pInter
-
p
);
const
scalar
planarPointTol
=
...
...
Write
Preview
Markdown
is supported
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