2Table <strong>of</strong> Contents1. Introduction2. Voxels <strong>and</strong> <strong>Voxelization</strong>3. <strong>Ray</strong> <strong>Tracing</strong>4. X3D, Computer Graphics, <strong>and</strong> Triangles5. Octrees6. Algorithm Design <strong>and</strong> Implementationa. Triangle-cube intersections <strong>and</strong> the Separating Axis Theoremb. <strong>Ray</strong>-triangle intersections <strong>and</strong> the manifold propertyc. Classification <strong>of</strong> voxels using a flooding algorithm7. Results8. Conclusion9. Acknowledgments10. References1. IntroductionThere are several new models <strong>of</strong> three-dimensional printers currently on the market, <strong>and</strong> as thetechnology is refined the 3-D printing marketplace will only continue <strong>to</strong> grow. Though <strong>to</strong>day'sprinters are not yet sophisticated enough <strong>to</strong> perfectly reproduce machinery at the smallest scale,they are sufficiently accurate <strong>and</strong> precise <strong>to</strong> print 3-D objects at a resolution that many artistic 3-D modelers require. It is very easy <strong>to</strong> imagine that as this technology advances, it could somedaybe used <strong>to</strong> replace industrial manufacturing. Printers could be used <strong>to</strong> generate pieces that are nolonger fabricated on a wide scale, perhaps used <strong>to</strong> replicate legacy parts, such as screws for avintage au<strong>to</strong>mobile.Three-dimensional printing is known by a variety <strong>of</strong> names including rapid pro<strong>to</strong>typing,layered manufacturing, or solid free-form fabrication. The rapid pro<strong>to</strong>typing methodology israther simple: first, a 3D input file is converted so that the printer can 'perceive' the input modelas a stack <strong>of</strong> very thin layers. The printer then builds the bot<strong>to</strong>mmost slice <strong>of</strong> the object, sprayinga powder or polymer that hardens in<strong>to</strong> the first layer. Next, the printer builds the layer above that,<strong>and</strong> so on, spraying, <strong>and</strong> bonding material <strong>to</strong> existing material, aggregating the model slice byslice.Despite the usage <strong>of</strong> the word 'rapid', this fabrication process can take many hours.Nonetheless, the many hours it can take <strong>to</strong> print a pro<strong>to</strong>type, or a model that has never beforebeen created, is actually much less time than would be used <strong>to</strong> print the same pro<strong>to</strong>type with aconventional manufacturing technology, such as die casting. Though die casting or injectionmolding can be used <strong>to</strong> manufacture large quantities <strong>of</strong> parts quickly, the initial preparationneeded <strong>to</strong> build the necessary mold is high in terms <strong>of</strong> both cost <strong>and</strong> time. Rapid pro<strong>to</strong>typing is
thus a relatively quick, competitive choice for production <strong>of</strong> 'one-<strong>of</strong>f' models compared <strong>to</strong>traditional manufacturing methods.Rapid pro<strong>to</strong>typing has other advantages as well. It can produce hollow shapes easily, aswell as more complicated usages <strong>of</strong> hollow space, including interlocking or nested parts a la aship-in-a-bottle or a set <strong>of</strong> Russian dolls. This technology, though readily available, is not exactlyat one's fingertips: unlike their ubiqui<strong>to</strong>us two-dimensional counterparts, the cost <strong>of</strong> threedimensionalprinters puts ownership <strong>of</strong> one out <strong>of</strong> reach for most. However, people from all overthe world can make use <strong>of</strong> one by sending model data <strong>to</strong> a 3-D printing company. Thesecompanies will make a physical object out <strong>of</strong> your 3D model by converting the model in<strong>to</strong> asuitable file format, sending the information <strong>to</strong> the printer <strong>and</strong> then mailing you a copy <strong>of</strong> yourpersonal creation.As is the case with any developing technology, rapid pro<strong>to</strong>typing is not without itsimperfections. For instance, the materials used for 3D printing are relatively flexible <strong>and</strong>resistant <strong>to</strong> breakage, but they lack the strength <strong>of</strong> the materials used in conventional fabricationprocesses. As technology advances, metal alloys may eventually be used for rapid pro<strong>to</strong>typingwhich would remedy this problem, yielding parts with greater strength. For now, objectsproduced by 3D printing are more suited for display than they are as machinery parts.Perhaps the biggest drawbacks <strong>to</strong> rapid pro<strong>to</strong>typing are related <strong>to</strong> printer resolution <strong>and</strong>accuracy. For one thing, the printed models are in some sense an accumulation <strong>of</strong> fused particles,<strong>and</strong> this means the finished product can have a somewhat granulated surface. More importantly,like their two-dimensional counterparts, 3-D printers have a minimum resolution below whichdetail is lost. The limiting fac<strong>to</strong>r is the size <strong>of</strong> the printer nozzle <strong>and</strong> the accuracy <strong>of</strong> the printerhead's movements. The printer simply cannot create details below a certain size. Furthermore,depending on the resolution <strong>of</strong> the printer <strong>and</strong> thickness <strong>of</strong> each slice, a staircase effect can beprominently visible. If significant portions <strong>of</strong> the input model were below the size threshold, theresulting printed model would be <strong>of</strong> indeterminate quality: it would suffer from loss <strong>of</strong> detail <strong>and</strong>it might be structurally unstable.Thus, it is valuable for 3-D printing companies <strong>to</strong> analyze model input before sending it<strong>to</strong> a 3-D printer. Clearly, it is advantageous <strong>to</strong> avoid any misprints; it is easier (at the very least, itis considerably less expensive) <strong>to</strong> analyze <strong>and</strong> then re-scale a polygonal model than it is <strong>to</strong> print apoor model, re-scale it, <strong>and</strong> print it again. It is important from a cus<strong>to</strong>mer-satisfaction st<strong>and</strong>pointthat the finished, printed model is as detailed as the cus<strong>to</strong>mer expects, <strong>and</strong> not 'lossy'. It is alsoimportant from a financial st<strong>and</strong>point not <strong>to</strong> waste any time or material on structurally unstableprints.This paper presents a novel application <strong>of</strong> voxelization <strong>and</strong> ray-tracing <strong>to</strong> identify areas<strong>of</strong> the model that fall below these minimum thickness requirements. The algorithm classifiesvoxels according <strong>to</strong> their wall thickness; this classification provides a visualization <strong>of</strong> the modelthat highlights areas that are <strong>to</strong>o thin <strong>to</strong> print with accuracy or that risk structural collapse. Thevisualization can thus be used <strong>to</strong> evaluate the integrity <strong>of</strong> a model <strong>and</strong> determine if it is suitable3