| 39 |
|
|
| 40 |
|
double mincusize; /* minimum cube size from resolu */ |
| 41 |
|
|
| 42 |
+ |
int (*addobjnotify[])() = {NULL}; /* new object notifier functions */ |
| 43 |
|
|
| 44 |
+ |
|
| 45 |
|
main(argc, argv) /* convert object files to an octree */ |
| 46 |
|
int argc; |
| 47 |
|
char **argv; |
| 203 |
|
|
| 204 |
|
in = (*ofun[objptr(obj)->otype].funp)(objptr(obj), cu); |
| 205 |
|
|
| 206 |
< |
if (!in) |
| 206 |
> |
if (in == O_MISS) |
| 207 |
|
return; /* no intersection */ |
| 208 |
|
|
| 209 |
|
if (istree(cu->cutree)) { |
| 230 |
|
objset(oset, cu->cutree); |
| 231 |
|
cukid.cusize = cu->cusize * 0.5; |
| 232 |
|
|
| 233 |
< |
if (in == 2 || oset[0] < objlim || cukid.cusize < mincusize) { |
| 233 |
> |
if (in==O_IN || oset[0] < objlim || cukid.cusize < mincusize) { |
| 234 |
|
/* add to set */ |
| 235 |
|
if (oset[0] >= MAXSET) { |
| 236 |
|
sprintf(errmsg, |
| 252 |
|
if ((1<<j) & i) |
| 253 |
|
cukid.cuorg[j] += cukid.cusize; |
| 254 |
|
} |
| 255 |
+ |
/* surfaces first */ |
| 256 |
|
for (j = 1; j <= oset[0]; j++) |
| 257 |
< |
addobject(&cukid, oset[j]); |
| 257 |
> |
if (!isvolume(objptr(oset[j])->otype)) |
| 258 |
> |
addobject(&cukid, oset[j]); |
| 259 |
> |
/* then this object */ |
| 260 |
|
addobject(&cukid, obj); |
| 261 |
+ |
/* volumes last */ |
| 262 |
+ |
for (j = 1; j <= oset[0]; j++) |
| 263 |
+ |
if (isvolume(objptr(oset[j])->otype)) |
| 264 |
+ |
addobject(&cukid, oset[j]); |
| 265 |
|
octkid(ot, i) = cukid.cutree; |
| 266 |
|
} |
| 267 |
|
cu->cutree = ot; |