On Jul 4, 2014, at 8:28 AM, Daniel Roßberg wrote: > Investigating the bot primitive's rt_bot_internal structure I found a > parameter and a flag which are expendable IMHO. > > num_face_normals = num_faces if face_normals != 0 > = 0 if face_normals == 0 > > RT_BOT_HAS_SURFACE_NORMALS = true if face_normals != 0 > = false if > face_normals == 0 > > Am I missing something?
Actually, num_face_normals is not necessarily == num_faces .. it can be fewer and non-zero. This can happen if you merge meshes (one with and one without normals) or apply smoothing to only portions of a given mesh. If I create two spheres, one smoothed and one not, and merge them (via bot_merge) .. it'll end up in that situation. HOWEVER, I have my doubts that the implementation does this in a useful manner. I see no association of the face_normals array to the faces array so we don't actually know which normals go to which faces. Doing a quick test, I got the "get" command to crash because it has a loop using the wrong counter. Looking at the implementation, it does seem to try to intentionally use those fields to support unusual cases. Even not knowing that history, I'm not sure I see a problem with eliminating RT_BOT_HAS_SURFACE_NORMALS since that is captured implicitly in num_normals -- but even doing that will require auditing all the places that flag is used. Wouldn't be opposed to making the container sizes all sync up either given it seems like they always should (or could, even in the merge case -- you compute unsmoothed normals). Cheers! Sean ------------------------------------------------------------------------------ Open source business process management suite built on Java and Eclipse Turn processes into business applications with Bonita BPM Community Edition Quickly connect people, data, and systems into organized workflows Winner of BOSSIE, CODIE, OW2 and Gartner awards http://p.sf.net/sfu/Bonitasoft _______________________________________________ BRL-CAD Developer mailing list brlcad-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/brlcad-devel