bool
Class Object3D

java.lang.Object
  |
  +--bool.Object3D
All Implemented Interfaces:
java.lang.Cloneable

public class Object3D
extends java.lang.Object
implements java.lang.Cloneable

Data structure about a 3d solid to apply boolean operations in it.

Tipically, two 'Object3d' objects are created to apply boolean operation. The methods splitFaces() and classifyFaces() are called in this sequence for both objects, always using the other one as parameter. Then the faces from both objects are collected according their status.

See: D. H. Laidlaw, W. B. Trumbore, and J. F. Hughes. "Constructive Solid Geometry for Polyhedral Objects" SIGGRAPH Proceedings, 1986, p.161.

Author:
Danilo Balby Silva Castanheira (danbalby@yahoo.com)

Constructor Summary
Object3D(bool.Solid solid)
          Constructs a Object3d object based on a solid file.
 
Method Summary
 void classifyFaces(bool.Object3D object)
          Classify faces as being inside, outside or on boundary of other object
 java.lang.Object clone()
          Clones the Object3D object
 bool.Bound getBound()
          Gets the solid bound
 bool.Face getFace(int index)
          Gets a face reference for a given position
 int getNumFaces()
          Gets the number of faces
 void invertInsideFaces()
          Inverts faces classified as INSIDE, making its normals point outside.
 void splitFaces(bool.Object3D object)
          Split faces so that none face is intercepted by a face of other object
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Object3D

public Object3D(bool.Solid solid)
Constructs a Object3d object based on a solid file.

Parameters:
solid - solid used to construct the Object3d object
Method Detail

clone

public java.lang.Object clone()
Clones the Object3D object

Overrides:
clone in class java.lang.Object
Returns:
cloned Object3D object

getNumFaces

public int getNumFaces()
Gets the number of faces

Returns:
number of faces

getFace

public bool.Face getFace(int index)
Gets a face reference for a given position

Parameters:
index - required face position
Returns:
face reference , null if the position is invalid

getBound

public bool.Bound getBound()
Gets the solid bound

Returns:
solid bound

splitFaces

public void splitFaces(bool.Object3D object)
Split faces so that none face is intercepted by a face of other object

Parameters:
object - the other object 3d used to make the split

classifyFaces

public void classifyFaces(bool.Object3D object)
Classify faces as being inside, outside or on boundary of other object

Parameters:
object - object 3d used for the comparison

invertInsideFaces

public void invertInsideFaces()
Inverts faces classified as INSIDE, making its normals point outside. Usually used into the second solid when the difference is applied.