![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <cqj### [at] cthulhu hans 5sl org>,
Johannes Bretscher <bre### [at] 5sl org> wrote:
> I wrote a macro to build a mesh from mathematic formulas. Is it
> possible to delete some triangles from tihs mesh, i.e. to cut a hole
> in the generatet surface?
There is no way to remove a triangle from a mesh, your best bet would
probably be to do it as you generate the mesh, just leaving the
triangles out instead of trying to remove them later. An alternative
might be to store the mesh data in an array and remove the triangles
from that, maybe by storing the vertices in one array, and using another
2D array to store the triangles, using vertex indexes. You could then
use a "magic number" to "delete" a triangle.
#declare VertArray = array [NumVertices];
#declare TriArray = array [NumTriangles][3]
{
{1, 5, 8},
{TRI_2_VERTEX_1, TRI_2_VERTEX_2, TRI_2_VERTEX_3},
{-1,-1,-1},//deleted triangle
...
{TRI_N_VERTEX_1, TRI_N_VERTEX_2, TRI_N_VERTEX_3}
};
Or you could just use the clipped_by feature, if you want to cut out an
arbitrary shape instead of individual triangles.
--
--
Christopher James Huff <chr### [at] mac com>
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
> On Thu, 3 Jan 2002 13:46:04 +0100, Johannes Bretscher <bre### [at] 5sl org> wrote:
>> Is it possible to delete some triangles from tihs mesh, i.e. to cut a hole
>> in the generatet surface?
> there is many ways to do it. it depend what your hole is and what your object is
> check clipped_by{}, bounded_by{}, difference{}, intersection{}
So CSG can be used with a mesh. That was the hint I needet. I thought
only solid objects are.
> you can be interested in
> http://news.povray.org/Xns915C94A8BA293seed7%40povray.org
Thanks for the link.
>
> ABX
Johannes
--
#macro q(s)(s*s)#end union{#declare C=-1;#while(C<1)sphere{<512*(11*C-9)/q(121*C
*C-198*C+97)-4,4.22*(3-11*C)/(exp(C*11/4)+2.12)+11*C-8.5,20>.3}sphere{<4-.15*exp
(3.3*C),12/5-11*C/2,20>.3}sphere{4*<1-4*(q(C*C)-C*C),C+7/8,5>.3}sphere{<2*C-6,
7.5,20>.3}#declare C=C+.01;#end pigment{color x}}light_source{-4*x 1}
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Thu, 3 Jan 2002 17:37:06 +0100, Johannes Bretscher wrote:
>> On Thu, 3 Jan 2002 13:46:04 +0100, Johannes Bretscher <bre### [at] 5sl org> wrote:
>>> Is it possible to delete some triangles from tihs mesh, i.e. to cut a hole
>>> in the generatet surface?
>> there is many ways to do it. it depend what your hole is and what your object is
>> check clipped_by{}, bounded_by{}, difference{}, intersection{}
>
> So CSG can be used with a mesh. That was the hint I needet. I thought
> only solid objects are.
That's true. You can only use union with non-solid objects. You can still
use clipped_by, though, as long as the clipping object has an inside.
--
#local R=rgb 99;#local P=R-R;#local F=pigment{gradient x}box{0,1pigment{gradient
y pigment_map{[.5F pigment_map{[.3R][.3F color_map{[.15red 99][.15P]}rotate z*45
translate x]}]#local H=pigment{gradient y color_map{[.5P][.5R]}scale 1/3}[.5F
pigment_map{[.3R][.3H][.7H][.7R]}]}}}camera{location.5-3*z}//only my opinions
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Thu, 3 Jan 2002 17:37:06 +0100, Johannes Bretscher <bre### [at] 5sl org> wrote:
> So CSG can be used with a mesh. That was the hint I needet. I thought
> only solid objects are.
Only solid objects.
Documentation for 3.5 says:
"There are six totally thin, finite objects which have no well-defined inside.
They are bicubic patch, disc, smooth triangle, triangle, polygon and mesh /
mesh2. They may be combined in CSG union but cannot be used in other types of
CSG (or inside a clipped_by statement)."
However if there are reasonably small number of triangles then you can simulate
trangles with clipped planes. That's why I said "it depends what your hole is
and what your object is".
ABX
--
#declare _=function(a,b,x){((a^2)+(b^2))^.5-x}#default {pigment{color rgb 1}}
union{plane{y,-3}plane{-x,-3}finish{reflection 1 ambient 0}}isosurface{ //ABX
function{_(x-2,y,1)&_((x+y)*.7,z,.1)&_((x+y+2)*.7,z,.1)&_(x/2+y*.8+1.5,z,.1)}
contained_by{box{<0,-3,-.1>,<3,0,.1>}}translate z*15finish{ambient 1}}//POV35
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <ib1### [at] cthulhu hans 5sl org>,
Johannes Bretscher <bre### [at] 5sl org> wrote:
> So CSG can be used with a mesh. That was the hint I needet. I thought
> only solid objects are.
Not in official POV-Ray. MegaPOV does have this, though it doesn't work
will all meshes.
The clipped_by feature does work in the official version, though.
--
--
Christopher James Huff <chr### [at] mac com>
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <6m693uo4eocfmft5prpo836fh4526ph88o@4ax.com>,
W?odzimierz ABX Skiba <abx### [at] babilon org> wrote:
> They are bicubic patch, disc, smooth triangle, triangle, polygon and mesh /
> mesh2. They may be combined in CSG union but cannot be used in other types of
> CSG (or inside a clipped_by statement)."
You misunderstood, you can't use them in a clipped_by statement, but you
can still use a clipped_by statement in them. That is the closest thing
to CSG that you can get with patch objects.
--
--
Christopher James Huff <chr### [at] mac com>
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Thu, 03 Jan 2002 13:34:00 -0500, Christopher James Huff <chr### [at] mac com>
wrote:
> You misunderstood, you can't use them in a clipped_by statement, but you
> can still use a clipped_by statement in them.
Did I say something different ??? I quoted text about CSG operations not about
object modificators.
ABX
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <hloa3uo4gostcvmpjfsvq66uigprahlmcd@4ax.com>,
W?odzimierz ABX Skiba <abx### [at] babilon org> wrote:
> Did I say something different ??? I quoted text about CSG operations not about
> object modificators.
You also suggested for him to use clipped planes, and by the phrasing of
your message you seemed to think clipped_by couldn't be used on meshes.
--
--
Christopher James Huff <chr### [at] mac com>
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
I believe one can apply a particular texture to each triangle, so in theory,
I think that one can apply a transparent texture to the undesirable
triangles.
I hope that helps.
Fernando.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Thu, 31 Jan 2002 16:04:16 -0600, =?Windows-1252?Q?Fernando_Gonz=E1lez_del_Cueto?=
wrote:
> I believe one can apply a particular texture to each triangle, so in theory,
> I think that one can apply a transparent texture to the undesirable
> triangles.
Thanks, that could be a solution, but I already wrote a c program to
create the mesh, where I have better control over the generated
triangles. (Yes, maybe that is because I am better in c than in pov
script)
> I hope that helps.
> Fernando.
Greetings
Johannes
--
#macro s(a,b)sphere{<a,b,20>.3}#end#macro q(a)(a*a)#end union{#local C=-1;#while
(C<1)s(512*(11*C-9)/q(121*C*C-198*C+97)-4,4.22*(3-11*C)/(exp(C*11/4)+2.12)+11*C-
8.5)s(4-.15*exp(3.3*C),12/5-11*C/2)s(4-16*(q(C*C)-C*C),4*C+7/2)s(2*C-6,7.5)
#local C=C+.01;#end pigment{color x}}light_source{-4*x 1} // JB
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |