Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Philip Trettner
tg-samples
Commits
c05ad188
Commit
c05ad188
authored
Feb 12, 2020
by
Julian Schakib
Browse files
corner case, currently check is disabled
parent
2582a89a
Pipeline
#13556
failed with stage
in 34 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
typed-geometry
@
c9770990
Subproject commit
b86bc12eafc2c06b37b015b3e92871dfceb9f7b4
Subproject commit
c9770990d6869740cc2f79a88727d838e382a36f
tests/feature/intersections/plane-intersect.cc
View file @
c05ad188
...
...
@@ -54,7 +54,7 @@ TG_FUZZ_TEST(Plane, Intersect)
auto
const
box
=
tg
::
aabb3
(
tg
::
pos3
(
-
10.0
f
),
tg
::
pos3
(
10.0
f
));
{
// plane and cylinder have *parallel* normals
//
cornercase:
plane and cylinder have *parallel* normals
// confirm center position and circle shape of intersection
auto
const
r
=
tg
::
uniform
(
rng
,
0.1
f
,
10.0
f
);
...
...
@@ -84,6 +84,20 @@ TG_FUZZ_TEST(Plane, Intersect)
CHECK
(
dot
(
ellipse
.
axisA
,
p
.
normal
)
==
approx
(
0
));
// orthogonal
CHECK
(
length
(
ellipse
.
axisA
)
-
length
(
ellipse
.
axisB
)
==
approx
(
0
));
}
// TODO fix this case in intersection.hh!!
// cornercase: plane normal orthogonal to cylinder normal
{
auto
const
p
=
tg
::
plane3
(
any_normal
(
d
),
center
);
// the cut should be a circle with radius r with center zero
auto
const
ellipse
=
tg
::
intersection
(
p
,
c
);
// check center, directions of normal and length
// CHECK(distance(ellipse.center, center) == approx(0));
(
void
)
ellipse
;
// TODO -nanf!!
// CHECK(length(ellipse.axisA) - length(ellipse.axisB) == approx(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