chiark
/
gitweb
/
~ian
/
moebius2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4d2ac73
)
report on degenerate facets
author
Ian Jackson
<ian@davenant.relativity.greenend.org.uk>
Mon, 18 Feb 2008 00:34:38 +0000
(
00:34
+0000)
committer
Ian Jackson
<ian@davenant.relativity.greenend.org.uk>
Mon, 18 Feb 2008 00:34:38 +0000
(
00:34
+0000)
output.c
patch
|
blob
|
history
diff --git
a/output.c
b/output.c
index d6eb877badd66576589725bc405951cff2f3fe9f..b9bad149a09aafd446e706420833ee464c78b3bf 100644
(file)
--- a/
output.c
+++ b/
output.c
@@
-423,6
+423,7
@@
assert(d >= -1e3 && d <= 1e3);
static uint32_t noutfacets;
static uint32_t noutfacets_counted;
static uint32_t noutfacets;
static uint32_t noutfacets_counted;
+static long badfacets;
static void outfacet(int rev, const OutVertex *a,
const OutVertex *b, const OutVertex *c) {
static void outfacet(int rev, const OutVertex *a,
const OutVertex *b, const OutVertex *c) {
@@
-440,8
+441,10
@@
static void outfacet(int rev, const OutVertex *a,
triangle_normal(normal, a->p, b->p, c->p);
double multby= 1/magnD(normal);
triangle_normal(normal, a->p, b->p, c->p);
double multby= 1/magnD(normal);
- if (multby > 1e6)
+ if (multby > 1e6) {
+ badfacets++;
return;
return;
+ }
noutfacets++;
if (!~noutfacets_counted) return;
noutfacets++;
if (!~noutfacets_counted) return;
@@
-474,6
+477,11
@@
static void write_file(void) {
assert(noutfacets == noutfacets_counted);
if (fflush(stdout)) diee("fflush stdout");
assert(noutfacets == noutfacets_counted);
if (fflush(stdout)) diee("fflush stdout");
+
+ if (badfacets) {
+ fprintf(stderr,"%ld degenerate facets!\n",badfacets);
+ exit(4);
+ }
}
}