Jump to content
  • Advertisement
Sign in to follow this  
Wizumwalt

how to find regions of volumes/geometries

This topic is 4839 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm looking for ways to calculate regions from volumes/geometries. An example would be ... an interior volume of a box would be region1 and the air outside of a box would be region2. Except I'd be using more geometries or volumes than this. Any links, pointers, comments, subject names, etc... much appreciated.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by jyk
Can the volumes intersect? And, are they always convex?


No, they do not always have to be convex, and if the two volumes intersect, then I'd like to create a third volume.

Share this post


Link to post
Share on other sites
Quote:
Original post by John Schultz
B-reps (Boundary Reps)
CSG (Constructive Solid Geometry)


I guess I'm looking for a starting point here.

I import my models w/ files containing only node and other basic primitive element data where I construct a wireframe of the model.

How do I go about selecting whether I use B-Reps, CSG, or hybrids?

Also, since I've got my app in JOGL (Java bindings for OpenGL), and since I haven't seen any libs that I can make use of, anyone know where I could start in understanding the how's so that I can write a basic lib for myself.

Share this post


Link to post
Share on other sites
Quote:
Original post by Wizumwalt
Quote:
Original post by John Schultz
B-reps (Boundary Reps)
CSG (Constructive Solid Geometry)


I guess I'm looking for a starting point here.

I import my models w/ files containing only node and other basic primitive element data where I construct a wireframe of the model.

How do I go about selecting whether I use B-Reps, CSG, or hybrids?

Also, since I've got my app in JOGL (Java bindings for OpenGL), and since I haven't seen any libs that I can make use of, anyone know where I could start in understanding the how's so that I can write a basic lib for myself.


A B-Rep (boundary representation) is used to define the volumes for primitives (solid objects). A CSG package then performs operations on one or more primitives (such as union, intersection, difference). 3D modeling packages typically support basic Boolean operations on meshes. However, the general case is an extremely difficult problem (it does not work reliably in some commercial 3D modeling packages). If you limit the problem to simple (closed-surface/airtight) convex hulls, then you can clip the objects against each other and build the desired result from the clipped elements. You can create non-convex objects by using multiple convex objects.

Share this post


Link to post
Share on other sites
So if I understand this correctly, I first use B-Rep to define the volumes for each of my primitives (multiple solid objects) that are used to build my model.

Then I can get into using CSG to perform those boolean operations which will allow me to define regions from my model (i.e. interiors and exteriors).

If that's correct, then I can just learn B-Rep for the first step and just take it step-by-step.

Man, I'm about to invest a lot of time learning this, I hope it's what I'm looking for.

Share this post


Link to post
Share on other sites
I think maybe I better try to explain more about what I'm looking for because the clipping panes and then the CSG modeling intro is starting to not look like what I need. I was reading the introduction to that OpenCSG and it says that your primitives must be solids, meaning they already have clearly defined interiors and exteriors. But that's what I'm wanting to get in the first place.

It's the interiors and exteriors on the volumes of the model that I want. My model is not a primitive, but made up of them through another application. Another application was used to create the model, it was exported into a neutral file format, and I then imported from that neutral file format which only gives me the nodes (veritices) and element types (lines, triangles, tets, etc...) so that I could draw a wire frame of the model meshed in triangles. I don't have the completed individual primitives themselves that make up the model. (meaning, if my model is a sphere with a cylinder protruding through it, I don't have the nodes that would protrude through the interior of the sphere to complete the primitive cylinder, I only have the nodes on the outside of it). The model is empty on the inside anyways, so in reality, there's nothing in it, but the point is, it doesn't have the nodes included to complete the primitive. I hope that made sense. I have just enough info to make the models wire frame.

And now I just want to be able to define the interior of the model as regionA, the outside as regionB, and possibly any other volumes of primitives that I can *somehow* find in the same way, regionC, regionD, etc... Then I will put arrows on it and show which way the surface normals are pointing.

Share this post


Link to post
Share on other sites
See the paragraph labeled "Contents" here: http://breplibrary.sourceforge.net/

More info on B-Reps here: http://www.kimbly.com/code/brep/. Note that a B-Rep is not required, but simplifies dealing with holes, etc.
More CSG links.

In order to use arbitrary meshes (and convert to B-Reps to compute Boolean operations), a fairly large amount of code must be written (see the GTS library (with source code) link above).

If you can guarantee your incoming models are closed, convex polyhedrons, the problem is simplified. For example, a cube: the boundary is defined by 6 planes and 12 edges (edges are needed for object-object tests). Testing a point for "inside" requires 6 plane tests (half-spaces). For "outside", the tests can stop as soon as the point is detected on the outer half-space of any of the 6 planes. Thus the same boundary rep is used for defining an inside region and an outside region (only the test methods differ).

Do you need this boundary/region information for building levels/objects, collision detection?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!