Declaration of MyTorus is not neccessary (and #local instead of
#declare would avoid introduction/overwriting of variables in the
main scene). My favourite method is like this:
#macro MyTorusMacro (LightColor)
#local I = 0;
#local N = 10;
union {
// ... whatever ...
// *no* closing brace! This makes application of *all* object
// modifiers possible in the main scene, even bounded_by, no_image.
// 'Match Brace' in the Search menu (and human readers) will *not*
// be irritated by this omission if the brace appears in a comment
// instead of beeing omitted completely, like in the following line:
// "}" of union omitted to allow application of modifiers!
#end// macro MyTorusMacro
Call such macros in this way:
MyTorusMacro (Blue) /*{*/ scale ... rotate ... translate ... }
The commented-out opening brace isn't neccessary for parsing but
avoids irritation of 'Match Brace'. Normally I would call it a
bug to match a brace within a comment or inside a string with a
brace outside; in this case although I'm quite happy with this
behaviour.
Sputnik
Post a reply to this message
|