POV-Ray : Newsgroups : povray.general : Joining cylinders with a miter-join Server Time
31 Jul 2024 18:27:12 EDT (-0400)
  Joining cylinders with a miter-join (Message 11 to 15 of 15)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Nicolas George
Subject: Re: Joining cylinders with a miter-join
Date: 22 Dec 2006 15:14:16
Message: <458c3c98$1@news.povray.org>
"Zeger Knaepen"  wrote in 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 ?

I fear it may leave some rays go through the joining curve.


Post a reply to this message

From: Chris B
Subject: Re: Joining cylinders with a miter-join
Date: 22 Dec 2006 15:39:18
Message: <458c4276$1@news.povray.org>
"Nicolas George" <nicolas$george@salle-s.org> wrote in message 
news: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.
>

Hi Nicolas,
The example I posted did not manifest this problem (even using different 
colours).

> 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.
>

Yes. I understood that bit.

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

A few things here:
  o  Firstly, substituting different colours for each of the two parts of 
the merge in the example I posted didn't show a problem.
  o  Secondly, because the coincident surface is the one you don't want to 
display, then why would you need to use a different texture for each 
instance of it.
  o  Thirdly, if it causes a problem in the particular circumstances you 
have and you really want to use a union, then why not just make the cutting 
surfaces transparent as in the following example:

camera {location <0,0,-1> look_at 0}
light_source { <-1, 0.3, -2> color rgb 1}
light_source { <-1, 0.3,  2> color rgb 1}

union {
  difference {
    cylinder {-y,y*0.2,0.2}
    plane {y,0 rotate z*225 pigment {color rgbt 1}}
    pigment {color rgbt <1,1,0,0.7>}
  }
  difference {
    cylinder {-x,x*0.2,0.2}
    plane {y,0 rotate z*45 pigment {color rgbt 1}}
  }
  texture {
    pigment {color rgbt <0,1,1,0.4>}
    normal {agate}
  }
  rotate y*45
}

If you still get a problem, why not post a snippet that illustrates your 
problem.

Regards,
Chris B.


Post a reply to this message

From: Alain
Subject: Re: Joining cylinders with a miter-join
Date: 22 Dec 2006 16:42:55
Message: <458c515f@news.povray.org>
Nicolas George nous apporta ses lumieres en ce 22-12-2006 06:02:
> "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.
You can cut the cylinders with planes that are not parallel. Make the cutting 
planes 44 degrees from the axis of the cylinders. That way, the cylinders will 
overlap but the tips will converge to a single point. You still have some 
coincident area, but it's a single point. Merge the two pieces.

-- 
Alain
-------------------------------------------------
Experience hath shewn, that even under the best forms of government those
entrusted with power have, in time, and by slow operations, perverted it
into tyranny.
Thomas Jefferson


Post a reply to this message

From: Nicolas George
Subject: Re: Joining cylinders with a miter-join
Date: 22 Dec 2006 17:52:46
Message: <458c61be$1@news.povray.org>
Alain  wrote in message <458c515f@news.povray.org>:
> You can cut the cylinders with planes that are not parallel. Make the
> cutting planes 44 degrees from the axis of the cylinders.

Non, that do not work: near the tip of the corner, the outer cylinder is the
wrong one after the diagonal.


Post a reply to this message

From: Lukas Winter
Subject: Re: Joining cylinders with a miter-join
Date: 23 Dec 2006 06:38:22
Message: <pan.2006.12.23.11.38.21.773783@removeit.geloescht.net>
Am Fri, 22 Dec 2006 02:40:25 -0500 schrieb Nicolas George:

> 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?

What about:
merge
{
  intersection
  {
    merge
    {
      cylinder
      {
        <-2, 0, 0>, <.5, 0, 0>, .5
      }
      plane
      {
        -x+y, 0
      }
    }
    cylinder
    {
      <0, .5, 0>, <0, -1, 0>, .5
    }
  }
  cylinder
  {
    <-2, 0, 0>, <0, 0, 0>, .5
  }
  pigment
  {
    rgbf <1, 0, 0, .7>
  }
}

I don't know if this works with different radii, but there are no problems
with coincident surfaces.
Lukas Winter


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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