POV-Ray : Newsgroups : povray.general : Joining cylinders with a miter-join Server Time
28 Nov 2024 12:54:18 EST (-0500)
  Joining cylinders with a miter-join (Message 1 to 10 of 15)  
Goto Latest 10 Messages Next 5 Messages >>>
From: Nicolas George
Subject: Joining cylinders with a miter-join
Date: 22 Dec 2006 02:40:25
Message: <458b8be9$1@news.povray.org>
Hi.

I often wonder how to make cylinders joining with a miter-join, that is:

------------+
           /|
          / |
         /  |
--------+   |
        |   |
        |   |
        |   |

The solution that comes to mind immediately is to use something like:

union {
  intersection {
    cylinder { horizontal }
    plane { diagonal, interior up }
  }
  intersection {
    cylinder { vertical }
    plane { diagonal, interior down }
  }
}

But it leads to coincident surfaces. Making the cylinders overlap is not
good either, because near the point of the angle, the biggest cylinder is
the wrong one.

Any suggestion?


Post a reply to this message

From: Paul Bourke
Subject: Re: Joining cylinders with a miter-join
Date: 22 Dec 2006 02:55:00
Message: <web.458b8ec21e412a2be5a039020@news.povray.org>
> I often wonder how to make cylinders joining with a miter-join, that is:

.... cut ....

> But it leads to coincident surfaces. Making the cylinders overlap is not
> good either, because near the point of the angle, the biggest cylinder is
> the wrong one.
> Any suggestion?

Surely if the cylinders are different radii then it is hardly going to be
"nice" join anyway except for perpendicular views and orthographic camera.

In any case, how about taking the intersection of the two cylinders extended
past each other, that gives you the end piece. Then add cylinders up to the
start of the intersection ... the original end points less the opposite
cylinder radii.


Post a reply to this message

From: Slime
Subject: Re: Joining cylinders with a miter-join
Date: 22 Dec 2006 03:18:25
Message: <458b94d1$1@news.povray.org>
> union {
>   intersection {
>     cylinder { horizontal }
>     plane { diagonal, interior up }
>   }
>   intersection {
>     cylinder { vertical }
>     plane { diagonal, interior down }
>   }
> }
>
> But it leads to coincident surfaces.

But those coincident surfaces are on the *inside*, which shouldn't be a
problem... or do you need this to be transparent?

If so, making the cylinders overlap should still be an option - just do it
only a tiny, tiny bit, so that you can't see it at any reasonable resolution
but the coincident surface is elliminated.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Bruno Cabasson
Subject: Re: Joining cylinders with a miter-join
Date: 22 Dec 2006 03:30:01
Message: <web.458b965e1e412a2bf5fba6ef0@news.povray.org>
Nicolas George <nicolas$george@salle-s.org> wrote:
> Hi.
>
> I often wonder how to make cylinders joining with a miter-join, that is:
>
> ------------+
>            /|
>           / |
>          /  |
> --------+   |
>         |   |
>         |   |
>         |   |
>
> The solution that comes to mind immediately is to use something like:
>
> union {
>   intersection {
>     cylinder { horizontal }
>     plane { diagonal, interior up }
>   }
>   intersection {
>     cylinder { vertical }
>     plane { diagonal, interior down }
>   }
> }
>
> But it leads to coincident surfaces. Making the cylinders overlap is not
> good either, because near the point of the angle, the biggest cylinder is
> the wrong one.
>
> Any suggestion?

You can clip the joining ends of the cylinders by a plane properly oriented,
and then make the connection (use of clipped_by{plane{}})

    Bruno


Post a reply to this message

From: Bruno Cabasson
Subject: Re: Joining cylinders with a miter-join
Date: 22 Dec 2006 03:30:01
Message: <web.458b97651e412a2bf5fba6ef0@news.povray.org>
Ooops...

I am just arriving at work and not totally awakened. I did not read with
enough attention. Forget vmy last post...

    Bruno


Post a reply to this message

From: Nicolas George
Subject: Re: Joining cylinders with a miter-join
Date: 22 Dec 2006 06:02:38
Message: <458bbb4e$1@news.povray.org>
"Slime"  wrote in message <458b94d1$1@news.povray.org>:
> But those coincident surfaces are on the *inside*, which shouldn't be a
> problem... or do you need this to be transparent?

Yes. Or hollow sometimes.

> If so, making the cylinders overlap should still be an option - just do it
> only a tiny, tiny bit, so that you can't see it at any reasonable resolution
> but the coincident surface is elliminated.

