POV-Ray : Newsgroups : povray.newusers : Applying a Border to a "triangle" : Re: Applying a Border to a "triangle" Server Time
28 Jul 2024 16:29:24 EDT (-0400)
  Re: Applying a Border to a "triangle"  
From: Catseye
Date: 7 Jun 2008 09:14:51
Message: <484a89cb$1@news.povray.org>
Thanks Chris,

I get the impression from the user's manual discussion that CSG functions 
like "merge" and "union" don't typically work with "patch" objects like 
"triangle" and "disc".  That said, I have successfully used "difference" to 
subtract a solid cylinder from a patch but I can't get two "patches" (in the 
same plane) to "merge" or "union".

Any insight as to whether this is possible? - perhaps I'm overlooking some 
basic protocol coding error.

If I comprehend what you are saying about the method to color the edge (90 
degrees from the face) of a solid triangle; however that's not what I need. 
If possible I need to be able to generate a border around the triangle face 
(visible looking at the face the face).

I had already considered the compromise of translate-offsetting two 
different sized triangles (of different colors) a miniscule amount as you 
suggested, but I was looking for a more elegant solution.

Jim

"Chris B" <nom### [at] nomailcom> wrote in message 
news:484a82cb$1@news.povray.org...
>
> "Catseye" <jpf### [at] comcastnet> wrote in message 
> news:484a73ca$1@news.povray.org...
>> How can I create a border of a specified width and color for a "triangle" 
>> Finite_Patch Object having a different color?  I tried "merge" and 
>> "union" of two different-size triangle and that doesn't want to compute.
>
> There's lots of ways of doing this with a triangular object. Using a 
> different-size triangle is one that should work. You can use union but you 
> don't have to, just two differently scaled copies of the same triangle 
> should work just as well.
>
> There are a couple of things that you'll need to get right though:
>  o  When you scale the triangle it's easiest to do by translating it so 
> that it is centred at the origin, scale it and then translate it back 
> again.
>  o  You also need to avoid concurrent surfaces, so the smaller object 
> should be very slightly in front of the 'border' object (e.g. 
> translate -z*0.00001).
>  o  If you are going to union them, then remember to apply the pigments to 
> the individual items and not to the union/merge.
>
> If you want the triangle to show up on both surfaces on the triangle you 
> can use a third copy translated slightly in the opposite direction.
>
> I'm not sure what a merge would produce because it removes internal 
> surfaces and I don't know what that would do with something like a 
> bicubic_patch, a mesh or a mesh2 etc.
>
>> If this can't be done, what is the slickest way to create a thin 
>> equilateral "Finite Solid" triangle having a border edge and different 
>> color than the remainder of the triangle?
>
> This is possible too. You can use an object as a pigment, so, off the top 
> of my head, I would think the quickest way is probably to get the 
> intersection of 3 planes. Then define a pigment using that object:
>
> #declare PlaneIntersectionObject =  intersection {
>  plane {z,1}
>  plane {z,1 rotate 120*y}
>  plane {z,1 rotate 240*y}
> }
>
> pigment {
>  object {
>    PlaneIntersectionObject
>    color rgb <1,0,0>  // Red Border
>    color rgb <1,1,0>  // Yellow Triangle
>  }
> }
>
> You'd obviously then need to align it with your triangle object.
>
> Regards,
> Chris B.
>


Post a reply to this message

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