POV-Ray : Newsgroups : povray.newusers : Deleting triangles Server Time
27 Nov 2024 23:37:07 EST (-0500)
  Deleting triangles (Message 1 to 10 of 12)  
Goto Latest 10 Messages Next 2 Messages >>>
From: Johannes Bretscher
Subject: Deleting triangles
Date: 3 Jan 2002 07:47:46
Message: <cqj11a.lnl.ln@cthulhu.hans.5sl.org>
Hello,
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?

Greetings,
  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

From:
Subject: Re: Deleting triangles
Date: 3 Jan 2002 08:06:54
Message: <ihl83u4knnigjjmh09qtq0ffe1jtuag8eg@4ax.com>
On Thu, 3 Jan 2002 13:46:04 +0100, Johannes Bretscher <bre### [at] 5slorg> 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{}
if you want remove exat triangle then it is better to store vertices in some
structure (mainly array) and remove vertices from this structure first and
create mesh at final stage

you can be interested in
http://news.povray.org/Xns915C94A8BA293seed7%40povray.org

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

From: Christopher James Huff
Subject: Re: Deleting triangles
Date: 3 Jan 2002 11:24:19
Message: <chrishuff-909D6D.11251903012002@netplex.aussie.org>
In article <cqj### [at] cthulhuhans5slorg>,
 Johannes Bretscher <bre### [at] 5slorg> 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] maccom>


Post a reply to this message

From: Johannes Bretscher
Subject: Re: Deleting triangles
Date: 3 Jan 2002 12:47:41
Message: <ib121a.b9m.ln@cthulhu.hans.5sl.org>

> On Thu, 3 Jan 2002 13:46:04 +0100, Johannes Bretscher <bre### [at] 5slorg> 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

From: Ron Parker
Subject: Re: Deleting triangles
Date: 3 Jan 2002 12:56:57
Message: <slrna396rb.4sl.ron.parker@fwi.com>
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] 5slorg> 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

From:
Subject: Re: Deleting triangles
Date: 3 Jan 2002 12:57:49
Message: <6m693uo4eocfmft5prpo836fh4526ph88o@4ax.com>
On Thu, 3 Jan 2002 17:37:06 +0100, Johannes Bretscher <bre### [at] 5slorg> 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

From: Christopher James Huff
Subject: Re: Deleting triangles
Date: 3 Jan 2002 13:17:02
Message: <chrishuff-DB221A.13180503012002@netplex.aussie.org>
In article <ib1### [at] cthulhuhans5slorg>,
 Johannes Bretscher <bre### [at] 5slorg> 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] maccom>


Post a reply to this message

From: Christopher James Huff
Subject: Re: Deleting triangles
Date: 3 Jan 2002 13:32:58
Message: <chrishuff-D2CF83.13340003012002@netplex.aussie.org>
In article <6m693uo4eocfmft5prpo836fh4526ph88o@4ax.com>,
 W?odzimierz ABX Skiba <abx### [at] babilonorg> 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] maccom>


Post a reply to this message

From:
Subject: Re: Deleting triangles
Date: 4 Jan 2002 03:09:48
Message: <hloa3uo4gostcvmpjfsvq66uigprahlmcd@4ax.com>
On Thu, 03 Jan 2002 13:34:00 -0500, Christopher James Huff <chr### [at] maccom>
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

From: Christopher James Huff
Subject: Re: Deleting triangles
Date: 5 Jan 2002 08:29:05
Message: <chrishuff-853ECE.08302805012002@netplex.aussie.org>
In article <hloa3uo4gostcvmpjfsvq66uigprahlmcd@4ax.com>,
 W?odzimierz ABX Skiba <abx### [at] babilonorg> 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] maccom>


Post a reply to this message

Goto Latest 10 Messages Next 2 Messages >>>

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