That is always a possibility, but approximations like that my stomach curl.
And even with very tiny overlap, there are always one or two rays that
arrive just at the bad place and get a strange color.


Post a reply to this message

From: Nicolas George
Subject: Re: Joining cylinders with a miter-join
Date: 22 Dec 2006 06:10:01
Message: <458bbd09$1@news.povray.org>
"Paul Bourke"  wrote in message
<web.458b8ec21e412a2be5a039020@news.povray.org>:
> In any case, how about taking the intersection of the two cylinders extended
> past each other, that gives you the end piece.

<thinking hard>
<doing a sketch on the white board to be really sure>

Yes! Great idea! That is just the right piece to make the perfect join.

Anyway, I have the impression that the construct

union {
  intersection {
    object { A }
    object { L }
  }
  intersection {
    object { A }
    object { L inverse }
  }
}

is quite common, and may benefit from a specific optimization.


Post a reply to this message

From: Chris B
Subject: Re: Joining cylinders with a miter-join
Date: 22 Dec 2006 07:50:22
Message: <458bd48e$1@news.povray.org>
"Nicolas George" <nicolas$george@salle-s.org> wrote in message 
news:458b8be9$1@news.povray.org...
> Hi.
>
> I often wonder how to make cylinders joining with a miter-join, that is:
>
> ------------+
>           /|
>          / |
>         /  |
> --------+   |
>        |   |
>        |   |
>        |   |
>
> The solution that comes to mind immediately is to use something like:
>
> union {
>  intersection {
>    cylinder { horizontal }
>    plane { diagonal, interior up }
>  }
>  intersection {
>    cylinder { vertical }
>    plane { diagonal, interior down }
>  }
> }
>
> But it leads to coincident surfaces. Making the cylinders overlap is not
> good either, because near the point of the angle, the biggest cylinder is
> the wrong one.
>
> Any suggestion?
>

I may be missing something obvious to everyone else here, but why not just 
use merge instead of union to get rid of the internal coincident surfaces?

camera {location <0,0,-1> look_at 0}
light_source { <-1, 0.3, -2> color rgb 1}
merge {
  difference {
    cylinder {-y,y*0.2,0.2}
    plane {y,0 rotate z*225}
  }
  difference {
    cylinder {-x,x*0.2,0.2}
    plane {y,0 rotate z*45}
  }
  pigment {color rgb <1,0,0>}
  clipped_by {plane {-z,0}}
  rotate y*45
}

or did I missunderstand the questoin?

Regards,
Chris B.


Post a reply to this message

From: Nicolas George
Subject: Re: Joining cylinders with a miter-join
Date: 22 Dec 2006 13:18:25
Message: <458c2171@news.povray.org>
"Chris B"  wrote in message <458bd48e$1@news.povray.org>:
> I may be missing something obvious to everyone else here, but why not just 
> use merge instead of union to get rid of the internal coincident surfaces?

Because a merge does not avoid the problem of coincident surfaces. In fact,
this is quite the opposite: using a merge instead of an union makes the
problem worst.

More precisely, coincident surfaces are cases where two objects share a same
boundary surface. Due to calculations made with floating point arithmetic
and not perfect mathematical objects, rounding errors occur, and the ray
tracer may consider that the ray hit one object first and the other next, or
the other way around.

If both objects have exactly the same texture, it is not a problem at all.

With a merge in the situation I am describing, on the other hand, it changes
everything. If the rounding errors tell that the ray first enters the second
object and then leaves the first, then the merge takes place, and no
boundary is seen. On the other hand, if the rays first leaves the first
object and then enters the second, then the boundary must be drawn.


Post a reply to this message

From: Zeger Knaepen
Subject: Re: Joining cylinders with a miter-join
Date: 22 Dec 2006 15:10:14
Message: <458c3ba6@news.povray.org>
wouldn't it be possible to do this with clipped_by, which doesn't leave a
surface where it clips ?

cu!
--
#macro G(b,e)b+(e-b)*C/50#end#macro _(b,e,k,l)#local C=0;#while(C<50)
sphere{G(b,e)+3*z.1pigment{rgb G(k,l)}finish{ambient 1}}#local C=C+1;
#end#end _(y-x,y,x,x+y)_(y,-x-y,x+y,y)_(-x-y,-y,y,y+z)_(-y,y,y+z,x+y)
_(0x+y.5+y/2x)_(0x-y.5+y/2x)            // ZK http://www.povplace.com


Post a reply to this message

Goto Latest 10 Messages Next 5 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.