Jeff,

On Nov 10, 2009, at 3:07 PM, Jeff Smith wrote:

> Thanks for the quick reply, Joe.  You're not being stupid, in fact  
> you extracted
> a lot of sense from my vague email.  Here's a specific example of  
> the problem
> I'm trying to solve: lets' say you have a watertight, triangulated
> solid and want
> to slice it in half with a plane.  Can BRL-CAD generate the  
> resulting solid (or
> two) that would be created by this procedure?

Yes, that example is quite ordinary to perform.  Our polygonal solid  
NMG (n-manifold) primitive can have an ARB8 (a box) primitive  
subtracted from it as a boolean operation.  You could also use a HALF  
primitive instead of an ARB8 if you really want the concept of an  
infinite cutting plane.  HALF is our "halfspace" primitive defined by  
a plane equation with the object representing solid space from that  
plane to infinity (half of space).   You can calculate that resulting  
operation with high-level modeling operations or the corresponding  
LIBRT routines.

> More generally, I will have one watertight solid and one surface  
> that may or may
> not be a solid, but will definitely be manifold and have well defined
> normals at every
> vertex.  The second surface may or may not intersect the first; if it
> does, I'd like to
> be able to extract the intersecting volume or, at worst, the line of
> intersection of
> the two surfaces.

This is a bit more complex given the second surface is not solid.   
You probably won't be able to use higher-level user routines  
(modeling operations) to have them interact, but you should still be  
able to use lower-level routines.  There are a slew of NMG  
manipulation routines that implement a radial edge data structure  
with euler operations, routines for calculating surface  
intersections, and more.  See src/librt/primitives/nmg for some details.

> Currently, I have a stand-alone program that reads in OBJ files,  
> generates
> "r_bot_internal" structures with the "mode" set to RT_BOT_SOLID and
> performs boolean operations on them.  This works swimmingly as long as
> all the OBJs represent watertight manifold solids.  Using the RT- 
> BOT_SURFACE
> mode or the RT_BOT_PLATE mode gives errors, even in circumstances when
> I'd expect the boolean operation to succeed.  Is there any code  
> that comes in
> the BRL-CAD distro (I'm using version 7.16.0) that demonstrates the  
> use of
> boolean geometry operations on surfaces or plates?

BoTs are a related cousin to the NMGs, but don't provide rigid  
topological connectivity.  Particularly for surface mode BoT  
geometry, it's basically a simple collection of faces.  Plate mode  
BoTs do represent solids but the solidity is implicit.  As with the  
other implicit primitives, there is no "surface" for it to evaluate  
without casting a ray.  It would be useful to have a routine that  
converts a plate mode BoT to a solid (aka volume mode) BoT which have  
explicit surfaces.  Alas, I don't believe such a routine presently  
exists.

You could magically pretend a plate or surface mode BoT is a volume  
BoT to try using higher-level modeling routines (boolean ops) on  
them, but there's no guarantees it'll work.  What you should have  
more success with is the NMG structures, though, as they provide  
better topological connectivity.  NMGs represent a generalized  
polygonal structure, not just a triangulated surface (but certainly  
could be just a triangulated surface).  It's also trivial to derive a  
triangulated surface from a non-triangulated NMG.

Rummage around the NMG routines a bit in LIBRT.  There are a variety  
of geometry converters that import meshes as NMGs (instead of BoTs)  
in src/conv such as euclid-g, dxf-g, jack-g, patch-g, and iges-g that  
might help understanding the NMG routines.

Cheers!
Sean


------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
BRL-CAD Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-users

Reply via email to