POV-Ray : Newsgroups : povray.newusers : cutting irregular holes?! Server Time
2 Nov 2024 05:21:39 EDT (-0400)
  cutting irregular holes?! (Message 1 to 10 of 13)  
Goto Latest 10 Messages Next 3 Messages >>>
From: frozen
Subject: cutting irregular holes?!
Date: 14 Sep 2004 03:30:00
Message: <web.41469d9a89bd8e201f09a3bc0@news.povray.org>
Hi!

I'm quite new to 3d rendering, although I tried POVRay and other programs
from time to time during the last years. Now I want to create an image,
which is worth being send to IRTC. I suppose, I'm not good enough, since
even simple tasks turn out to be very complicated for me.. I hope, you can
help me with some hints...

First I should mention, that I use Moray a lot. So if it is possible,
pleeeaaaase (!) give hints, that work with this program! ;-)

But now on to my question:

I try to build a medieval building using a photo of a real castle as
reference. Right now I'm stuck at "cutting" the windows into it. I used a
large box for the building itself. Now I need to cut the windows into it,
and so I thought I could use a difference CSG. But the windows have a
shape, which is different from a box or sphere or anything like this. They
somehow look like a box in the lower part with two archs building the upper
part. Using a CSG to cut a box-shaped window is no problem. But what kind
of shape can be used to build the desired arched window AND is usable in a
CSG? Using a mesh for example leads to an parsing error, since meshes
aren't allowed in CSGs.

Thanks for your help!

frozen


Post a reply to this message

From: Mike Williams
Subject: Re: cutting irregular holes?!
Date: 14 Sep 2004 04:44:44
Message: <AsIMVEAY9qRBFw02@econym.demon.co.uk>
Wasn't it frozen who wrote:

>I try to build a medieval building using a photo of a real castle as
>reference. Right now I'm stuck at "cutting" the windows into it. I used a
>large box for the building itself. Now I need to cut the windows into it,
>and so I thought I could use a difference CSG. But the windows have a
>shape, which is different from a box or sphere or anything like this. They
>somehow look like a box in the lower part with two archs building the upper
>part. Using a CSG to cut a box-shaped window is no problem. But what kind
>of shape can be used to build the desired arched window AND is usable in a
>CSG? Using a mesh for example leads to an parsing error, since meshes
>aren't allowed in CSGs.

Using a mesh doesn't normally lead to a parsing error, but it won't do
quite what you want unless you ensure that the mesh has a well defined
inside. To achieve that, you need the mesh to be closed and you need to
define the inside_vector.

Or you could create your window shapes from the unions and intersections
of simpler shapes, something like this: [Note that there are slight
overlaps between the parts that make up the Window shape, without these
overlaps the surfaces between the parts would sometimes become visible.]


camera {location  <7,4,-10> look_at <0,0,0> angle 20}
light_source {<-30, 100, -30> color rgb 1}

// A simple box shape doe the body of the building
#declare Wall = difference {
  box {<-1.02,0,-1.02><1.02,0.98,1.02>}
  box {<-1,0,-1><1,1,1>}
}

// The window is a box plus two arches
#declare Window = union {
  box {-1,1}
  intersection {
    cylinder{<1,1,-1><1,1,1>,2}
    box{<-1,0.9,-1> <0.01,3,1>}
  }
  intersection {
    cylinder{<-1,1,-1><-1,1,1>,2}
    box{<1,0.9,-1> <0,3,1>}
  }
  scale 0.1
}

// Remove several copies of the window from the box
difference {
  object {Wall}
  object {Window translate <0,0.5,-1>}
  object {Window translate <-0.6,0.5,-1>}
  object {Window translate <0.6,0.5,-1>}
  object {Window rotate y*90 translate <1,0.5,0>}
  pigment {rgb 1}
}

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: frozen
Subject: Re: cutting irregular holes?!
Date: 14 Sep 2004 06:00:00
Message: <web.4146c119732004dc1f09a3bc0@news.povray.org>
Dear Mike,

