Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Making a 3D Box That Doesn't Need to Be Visualized

$
0
0
I have a problem that I have been working on for some time. I need something that will follow the guidelines that were given to me by a d.i.c. member. I'm having issues with Point3d and portability so I would like to avoid its use if possible- If not, I understand. I have a data set that I want to measure using this conceptual algorithm:

Quote

1. Define a cuboid (in 3D) that encloses your entire data set. It doesn't matter if it is too big initially, the algorithm will cope. It's trivial to calculate the area of a cuboid so this is going to be the initial estimate of your volume. Obviously, it's going to be an overestimate.

2. Divide your box into smaller boxes. If you are working in 2D, cut it along the x and y axes giving 4 smaller boxes. If you are in 3D then cut along the z axis too giving 8 smaller boxes.

3. Take each box in turn. A box will fall into one of three categories:

3A. It lies entirely outside your data set. Subtract its volume from your initial estimate and discard the box. You don't need it any more.

3B. It lies entirely inside your data set. Discard the box so you don't keep dividing it but do not adjust your initial estimate.

3C. Part of the box lies inside your data set and part lies outside. Add the box to a list that need to be further divided. Don't adjust the estimated volume yet.

4. Run through the list of boxes that need to be divided (a queue is a nice data structure for this) until the estimated volume is within an acceptable error distance of the actual value. How do you know this? It's when the total volumes of the boxes in the queue is less than the error value. (This sounds imprecise but you can make the error value as small as you wish)


I need an idea of what I can or need to use to do this. Ive been looking around with j3d, but it seems to be more for visualization and visualization isn't necessary for me. I am simply trying to obtain a numerical value of the volume. Any help is appreciated.

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>