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