thanks a lot for this hint! It is quite hard to do it this way with Moray,
since it seems to have problems when the scene gets "full" (objects are
invisible, if another object is behind (!) them).. But it works great, once
it works! I hope, it is possible, to fill the cut area with some other CSGs
and primitives, to build the window glass pieces... At these ages, it
wasn't possible to create large glass pieces, to fill a complete window
with one piece... I'm afraid, this will be my next question.

I'm afraid, I will have to do my scene in pure Povray code, since I finished
approx. 10% of it and Moray already has problems.. This might be the death
of my idea.. :-(

Thankful greetings,

frozen


Post a reply to this message

From: Stephen
Subject: Re: cutting irregular holes?!
Date: 14 Sep 2004 09:00:01
Message: <web.4146ea25732004dc71087b900@news.povray.org>
"frozen" <fro### [at] thefrozenno-ipcom> wrote:
> Hi!
>

> First I should mention, that I use Moray a lot. So if it is possible,
> pleeeaaaase (!) give hints, that work with this program! ;-)
>
> Using a CSG to cut a box-shaped window is no problem. But what kind
> of shape can be used to build the desired arched window AND is usable in a
> CSG? Using a mesh for example leads to an parsing error, since meshes
> aren't allowed in CSGs.
>
> Thanks for your help!
>


out. It might be better to ask Moray questions in the Moray Newsgroups.
Sorry I cannot tell you exactly which one to use but I am not at a machine
with Moray installed on it.

Stephen


Post a reply to this message

From: frozen
Subject: Re: cutting irregular holes?!
Date: 14 Sep 2004 09:25:01
Message: <web.4146f074732004dc1f09a3bc0@news.povray.org>
"Stephen" <mca### [at] hotmailcom> wrote:

> out. It might be better to ask Moray questions in the Moray Newsgroups.
> Sorry I cannot tell you exactly which one to use but I am not at a machine
> with Moray installed on it.
>
> Stephen

First: Many thanks for your answer!

You missunderstand me, if you think, I want a specialized Moray-answer. I
just want to know, how something like the desired effect can be done in
general. If possible (and only then) I would try to perform this with
Moray. If not, I have to try without it. Since I ain't trained very well in
"thinking 3d" this is very hard for me, which is why i prefer something,
which can be done with Moray, like the CSGs mentioned above.

The "sweeps" Moray creates ain't "real" sweeps but objects of many many
triangles, a mesh I think. So they unfortunately can't be used in CSGs.
Well, this is what I found out until now.. Maybe I'm wrong.

Please tell me, if this question should be a new topic:
Is it an acceptable way to model some complex things in Moray and use the
created code to put the scene together in Povray itself? So that only some
translations need to be done in Povray code or maybe in a few cases the
points created in Moray could be hints for modeling it with Povray code
using a "real" sweep for example? For me this seems to be a good idea but
maybe someone can tell me, that it isn't?

Again thanks a lot for your kind answers!

frozen


Post a reply to this message

From: GreyBeard
Subject: Re: cutting irregular holes?!
Date: 14 Sep 2004 10:16:00
Message: <4146fd20$1@news.povray.org>
"frozen" <fro### [at] thefrozenno-ipcom> wrote in message
news:web.41469d9a89bd8e201f09a3bc0@news.povray.org...
> Hi!
> I try to build a medieval building using a photo of a real castle as
> reference. Right now I'm stuck at "cutting" the windows into it. I used a
> large box for the building itself. Now I need to cut the windows into it,
> and so I thought I could use a difference CSG. But the windows have a
> shape, which is different from a box or sphere or anything like this. They
> somehow look like a box in the lower part with two archs building the
upper
> part. Using a CSG to cut a box-shaped window is no problem. But what kind
> of shape can be used to build the desired arched window AND is usable in a
> CSG? Using a mesh for example leads to an parsing error, since meshes
> aren't allowed in CSGs.
>
The arch macros by Bonsai might be what you're looking for, sorry, couldn't
find the URL, maybe someone has it and will be kind enough to post it.
Arched holes can be cut with difference and a scaled cylinder if your needs
are relatively simple in shape.

