POV-Ray : Newsgroups : povray.general : How to extrude a mesh : Re: How to extrude a mesh Server Time
29 Jul 2024 18:23:38 EDT (-0400)
  Re: How to extrude a mesh  
From: Nekar Xenos
Date: 12 Nov 2010 01:01:12
Message: <op.vl1mz6cxufxv4h@go-dynamite>
On Thu, 11 Nov 2010 18:16:38 +0200, Alain <aze### [at] qwertyorg> wrote:


>> On Thu, 11 Nov 2010 03:59:52 +0200, Alain <aze### [at] qwertyorg> wrote:

>>
>> I'm thinking something along the lines of saving the mesh as a separa
te
>> file and reading the file and writing a new file after replacing each

>> triangle with a group of triangles.
>>
>> Let's say a triangle has corner co-ordinates T1, T2 and T3 and you wa
nt
>> to extrude it in direction of vector V1
>>
>> You then replace
>> triangle{T1,T2,T3}
>> with the following:
>> ////////////////////////////////////////////////////////
>>
>> triangle{T1,T2,T3}// original triangle
>>
>> triangle{T1,T2,T1+V1} //side of T1 and T2
>> triangle{T1,T2+V1,T1+V1} //
>>
>> triangle{T2,T2+V1,T3} // side of T2 and T3
>> triangle{T2+V1,T2,T3+V1} //
>>
>> triangle{T1,T3+V1,T3} // side of T3 and T1
>> triangle{T1+V1,T3+V1,T3} //
>>
>> triangle{T1+V1,T2+V1,T3+V1}// Original triangle fully displaced by
>> vector V1
>>
>> /////////////////////////////////////////////////////////////////////
/////////
>>
>>
>> -Nekar Xenos-
>
> Good. That way, you ensure that you preserve the original shape for th
e  

> top and bottom.
>
> Make it into a mesh:
> mesh{triangle{T1,T2,T3}// original triangle
> triangle{T1,T2,T1+V1}    //side of T1 and T2
> triangle{T1,T2+V1,T1+V1} //
> triangle{T2,T2+V1,T3}    // side of T2 and T3
> triangle{T2+V1,T2,T3+V1} //
> triangle{T1,T3+V1,T3}    // side of T3 and T1
> triangle{T1+V1,T3+V1,T3} //
> triangle{T1+V1,T2+V1,T3+V1}// Original triangle fully displaced by  

> vector V1
> }
>
> It's easier to apply a texture that way.
> You should then put all meshes into an union.
>
>
> Alain

I just thought of something else: If you make V1 the same as the normal 
 

for that point you can get interesting results. For instance making a  

something grow fatter =:o

-Nekar Xenos-


Post a reply to this message

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