| Body Builder |
|
There are a several ways the user could enhance or customize BodyBuilder. A few are listed here.
There are currently 5 Primitive Shapes:
The class definintion for each Primitive Shape is very similar. To introduce a new shape, it would be easiest to start from the class file for one of the existing Primitve Shapes. Customization then involves the following steps:
Custom Materials are easily added by hardcoding additional materials as part of the constructor method in BodyBuilder.m. Take a look at the code and you will see several materials created and added to the BodyBuilder's property "material," which is a cell array.
Of course, a better solution would be a menu item that enables the user to define materials.
There are classes available to do this, but we simply didn't get around to implementing. If interested, you could take it from where we left off. Check out the method cb_export2VRML_ActionPerformedCallback() in the svSupport.m file located in the private folder of the BodyBuilder class.
Once you have something to try and wish to add a menu item that uses that callback, just uncomment the appropriate code (following the comment "Export to VRML") in the method create_menu_bar within BodyBuilder.m.
Three common Boolean operations are pictured below:
In some cases such as when one shape is wholly within another or the intersecting surface between shapes is planar, Boolean operations are not too difficult to implement; however, by changing the types of shapes or relative orientation, the Boolean operations can quickly become difficult. (If it was easy, it would have been done in this release.) How do you handle operations requiring different material types? Good question.
To visualize the three operations stated above, consider first this body consisting of two intersecting shapes, a red Brick and a blue Cylinder.
The Union operation would return the universe of the two shapes minus any overlap.
The Intersect operation can be considered the inverse of the Union operation, returning that volume shared by the two initial shapes
The Subtract operation would return the first shape's volume minus the second shape's volume.
|
Understanding BodyBuilder |