POV-Ray : Newsgroups : povray.general : Interior for bicubic_patches ? Server Time
5 Nov 2024 14:20:50 EST (-0500)
  Interior for bicubic_patches ? (Message 1 to 10 of 12)  
Goto Latest 10 Messages Next 2 Messages >>>
From: Manuel Kasten
Subject: Interior for bicubic_patches ?
Date: 30 Jan 2005 08:19:17
Message: <41fcded5$1@news.povray.org>
Hello,

is there a way to add an interior to bicubic patches (or use them in CSG 
or fill them with media)? Something like inside_vector for meshes? Of 
course I am aware of the fact, that bicubic patches are only surfaces, 
but this holds true for triangles, too.

If not, is there an easy way to convert a bunch of bicubic patches into 
a (smooth) mesh? If so, how?

Thank you for your thougts.

Manuel


Post a reply to this message

From: Warp
Subject: Re: Interior for bicubic_patches ?
Date: 30 Jan 2005 15:06:12
Message: <41fd3e34@news.povray.org>
Manuel Kasten <kas### [at] gmxde> wrote:
> is there a way to add an interior to bicubic patches (or use them in CSG 
> or fill them with media)? Something like inside_vector for meshes?

  No.

> If not, is there an easy way to convert a bunch of bicubic patches into 
> a (smooth) mesh? If so, how?

  Actually it should be more or less trivial to converts bicubic patches
to meshes because POV-Ray does that internally with type 1 patches.
However, I'm not aware of an include file or similar which would do this.

  Chris Colefax's pcm macros can place objects on the surface of a
bicubic patch. Perhaps it could be easily modified so that it could
create triangles.

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From: Sascha Ledinsky
Subject: Re: Interior for bicubic_patches ?
Date: 30 Jan 2005 16:06:51
Message: <41fd4c6b$1@news.povray.org>
Manuel Kasten <kas### [at] gmxde> wrote:
 > If not, is there an easy way to convert a bunch of bicubic patches
 > into a (smooth) mesh? If so, how?

Here's some (quite optimized) code that tesselates a bezier patch and 
creates a (smooth) mesh2 object.
It does not yet support u/v mapping, but it should be trivial to add 
that. You can modify it to create a single mesh out of multiple bezier 
patches...

I've attached the macro, with a little test scene:

regards
-Sascha


Post a reply to this message


Attachments:
Download 'us-ascii' (4 KB)

From: Marc Jacquier
Subject: Re: Interior for bicubic_patches ?
Date: 30 Jan 2005 16:44:41
Message: <41fd5549@news.povray.org>

news:41fd3e34@news.povray.org...
> Manuel Kasten <kas### [at] gmxde> wrote:
> > is there a way to add an interior to bicubic patches (or use them in CSG
> > or fill them with media)? Something like inside_vector for meshes?
>
>   No.
>
May be.... but!

camera {
  location  <    -11.835,     -43.012,      14.627>
  sky       z   //sorry Moray export :)
  up        z
  right     <    0.66,         0.0,         0.0>
  angle         12
  look_at   0

}

#declare flamme =
   material
   {
      texture
      {
         pigment
         {
            color rgbt 1
         }

      }
      interior
      {
         media
         {
            emission rgb <1,1,1.5>
         }

      }
   }



union{
  object {
    bicubic_patch { type 1 flatness 0 u_steps 4 v_steps 4,
      <0,0,2>,<0, 0, 2>, <0, 0, 2>, <0, 0, 2>,
      <-1, 0, 2>, <-1, -1, 2>, <1, -1, 2>, <1, 0, 2>,
      <-0.6, 0, 4>, <-0.6, -0.6, 4>, <0.6, -0.6, 4>, <0.6, 0, 4>,
      <0.6, 0, 6>, <0.6,0, 6>, <0.6, 0, 6>, <0.6, 0, 6>
    }
  }
  object {
    bicubic_patch { type 1 flatness 0 u_steps 4 v_steps 4,
      <0, 0, 2>, <0, 0, 2>, <0, 0, 2>, <0, 0, 2>,
      <1, 0, 2>, <1, 1, 2>, <-1, 1, 2>, <-1, 0, 2>,
      <0.6, 0, 4>, <0.6, 0.6, 4>, <-0.6, 0.6, 4>, <-0.6, 0, 4>,
      <0.6, 0, 6>, <0.6, 0, 6>, <0.6, 0, 6>, <0.6, 0, 6>
    }
  }
  material {
    flamme
  }

 hollow
}


Post a reply to this message

