|
![](/i/fill.gif) |
Mike Williams <nos### [at] econym demon co uk> wrote:
> Things like that can happen with coincident surfaces.
>
> In the general case, the workround is to displace one of the components
> slightly
>
> #local arcDepth2 = arcDepth*1.00001;
>
> //Semicircle 2
> difference{
> cylinder{ centre - arcDepth2 * arcNorm, centre + arcDepth2 *
> arcNorm, arcRadius }
> plane{ arcSweepEnd, 0 translate centre}
> }
>
>
> However, in this case you don't need a second cylinder. You can just
> difference both planes from the same one:
>
> #macro drawAcuteArc(centre, arcSweepStart, arcSweepEnd, arcRadius,
> borderWidth)
> #local arcDepth = 0.1;
> #local arcNorm = vcross(arcSweepStart,arcSweepEnd);
>
> difference{
> cylinder{ centre - arcDepth * arcNorm, centre + arcDepth
> * arcNorm, arcRadius }
> plane{ arcSweepStart, 0 translate centre }
> plane{ arcSweepEnd, 0 translate centre}
> pigment {rgbf <1,0,0,0>}
> }
> #end
Many thanks for this, and for the obtuse form.
My original intention was to use two cylinders so that once I'd got it working,
I'd be able to use the same macro for reflex angles just by calculating the
angle and changing the 'intersection' to a 'merge', which is why the original
looks like it does. I'm now thinking it would be easier to plan to detect the
angle inside an umbrella drawArc function and then use the appropriate macro
from inside.
-Ian
Post a reply to this message
|
![](/i/fill.gif) |