=== Mini-Tutorial for Brett.inc === Part 0 === What is 'Brett' ?!? 'Brett' is the german word for 'board'. Brett.inc is an include file fo r the famous great raytracer POV-Ray, versions 3.1 and 3.5. 5 simple macros h elp in the construction of complicated rounded or beveled boards. It's not over-featured; much more can be done ( and I will do that ...). But it works fine, is fast, and easy to use. And it constructs shapes I never would try to do by hand. What do I need, what should I read, where are the pics? - Brett.inc - which is a fully self-contained package. It contains the complete code, demo scenes, even a slide show! And german documentation. - posts in the povray.include.scene-files thread 'Round/bevel: Include file', started by me, Frank 'Sputnik' Rothfuß, on 23/Jan/2003. The first p ost contains detailed information in english (well, at least I *hope* it' s english what I've written ...) - watch the slide show -- in the windows version 3.5 of POV-Ray, only 3 mouse-clicks are needed, when Brett.inc is open in the editor: (1) right-click on the line containing the options for the show, (2) click on 'Copy ... to command line options', (3) click on 'Run' -- that's all! (clearly described at the very beginning of my post in povray.binaries.scene-f iles) - a JPEG-picture at povray.binaries.images - the text that follows; please also read the appendix. === Here Comes the Mini-Tutorial === Part 1 === Using the macros is as simple as driving: BrettAnfang( ... ) // Start the engine (see detailed description of // the parameters in my post; it's easy: only 5 // simple and intuitive parameters) // now drive around your 'claim' in XZ-land, // clockwise BrettKante ( 5, 0 ) // drive 5 units, straight (0 degrees turn) BrettKante ( 8, 200 ) // curve with radius 8 units, right (+) 200 degre es BrettKante ( 8, 60 ) // tight curve, radius 2 units, left (-) 60 degre es BrettKante ( 0, 90 ) // sharp (radius = 0 units) turn left(+) 90 deg reed // ... // ... driving ... BrettEnde ( 6 ) // I don't know where I am -- find automatically // a 'straight + curve_with_radius_+6_units + // straight'-sequence, bring me home, switch off // the engine (but remember the path). // '-1' says: I think I'm back at home -- don't // drive any more, just switch off. object { Brett () texture { ... } scale <...> translate <...> ... } // now use the object that is cut out by the path // you drove; '#declare B = Brett();' is possib le. Of course accidents are possible: driving over your own path, driving two cars simultaneously, (but once finished, the created object can survive in a variable), driving into the inner area of a right curve (but BrettMulti() helps in this case by splitting the curve in shorter segments), driving to a position where automatic closure is not possible (radius too big, driving back require d) The object is a big union of one prism and CSG of boxes, cones, cylinders and toruses. Give it 'pigment { color rgbt 0.7 }' to get an X-ray (ah, now I know what '.x' does: rgbx colors! ;) ). To see more, let the object explode: #declare BrettDebug=2; How is it done: (short version) During definition, the startpoint, the endpoints of all segments, radii/lengths and the direction vectors associated with these points ar e stored. Brett() uses this information to create a union with a prism as the core. This is tailored by cutting away those edges where a concave segment (angle<0) is to appear, and by appending intersections of cylinders and planes to fill out the inside of convex segments. Additional pieces are added, giving a smooth rounded or beveled surface . No meshes, isosurfaces etc are used, only geometric primitives (and one prism: fast with 20 points, slow with hundreds) What will not work: Because the object's interior is a big mess, transparency is not useabl e, and cutting away parts near the border might reveal internal holes (I don't know if this can happen, I simply didn't try to make the interior nice). Using 'Brett'-objects as a knife (i.e. #differencing them from other objects) will not work because of the many coincident surfaces in the interior. The same is true for hollow, inverse, interior, media. Unions and overlapping objects give no problems. === Back to the Tutorial === Part 2 === Now you have learnt enough to understand the first examples. Look up demo scene 4 (search for '#case (4)' in Brett.inc); also load the BrettArena.p ov; look how they 'drive'. Then read examples 7 and 8, the Saeule()-macro use d by them, and play around with the parameters. === Tutorial === Part 3 === It's time to create your own 'Brett'-object. Grab a sheet of paper with a square grid and a pencil. (That is my favorite 'modeller'! I can see in realtime what I do!). Select a starting point on the grid and a simple direction (x, -x, z, or -z). Drive around using only small integer lengths/radii and multiples of 90 degrees, i.e. plus or minus 90, 180, 270, or 0. In this way every section of the path will only reach points on the grid, so it's easy to exactly follow the path. Begin with a very simple object, 'drive' it on the paper. Then load BrettArena.pov, change the contained simple example to 'drive' around your shape (clockwise!), and render! Continue experimenting until you are too tired or hungry. :) === Last and Most Important Part of this Little Tutorial === Task: Create a breathtakingly complex scene with Brett.inc, render it and POST IT TO POVRAY.BINARIES.IMAGES. Code goes to povray.binaries.scene-fil es. Advanced users write a makro that uses Brett.inc to produce beveled shape s of handwritten letters, strange fractals or a jigsaw-puzzle filter. OH NO, better wait a couple of weeks for the next version -- but if you d o such things, I would like to see them. === End of Mini-Tutorial === === Appendix === FAQ: I just read about infinite parse times reported by Doctor John. Current ly we don't know what's going on. No other questions until now, so nothing to say. Ask me, and a FAQ migh t evolve. ERRORS: Ahem, yes. So young, this macro, but already 2 tiny harmless errors fou nd: (1) '#local Eps = 0.0001;' should have been '#declare Eps = 0.0001; ' (2) The little sputnik over blue planet should only appear in the demo scenes and the slide show. The very last block of code should get '#ifdef (Nr) #if (Nr>0)' before it and '#end #end' after it -- you also could delete this code :( or live with that little sputnik :) Feel free to ask if you have problems with or questions about Brett.inc. Sputnik -- ------------------------------------- Frank 'Sputnik' Rothfuß e-mail: fr@computermuseum.fh-kiel.de -------------------------------------