POV-Ray : Newsgroups : povray.general : constructing solid mesh from surface mesh Server Time
26 Nov 2024 05:49:03 EST (-0500)
  constructing solid mesh from surface mesh (Message 1 to 10 of 13)  
Goto Latest 10 Messages Next 3 Messages >>>
From: kiwon
Subject: constructing solid mesh from surface mesh
Date: 21 Jul 2011 04:20:00
Message: <web.4e27dd1d8307f73b4c0a951f0@news.povray.org>
Dear POV-Ray users,

when there is only a surface mesh, is there any way to construct a solid
(volumetric) mesh covered by other solid object boundary such as box?

This codes are what I'm just trying, but doesn't seem to work:

  #declare mysurface = mesh2 {
    ... surface data
  }

  #declare myvolume = union {
    box {0, 1 clipped_by {mysurface}}
    mysurface
  }

Thanks

Tested in Persistence of Vision(tm) Ray Tracer Version 3.7.0.RC3
Issued: Parse Error: Illegal texture or patch in clip, bound or object pattern.


Post a reply to this message

From: Warp
Subject: Re: constructing solid mesh from surface mesh
Date: 21 Jul 2011 04:40:31
Message: <4e27e5ff@news.povray.org>
kiwon <nomail@nomail> wrote:
> when there is only a surface mesh, is there any way to construct a solid
> (volumetric) mesh covered by other solid object boundary such as box?

  If you want to use an object in CSG, it has to be solid (ie. have a
well-defined interior). With meshes you can do this by adding an
inside_vector to it. (Refer to the documentation about meshes.)

-- 
                                                          - Warp


Post a reply to this message

From: kiwon
Subject: Re: constructing solid mesh from surface mesh
Date: 21 Jul 2011 05:05:01
Message: <web.4e27eadffccc6bd34c0a951f0@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> kiwon <nomail@nomail> wrote:
> > when there is only a surface mesh, is there any way to construct a solid
> > (volumetric) mesh covered by other solid object boundary such as box?
>
>   If you want to use an object in CSG, it has to be solid (ie. have a
> well-defined interior). With meshes you can do this by adding an
> inside_vector to it. (Refer to the documentation about meshes.)

Thanks for your reply. BTW, for my purpose, is there any advice?

--
Kiwon


Post a reply to this message

From: Thomas de Groot
Subject: Re: constructing solid mesh from surface mesh
Date: 21 Jul 2011 06:59:09
Message: <4e28067d$1@news.povray.org>
On 21-7-2011 10:16, kiwon wrote:
>    #declare myvolume = union {
>      box {0, 1 clipped_by {mysurface}}
>      mysurface
>    }
>


Try:

#declare myvolume = union {
   box {0, 1 clipped_by {mysurface}}
   object {mysurface}
}

Thomas


Post a reply to this message

From: kiwon
Subject: Re: constructing solid mesh from surface mesh
Date: 21 Jul 2011 08:30:04
Message: <web.4e281b84fccc6bd34c0a951f0@news.povray.org>
Thomas de Groot <tenDOTlnDOTretniATtoorgedDOTt> wrote:
> On 21-7-2011 10:16, kiwon wrote:
> >    #declare myvolume = union {
> >      box {0, 1 clipped_by {mysurface}}
> >      mysurface
> >    }
> >
>
>
> Try:
>
> #declare myvolume = union {
>    box {0, 1 clipped_by {mysurface}}
>    object {mysurface}
> }

Tried, but the same error msg on the "clipped_by" line:
Parse Error: Illegal texture or patch in clip, bound or object pattern.
The clipped_by doesn't seem to work with mesh2.


Post a reply to this message

From: kiwon
Subject: Re: constructing solid mesh from surface mesh
Date: 21 Jul 2011 08:45:01
Message: <web.4e281f1afccc6bd34c0a951f0@news.povray.org>
"kiwon" <nomail@nomail> wrote:
> Thomas de Groot <tenDOTlnDOTretniATtoorgedDOTt> wrote:
> > On 21-7-2011 10:16, kiwon wrote:
> > >    #declare myvolume = union {
> > >      box {0, 1 clipped_by {mysurface}}
> > >      mysurface
> > >    }
> > >
> >
> >
> > Try:
> >
> > #declare myvolume = union {
> >    box {0, 1 clipped_by {mysurface}}
> >    object {mysurface}
> > }
>
> Tried, but the same error msg on the "clipped_by" line:
> Parse Error: Illegal texture or patch in clip, bound or object pattern.
> The clipped_by doesn't seem to work with mesh2.

If I put *inside_vector y* (because the surface's average normal direction is y
direction) in mysurface, it seems to construct what I intend. But the rendering
result has noise on that solid mesh.


Post a reply to this message

From: Thomas de Groot
Subject: Re: constructing solid mesh from surface mesh
Date: 21 Jul 2011 10:11:03
Message: <4e283377$1@news.povray.org>
On 21-7-2011 14:29, kiwon wrote:
> Thomas de Groot<tenDOTlnDOTretniATtoorgedDOTt>  wrote:
>> On 21-7-2011 10:16, kiwon wrote:
>>>     #declare myvolume = union {
>>>       box {0, 1 clipped_by {mysurface}}
>>>       mysurface
>>>     }
>>>
>>
>>
>> Try:
>>
>> #declare myvolume = union {
>>     box {0, 1 clipped_by {mysurface}}
>>     object {mysurface}
>> }
>
> Tried, but the same error msg on the "clipped_by" line:
> Parse Error: Illegal texture or patch in clip, bound or object pattern.
> The clipped_by doesn't seem to work with mesh2.
>
>
>
>
What about:

#declare myvolume =
intersection {
   box {0, 1}
   object {mysurface}
}


Thomas


Post a reply to this message

From: Roman Reiner
Subject: Re: constructing solid mesh from surface mesh
Date: 21 Jul 2011 11:30:01
Message: <web.4e28449efccc6bd39054ac430@news.povray.org>
"kiwon" <nomail@nomail> wrote:
> If I put *inside_vector y* (because the surface's average normal direction is y

That's not how inside_vector works.

It simply defines the specified point to be *inside* the object, thus
determining its inside and outside.


Post a reply to this message

From: kiwon
Subject: Re: constructing solid mesh from surface mesh
Date: 21 Jul 2011 11:40:01
Message: <web.4e284716fccc6bd34c0a951f0@news.povray.org>
Thomas de Groot <tenDOTlnDOTretniATtoorgedDOTt> wrote:
> On 21-7-2011 14:29, kiwon wrote:
> > Thomas de Groot<tenDOTlnDOTretniATtoorgedDOTt>  wrote:
> >> On 21-7-2011 10:16, kiwon wrote:
> >>>     #declare myvolume = union {
> >>>       box {0, 1 clipped_by {mysurface}}
> >>>       mysurface
> >>>     }
> >>>
> >>
> >>
> >> Try:
> >>
> >> #declare myvolume = union {
> >>     box {0, 1 clipped_by {mysurface}}
> >>     object {mysurface}
> >> }
> >
> > Tried, but the same error msg on the "clipped_by" line:
> > Parse Error: Illegal texture or patch in clip, bound or object pattern.
> > The clipped_by doesn't seem to work with mesh2.
> >
> >
> >
> >
> What about:
>
> #declare myvolume =
> intersection {
>    box {0, 1}
>    object {mysurface}
> }

Doesn't work. It keep only mysurface. The following are a simple test codes
for my purpose:

#version 2.7

global_settings {
  assumed_gamma 1.33
  max_trace_level 30
}

camera {
  right -x*image_width/image_height
  location <0.0, 2.2, 2.7>
  look_at <0.0, 0.5, 0.5>
}

light_source {
  <500, 500, -200>
  color rgb 1.3
}


#declare myF = finish {
  ambient 0
  diffuse 0
  phong 1
  phong_size 200
  reflection {
    0.01, 1
    fresnel on
  }
  conserve_energy
}

#declare myT = texture {
  pigment { rgbf <0.9,0.3,0.3 0.95> }
  finish { myF }
}

#declare myI = interior {
  ior 1.33
  fade_distance 10
  fade_power 2
}

#declare myM = material {
  interior{myI}
  texture {myT}
}

#declare TestSurf = mesh2 {
  vertex_vectors {
    4,
    <0, 0.5, 0>,
    <1, 0.5, 0>,
    <0, 0.5, 1>,
    <1, 0.4, 1>,
  }
  face_indices {
    2,
    <0, 1, 3>,
    <0, 3, 2>,
  }
  inside_vector y
}

#declare TestVol = union {
  box{0, 1 clipped_by{TestSurf}}
  TestSurf
}

#declare TestObj = object {
  TestVol
  translate <-0.5, -0.5, -0.5>
  material {myM}
}

sky_sphere {
  pigment {
    gradient y
    color_map {
      [0.0 rgb <0.6, 0.7, 1.0>]
      [0.7 rgb <0.0, 0.1, 0.8>]
    }
  }
}

plane {
  y, -0.2
  texture {
    pigment { color rgb <1.0, 0.8, 0.6> }
    finish { ambient 0 diffuse 1 }
  }
}

object {
  TestObj
  translate <0, 0.5, 0.5>
}


Post a reply to this message

From: kiwon
Subject: Re: constructing solid mesh from surface mesh
Date: 21 Jul 2011 11:50:01
Message: <web.4e28499cfccc6bd34c0a951f0@news.povray.org>
"Roman Reiner" <lim### [at] gmxde> wrote:
> "kiwon" <nomail@nomail> wrote:
> > If I put *inside_vector y* (because the surface's average normal direction is y
>
> That's not how inside_vector works.
>
> It simply defines the specified point to be *inside* the object, thus
> determining its inside and outside.

Really? I don't think so. Please check the manual *3.4.2.3.1 Solid Mesh* it
says:
.....
To determine if a point is inside a triangle mesh, POV-Ray shoots a ray from the
point in some arbitrary direction. If this vector intersects an odd number of
triangles, the point is inside the mesh. If it intersects an even number of
triangles, the point is outside of the mesh. You can specify the direction of
this vector. For example, to use +z as the direction, you would add the
following line to the triangle mesh description (following all other mesh data,
but before the object modifiers).
  inside_vector <0, 0, 1>
This change does not have any effect on unions of triangles, these will still be
always hollow.
.....


Post a reply to this message

Goto Latest 10 Messages Next 3 Messages >>>

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