BRL-CAD
shape_recognition_planar.cpp
Go to the documentation of this file.
1 #include "common.h"
2 
3 #include <set>
4 #include <map>
5 
6 #include "bu/log.h"
7 #include "bu/str.h"
8 #include "bu/malloc.h"
9 #include "shape_recognition.h"
10 
11 
12 int
14 {
15  int i = 0;
16  // Check surfaces. If a surface is anything other than a plane the verdict is no.
17  // If all surfaces are planes, then the verdict is yes.
18  for (i = 0; i < data->faces_cnt; i++) {
19  if (GetSurfaceType(data->brep->m_F[data->faces[i]].SurfaceOf(), NULL) != SURFACE_PLANE) return 0;
20  }
21  data->type = PLANAR_VOLUME;
22  return 1;
23 }
24 
25 // TODO - implement tests to recognize arb4-arb8 and valid arbn (no concave face) primitives
26 
27 
28 // Local Variables:
29 // tab-width: 8
30 // mode: C++
31 // c-basic-offset: 4
32 // indent-tabs-mode: t
33 // c-file-style: "stroustrup"
34 // End:
35 // ex: shiftwidth=4 tabstop=8
Header file for the BRL-CAD common definitions.
COMPLEX data[64]
Definition: fftest.c:34
surface_t GetSurfaceType(const ON_Surface *in_surface, struct filter_obj *obj)
int subbrep_is_planar(struct subbrep_object_data *data)