|
|
Am 23.02.2018 um 21:50 schrieb Sven Littkowski:
> What smart ways do you know of, to add or not add the comma for each
> spline sweet element but the last one?
>
> This is what I tried, but I fail...
> ----------------------
>
> sphere_sweep
> {
> b_spline
> MySegmentAmount,
> #while (MyCount <= MySegmentAmount)
> #if(MyCount=MySegmentAmount)
> #declare MyComma="";
You could use
#macro MyComma() #end
> #else
> #declare MyComma=",";
#macro MyComma() , #end
> #end
> < MyX, MyY, MyZ >, 0.35 MyComma
MyComma()
> #declare MyY = MyY+MyVMovement;
...
However, it would be much easier to use
sphere_sweep {
b_spline
MySegmentAmount // no comma here!
#while (...)
...
, <MyX, MyY, MyZ>, 0.35
...
#end
...
}
Also, modern versions do allow a "dangling" comma by now:
#version 3.71;
sphere_sweep {
b_spline
MySegmentAmount,
#while (...)
...
<MyX, MyY, MyZ>, 0.35,
...
#end
...
}
Post a reply to this message
|
|