> 2. If an intersection point is generated: > > A - B: Use the intersection point and the surface normal of A at > that point to form a plane. Shift that plane bn_tol in the direction > opposite that of the surface normal, find the intersection curve of > the result, and remove that from B. Not ideal in some ways, but will > ensure that A' does not intersect B.
Sorry - the above should be "remove that from A" - since you're subtracting from A, that'd be the brep you'd be removing volume from. > Testing inside/outside when you have intersection curve(s)... I'm not > sure what the best approach is there yet. Some kind of bbox approach > might be possible, but I'm not sure if there's a better way... > perhaps you could take the 3D bbox of the intersection curve, subtract > it from the bboxes of the two input breps, and then for each surface > subdivide until you got a box that was unambiguously in only one of > the brep bbox - curve bbox boxes? Another possible approach here (a much cleaner one, if it works) is to use the knowledge of shared curves and whether the curve is an inner or outer trimming loop in the new surfaces created... below is an illustration of how I think this might work, but I'm not sure yet if it holds up - needs more thinking. If a sphere is subtracted from another sphere (A - B) and one intersection curve is found, four surfaces get created - A1, A2, B1, B2. A1 is created by using the trimming curve as an inner trimming curve on A, A2 is generated by using the same trimming curve as a new outer curve on A. (Same for B1 and B2.) Since B is being subtracted from A, any surfaces from B that end up as part of the result will need to be flipped - creating B1' and B2'. Since the original operation is A - B, we remove the surface that has the curve as part of a new outer trimming loop from A (A2) and substitute in the flipped surface from B that shares that same curve as part of a new outer trimming loop : A - B = (A - A2) + B2' = A1 + B2' Does that seem to make sense? Need to consider some other cases, like a sphere sitting "on top of" a torus - there will be a circular intersection curve there, but zero volume - how do we recognize that... CY ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ BRL-CAD Developer mailing list brlcad-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/brlcad-devel