POV-Ray : Newsgroups : povray.general : How to make 3D box frames with black lines... Server Time
31 Oct 2024 08:15:27 EDT (-0400)
  How to make 3D box frames with black lines... (Message 1 to 2 of 2)  
From: James
Subject: How to make 3D box frames with black lines...
Date: 26 Nov 2005 01:05:01
Message: <web.4387fa484ad34a11cce6fd2b0@news.povray.org>
Hi!

I am trying to make 3D box only with frames (black). This is not
transparent. Only, I want to make 3D Box frames with black lines.

I have tried to use BOX function and then to erase the aress in  six
rectangulars, however, I count not do that.

Could you help me?

Thank you in advance.

James.


Post a reply to this message

From: Mike Williams
Subject: Re: How to make 3D box frames with black lines...
Date: 26 Nov 2005 01:55:47
Message: <anYVWDAWbAiDFwHz@econym.demon.co.uk>
Wasn't it James who wrote:
>Hi!
>
>I am trying to make 3D box only with frames (black). This is not
>transparent. Only, I want to make 3D Box frames with black lines.
>
>I have tried to use BOX function and then to erase the aress in  six
>rectangulars, however, I count not do that.

You can do it like this by creating a box and then removing the middle
bits

#macro Boxframe(P1,P2,D)
  difference {
    box {P1,P2}
    box {P1+<D,D,-D>, P2-<D,D,-D>}
    box {P1+<-D,D,D>, P2-<-D,D,D>}
    box {P1+<D,-D,D>, P2-<D,-D,D>}
  }
#end

object {Boxframe(<-2,-1,-1>,<2,1,1>,0.05) pigment {rgb 0}}

(This macro assumes that each coordinate of the first control point is
less than the equivalent coordinate of the second point second point)



or you can do it by drawing in the eight separate edges, like this

#macro Framebox(P1,P2,D)
  union {
    cylinder {<P1.x,P1.y,P1.z>,<P2.x,P1.y,P1.z>,D}
    cylinder {<P1.x,P1.y,P1.z>,<P1.x,P2.y,P1.z>,D}
    cylinder {<P1.x,P1.y,P1.z>,<P1.x,P1.y,P2.z>,D}
    cylinder {<P2.x,P1.y,P1.z>,<P2.x,P2.y,P1.z>,D}
    cylinder {<P2.x,P1.y,P1.z>,<P2.x,P1.y,P2.z>,D}
    cylinder {<P2.x,P2.y,P1.z>,<P2.x,P2.y,P2.z>,D}
    cylinder {<P2.x,P2.y,P1.z>,<P1.x,P2.y,P1.z>,D}
    cylinder {<P1.x,P1.y,P2.z>,<P2.x,P1.y,P2.z>,D}
    cylinder {<P1.x,P1.y,P2.z>,<P1.x,P2.y,P2.z>,D}
    cylinder {<P1.x,P2.y,P2.z>,<P2.x,P2.y,P2.z>,D}
    cylinder {<P1.x,P2.y,P2.z>,<P1.x,P2.y,P1.z>,D}
    cylinder {<P2.x,P1.y,P2.z>,<P2.x,P2.y,P2.z>,D}
  }
#end  

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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