Greybeard


Post a reply to this message

From: frozen
Subject: Re: cutting irregular holes?!
Date: 14 Sep 2004 11:25:01
Message: <web.41470cb7732004dc1f09a3bc0@news.povray.org>
"GreyBeard" <r.b### [at] sbcglobalnet> wrote:
> The arch macros by Bonsai might be what you're looking for, sorry, couldn't
> find the URL, maybe someone has it and will be kind enough to post it.
> Arched holes can be cut with difference and a scaled cylinder if your needs
> are relatively simple in shape.
>
> Greybeard

Hi!

Correct me, if I'm wrong, but it seems impossible to create archs with a
sharp upper end? I mean: It somehow looks like the intersection of a
cylinder and a box, as you also suggest. This doesn't exactly do, what I
want (sorry if my poor english made me explain it in a way that is not
understandable). The first answer I received used two cylinders and a box
and did exactly what was required. I tried to do this with Moray and it
works..

Thanks for your answer! I'm surprised how many people answer newbie
questions here! It's great!

Greetings,

frozen


Post a reply to this message

From: Stephen
Subject: Re: cutting irregular holes?!
Date: 14 Sep 2004 11:45:00
Message: <web.414710e8732004dc71087b900@news.povray.org>
"frozen" <fro### [at] thefrozenno-ipcom> wrote:

> You missunderstand me, if you think, I want a specialized Moray-answer. I
> just want to know, how something like the desired effect can be done in
> general. If possible (and only then) I would try to perform this with
> Moray. If not, I have to try without it. Since I ain't trained very well in
> "thinking 3d" this is very hard for me, which is why i prefer something,
> which can be done with Moray, like the CSGs mentioned above.
>
> The "sweeps" Moray creates ain't "real" sweeps but objects of many many
> triangles, a mesh I think. So they unfortunately can't be used in CSGs.
> Well, this is what I found out until now.. Maybe I'm wrong.
>


Try the translational sweep. I know Moray gives an Error message but accept

Polyray (?)
It works I just downloaded Moray to try it.


> Please tell me, if this question should be a new topic:
> Is it an acceptable way to model some complex things in Moray and use the
> created code to put the scene together in Povray itself? So that only some
> translations need to be done in Povray code or maybe in a few cases the
> points created in Moray could be hints for modeling it with Povray code
> using a "real" sweep for example? For me this seems to be a good idea but
> maybe someone can tell me, that it isn't?
>
That is what I do, especially for animations.

Stephen


Post a reply to this message

From: Jim Charter
Subject: Re: cutting irregular holes?!
Date: 14 Sep 2004 16:16:02
Message: <41475182$1@news.povray.org>
frozen wrote:

> Correct me, if I'm wrong, but it seems impossible to create archs with a
> sharp upper end?  
> 
Not impossible but I confess it was harder than I expected:

intersection {

         intersection {

                 union {
                         cylinder {
                           -1*z, 1*z, 1


                         }
                         box { <-1,-1,-1> <1,0,1>  }

                         translate x*-.30
                 }

                 union {
                         cylinder {
                           -1*z, 1*z, 1


                         }
                         box { <-1,-1,-1> <1,0,1>  }

                         translate x*.30
                 }

         }

         box { <-1.1,-1.1,-0.9> <1.1,2,0.9> }

         pigment {
              rgb 1
             }
}


Post a reply to this message

From: Slime
Subject: Re: cutting irregular holes?!
Date: 14 Sep 2004 16:29:14
Message: <4147549a$1@news.povray.org>
> Not impossible but I confess it was harder than I expected

More simply:

union {
 intersection {
  cylinder { // right roundedness
   -1*z, 1*z, 1
   translate -x*.3
  }
  cylinder { // left roundedness
   -1.0001*z, 1.0001*z, 1
   translate  x*.3
  }
 }

 box { <-.7,-1,-1> <.7,0,1>  } // square window area

 pigment {rgb 1}
}

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

Goto Latest 10 Messages Next 3 Messages >>>

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