POV-Ray : Newsgroups : povray.newusers : Deleting triangles : Re: Deleting triangles Server Time
4 Nov 2024 17:44:26 EST (-0500)
  Re: Deleting triangles  
From: Christopher James Huff
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

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