From: Warp
Subject: Re: Interior for bicubic_patches ?
Date: 31 Jan 2005 10:32:14
Message: <41fe4f7e@news.povray.org>
Marc Jacquier <jac### [at] wanadoofr> wrote:
> > > or fill them with media)?

> >   No.
> >
> May be.... but!

  Ah, I didn't notice that "media" part in the original question.

  The "solidness" of an object (which in the case of meshes is achieved
with interior_vector) is needed *only* for CSG, nothing else.
  Not even media, which is "inside" the object requires for the object
to be "solid". Media works just ok for any closed surface regardless of
whether it is "solid" or not.

  Many people have the misconception that interior_vector is needed
for media to work with meshes. Perhaps I should write an entry to
the povQ&T about this.

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From: Warp
Subject: Re: Interior for bicubic_patches ?
Date: 31 Jan 2005 10:33:23
Message: <41fe4fc3@news.povray.org>
That would be "inside_vector", of course.

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Marc Jacquier
Subject: Re: Interior for bicubic_patches ?
Date: 31 Jan 2005 10:40:14
Message: <41fe515e@news.povray.org>

news:41fe4f7e@news.povray.org...
>   Ah, I didn't notice that "media" part in the original question.
:-)
>
>   The "solidness" of an object (which in the case of meshes is achieved
> with interior_vector) is needed *only* for CSG, nothing else.
>   Not even media, which is "inside" the object requires for the object
> to be "solid". Media works just ok for any closed surface regardless of
> whether it is "solid" or not.
>
>   Many people have the misconception that interior_vector is needed
> for media to work with meshes. Perhaps I should write an entry to
> the povQ&T about this.
>
I think so... BTW I never got that inside_vector idea... is it coordinates
of a point inside the mesh?

Marc


Post a reply to this message

From: Warp
Subject: Re: Interior for bicubic_patches ?
Date: 31 Jan 2005 10:50:17
Message: <41fe53b9@news.povray.org>
Marc Jacquier <jac### [at] wanadoofr> wrote:
> I think so... BTW I never got that inside_vector idea... is it coordinates
> of a point inside the mesh?

  It's any random (non-zero) vector you like. Usually it makes no difference.
That vector is just a direction vector, nothing else.

  What POV-Ray does is that when it has to determine whether a point is
inside the mesh or not (this is an operation needed in some of the CSG
calculations), it just shoots a ray from that point to that specified
direction and counts how many triangles of the mesh it hits. If it hits
an odd number of triangles it assumes the point is inside the mesh, else
outside.

  POV-Ray could just have a 'make_this_mesh_solid' keyword without
parameters and it could then internally just create some random vector.
  However, the idea with giving the user the possibility to specify the
direction vector is that there may be some pathological cases where the
vector could have exactly the same direction as a triangle tangent, or
it could pathologically hit tons of mesh edges (which will cause a
jittered result because of the inaccurate nature of floating point,
as happens with the infamous coincident-surface problem).
  That is, if you are getting some random noise in your CSG of a mesh
and another object (something very improbable, but theoretically
possible), you can try changing the direction of the inside_vector
a bit to see if it helps.

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Marc Jacquier
Subject: Re: Interior for bicubic_patches ?
Date: 31 Jan 2005 10:59:16
Message: <41fe55d4@news.povray.org>

news:41fe53b9@news.povray.org...
>   It's any random (non-zero) vector you like. Usually it makes no
difference.
> That vector is just a direction vector, nothing else.
/...
Thanks for this explication, it makes things a lot clearer :-)

Marc


Post a reply to this message

From: Manuel Kasten
Subject: Re: Interior for bicubic_patches ?
Date: 31 Jan 2005 13:05:58
Message: <41fe7386@news.povray.org>
Warp schrieb:
> Marc Jacquier <jac### [at] wanadoofr> wrote:
> 
>>>>or fill them with media)?
> 
> 
>>>  No.
>>>
>>
>>May be.... but!
> 
> 
>   Ah, I didn't notice that "media" part in the original question.
> 
>   The "solidness" of an object (which in the case of meshes is achieved
> with interior_vector) is needed *only* for CSG, nothing else.
>   Not even media, which is "inside" the object requires for the object
> to be "solid". Media works just ok for any closed surface regardless of
> whether it is "solid" or not.
> 
>   Many people have the misconception that interior_vector is needed
> for media to work with meshes. Perhaps I should write an entry to
> the povQ&T about this.
> 

!! Good to know !!

This is indeed needed in the Q&T.
Although my first experiments weren't successfull, I'll try further.

Thanks, Manuel


Post a reply to this message

Goto Latest 10 Messages Next 2 Messages >>>

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