POV-Ray : Newsgroups : povray.advanced-users : Ok, seriously, I need help here.. Server Time
3 Jul 2024 06:03:09 EDT (-0400)
  Ok, seriously, I need help here.. (Message 1 to 10 of 23)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Patrick Elliott
Subject: Ok, seriously, I need help here..
Date: 1 Mar 2008 23:23:52
Message: <MPG.2233d9924b5f2c2098a10d@news.povray.org>
Decided to rework the design of the octahedron, so that it *should* 
allow me to do this:

#declare octoside = {blah}

union {
  object {octoside
          rotate <0,90,0>}
  ...
}

and get the result I want. The problem is, this is as far as I got:

camera{
        orthographic
        location <0,sqrt(2)/2,-3> look_at <0,sqrt(2)/2,0> angle 60
        right x up y
}

light_source{<5,5,-10>,1.5}

//intersection {
  union {
    sphere {<-1,0,0>,0.075}
    sphere {<1,0,0>,0.075}
    sphere {<0,sqrt(2),0>,0.075}
    cylinder {<-1,0,0>,<1,0,0>,0.075}
    cylinder {<0,sqrt(2),0>,<1,0,0>,0.075}
    cylinder {<-1,0,0>,<0,sqrt(2),0>,0.075}
    texture {
      pigment {rgb <1,1,1>}
    }
    //triangle {<-1,0,-0.075>,<0,sqrt(2),-0.075>,<1,0,-0.075>}
    //triangle {<-1,0,0.075>,<0,sqrt(2),0.075>,<1,0,0.075>}
  //rotate <45,0,0> <- test purposes, move to last statement in final 
object, with translate.
  //translate <0,0,-1>
  }
//  box {<-1,0,-0.075>,<1,sqrt(2),0.075>}
//
//}

Neeless to say, since the original used intersection, I took a chance on 
that working. It didn't. The **best** solution would be if I could tie 
triangles to the center points and weld them to the main object, to 
produce a solid, or at least one solid enough to cut sections out of and 
have material left behind, instead of a hollow shell with a hole in it. 
It only get worse if I want to late make a crystal version, or some 
other such thing, where the entire inside has to be solid, instead of it 
being hollow. There has got to be some means I can fill in the sides, 
like I want, and also the rest of the interior of the final object. I am 
just not seeing it at the moment. And, if its something blindingly 
obvious, like using triangles some how, then I can even set the exact 
points I want, instead of using the 45 degree angle trick and computing 
the sqrt(2) length for the side being rotated into place. Can't imaging 
why I didn't try something like this before... lol Might have been 
easier to model this bloody thing as a patch.

-- 
void main () {

    if version = "Vista" {
      call slow_by_half();
      call DRM_everything();
    }
    call functional_code();
  }
  else
    call crash_windows();
}

<A HREF='http://www.daz3d.com/index.php?refid=16130551'>Get 3D Models,
 
3D Content, and 3D Software at DAZ3D!</A>


Post a reply to this message

From: Patrick Elliott
Subject: Re: Ok, seriously, I need help here..
Date: 1 Mar 2008 23:31:56
Message: <MPG.2233dba454ebb7698a10e@news.povray.org>
To be more specific. This is what it looks like, when everything is 
where is supposed to be, except the fill in for the sides:

camera{
        orthographic
        location <0,0,-3> look_at <0,0,0> angle 60
        right x up y
}

light_source{<5,5,-10>,1.5}

#declare octaside = 
//intersection {
  union {
    sphere {<-1,0,0>,0.075}
    sphere {<1,0,0>,0.075}
    sphere {<0,sqrt(2),0>,0.075}
    cylinder {<-1,0,0>,<1,0,0>,0.075}
    cylinder {<0,sqrt(2),0>,<1,0,0>,0.075}
    cylinder {<-1,0,0>,<0,sqrt(2),0>,0.075}
    texture {
      pigment {rgb <1,1,1>}
    }
    //triangle {<-1,0,-0.075>,<0,sqrt(2),-0.075>,<1,0,-0.075>}
    //triangle {<-1,0,0.075>,<0,sqrt(2),0.075>,<1,0,0.075>}
  rotate <45,0,0> // test purposes, move to last statement in final 
object, with translate.
  translate <0,0,-1>
  }
//  box {<-1,0,-0.075>,<1,sqrt(2),0.075>}
//
//}}

union {
  object {octaside}
  object {octaside
    rotate <0,90,0>}
  object {octaside
    rotate <0,180,0>}
  object {octaside
    rotate <0,270,0>}
  union {
    object {octaside}
    object {octaside
      rotate <0,90,0>}
    object {octaside
      rotate <0,180,0>}
    object {octaside
      rotate <0,270,0>}
    rotate <0,0,180>
  }  
  rotate <0,10,0>
}


Post a reply to this message

From: Jaap Frank
Subject: Re: Ok, seriously, I need help here..
Date: 2 Mar 2008 05:48:44
Message: <47ca860c@news.povray.org>
> To be more specific. This is what it looks like, when everything is
> where is supposed to be, except the fill in for the sides:
>
> camera{
>        orthographic
>  ...
>  ...
>    rotate <0,0,180>
>  }
>  rotate <0,10,0>
> }

Because triangles are not solid objects but surfaces only, you can't carve 
something out of it.
If you use prisms instead, you get something solid.
Manual: 3.4.1.8 Prism.

Succes,

Jaap


Post a reply to this message

From: Warp
Subject: Re: Ok, seriously, I need help here..
Date: 2 Mar 2008 07:31:46
Message: <47ca9e31@news.povray.org>
Jaap Frank <jjf### [at] casemanl> wrote:
> Because triangles are not solid objects but surfaces only, you can't carve 
> something out of it.

  No primitive in POV-Ray is solid. Everything is just a surface.

  What "solid" means in terms of CSG is that some points can be defined
to be "outside" the surface and others "inside" it. Thus "closed surface"
would be a much more accurate term than "solid".

  The problem with eg. the triangle primitive is that it's not a closed
surface, but on open one. Thus it can't have a defined interior (ie. there
aren't points which can be said to be "inside" a triangle).

  OTOH, a closed triangle mesh can be defined as being "solid" because
POV-Ray can determine whether a point is inside this closed mesh or not.
This can be done by using the inside_vector feature of meshes.

-- 
                                                          - Warp


Post a reply to this message

From: Alain
Subject: Re: Ok, seriously, I need help here..
Date: 2 Mar 2008 13:13:10
Message: <47caee36$1@news.povray.org>
Patrick Elliott nous apporta ses lumieres en ce 2008/03/01 23:31:
> To be more specific. This is what it looks like, when everything is 
> where is supposed to be, except the fill in for the sides:
> 
> camera{
>         orthographic
>         location <0,0,-3> look_at <0,0,0> angle 60
>         right x up y
> }
> 
> light_source{<5,5,-10>,1.5}
> 
> #declare octaside = 
> //intersection {
>   union {
>     sphere {<-1,0,0>,0.075}
>     sphere {<1,0,0>,0.075}
>     sphere {<0,sqrt(2),0>,0.075}
>     cylinder {<-1,0,0>,<1,0,0>,0.075}
>     cylinder {<0,sqrt(2),0>,<1,0,0>,0.075}
>     cylinder {<-1,0,0>,<0,sqrt(2),0>,0.075}
>     texture {
>       pigment {rgb <1,1,1>}
>     }
>     //triangle {<-1,0,-0.075>,<0,sqrt(2),-0.075>,<1,0,-0.075>}
>     //triangle {<-1,0,0.075>,<0,sqrt(2),0.075>,<1,0,0.075>}
>   rotate <45,0,0> // test purposes, move to last statement in final 
> object, with translate.
>   translate <0,0,-1>
>   }
> //  box {<-1,0,-0.075>,<1,sqrt(2),0.075>}
> //
> //}}
> 
> union {
>   object {octaside}
>   object {octaside
>     rotate <0,90,0>}
>   object {octaside
>     rotate <0,180,0>}
>   object {octaside
>     rotate <0,270,0>}
>   union {
>     object {octaside}
>     object {octaside
>       rotate <0,90,0>}
>     object {octaside
>       rotate <0,180,0>}
>     object {octaside
>       rotate <0,270,0>}
>     rotate <0,0,180>
>   }  
>   rotate <0,10,0>
> }
As it is now, you construct a single face with 3 spheres, 3 cylinders, a visible 
triangle, and an other triangle that will never show.
You then combine eight of those to form the complete shape, with 4 spheres at 
each summits and 2 sylinders at each edges, resulting in many coincident surfaces.
Triangles are only single faces objects with no inside.

You can create your octaedron from the intersection of 8 planes.
#declare SQ = sqrt(2);
intersection{plane{<0,1,SQ>,1}
	plane{<0,1,SQ>,1 rotate 90*y}
	plane{<0,1,SQ>,1 rotate 180*y}
	plane{<0,1,SQ>,1 rotate 270*y}
	plane{<0,-1,SQ>,1}
	plane{<0,-1,SQ>,1 rotate<0,90,0>}
	plane{<0,-1,SQ>,1 rotate<0,180,0>}
	plane{<0,-1,SQ>,1 rotate<0,270,0>}
	}


This give you an octaedron with sharp edges. You can then chop those edges using 
12 aditional planes. Now, add in an union the spheres and cylinders to create 
the rounded edges. Only add a single sphere per summit and a single sylinder per 
edge.

If you want it to be transparent, use a merge instead of an union.

-- 
Alain
-------------------------------------------------
Laughter is the shortest distance between two people.


Post a reply to this message

From: Patrick Elliott
Subject: Re: Ok, seriously, I need help here..
Date: 2 Mar 2008 13:47:59
Message: <MPG.2234a44a9188f12f98a10f@news.povray.org>
In article <47ca860c@news.povray.org>, jjf### [at] casemanl says...
> > To be more specific. This is what it looks like, when everything is
> > where is supposed to be, except the fill in for the sides:
> >
> > camera{
> >        orthographic
> >  ...
> >  ...
> >    rotate <0,0,180>
> >  }
> >  rotate <0,10,0>
> > }
> 
> Because triangles are not solid objects but surfaces only, you can't carv
e 
> something out of it.
> If you use prisms instead, you get something solid.
> Manual: 3.4.1.8 Prism.
> 
> Succes,
> 
> Jaap 
> 
Ah. Right. Didn't think about that one. lol Thanks.

-- 
void main () {

    if version = "Vista" {
      call slow_by_half();
      call DRM_everything();
    }
    call functional_code();
  }
  else
    call crash_windows();
}

<A HREF='http://www.daz3d.com/index.php?refid=16130551'>Get 3D Models,
 
3D Content, and 3D Software at DAZ3D!</A>


Post a reply to this message

From: Patrick Elliott
Subject: Re: Ok, seriously, I need help here..
Date: 2 Mar 2008 14:11:40
Message: <MPG.2234a9a9da7096d598a110@news.povray.org>
In article <47caee36$1@news.povray.org>, ele### [at] netscapenet 
says...
> Patrick Elliott nous apporta ses lumieres en ce 2008/03/01 23:31:
> > To be more specific. This is what it looks like, when everything is 
> > where is supposed to be, except the fill in for the sides:
> > 
> > camera{
> >         orthographic
> >         location <0,0,-3> look_at <0,0,0> angle 60
> >         right x up y
> > }
> > 
> > light_source{<5,5,-10>,1.5}
> > 
> > #declare octaside = 
> > //intersection {
> >   union {
> >     sphere {<-1,0,0>,0.075}
> >     sphere {<1,0,0>,0.075}
> >     sphere {<0,sqrt(2),0>,0.075}
> >     cylinder {<-1,0,0>,<1,0,0>,0.075}
> >     cylinder {<0,sqrt(2),0>,<1,0,0>,0.075}
> >     cylinder {<-1,0,0>,<0,sqrt(2),0>,0.075}
> >     texture {
> >       pigment {rgb <1,1,1>}
> >     }
> >     //triangle {<-1,0,-0.075>,<0,sqrt(2),-0.075>,<1,0,-0.075>}
> >     //triangle {<-1,0,0.075>,<0,sqrt(2),0.075>,<1,0,0.075>}
> >   rotate <45,0,0> // test purposes, move to last statement in final 
> > object, with translate.
> >   translate <0,0,-1>
> >   }
> > //  box {<-1,0,-0.075>,<1,sqrt(2),0.075>}
> > //
> > //}}
> > 
> > union {
> >   object {octaside}
> >   object {octaside
> >     rotate <0,90,0>}
> >   object {octaside
> >     rotate <0,180,0>}
> >   object {octaside
> >     rotate <0,270,0>}
> >   union {
> >     object {octaside}
> >     object {octaside
> >       rotate <0,90,0>}
> >     object {octaside
> >       rotate <0,180,0>}
> >     object {octaside
> >       rotate <0,270,0>}
> >     rotate <0,0,180>
> >   }  
> >   rotate <0,10,0>
> > }
> As it is now, you construct a single face with 3 spheres, 3 cylinders, a 
visible 
> triangle, and an other triangle that will never show.
> You then combine eight of those to form the complete shape, with 4 sphere
s at 
> each summits and 2 sylinders at each edges, resulting in many coincident 
surfaces.
> Triangles are only single faces objects with no inside.
> 
> You can create your octaedron from the intersection of 8 planes.
> #declare SQ = sqrt(2);
> intersection{plane{<0,1,SQ>,1}
> 	plane{<0,1,SQ>,1 rotate 90*y}
> 	plane{<0,1,SQ>,1 rotate 180*y}
> 	plane{<0,1,SQ>,1 rotate 270*y}
> 	plane{<0,-1,SQ>,1}
> 	plane{<0,-1,SQ>,1 rotate<0,90,0>}
> 	plane{<0,-1,SQ>,1 rotate<0,180,0>}
> 	plane{<0,-1,SQ>,1 rotate<0,270,0>}
> 	}
> 
> 
> This give you an octaedron with sharp edges. You can then chop those edge
s using 
> 12 aditional planes. Now, add in an union the spheres and cylinders to cr
eate 
> the rounded edges. Only add a single sphere per summit and a single sylin
der per 
> edge.
> 
> If you want it to be transparent, use a merge instead of an union.
> 
I started trying to use the shapes2.inc octahedron. The problem is, 
chopping bits off of arbitrarily shaped objects is a pain in the ass. 
lol

Note, I am also an idiot. Moving the triangles up above the texture gave 
me a surface, but not a solid. Where they are now they generate an 
error. Jaap Frank has suggested a prism, so I will try that.

I really wish there was a built in way to define, or at least convert, 
boxes into the same format as cylinders though, i.e.:

altbox {<endpoint1>,<endpoint2>,base_width}

It would make things a whole damn lot easier to set arbitrary points for 
where its supposed to "touch", rather than the corners, some times. Its 
what always bugged me about Moray too, since the precision in that never 
matched what POVRay could do, it was often literally impossible to make 
exact matches to where you wanted things, since there was no clear way 
to tell it, "Put this end here, and the other end there!" Sure, the 
precision would still be slightly off for a box using the above too, and 
more computation would have to be done to position it, but at least I 
wouldn't have to be the one **doing** the computation myself. Making 
everything a unit size and in a specific position, then having to scale 
and rotate it, like Moray... just takes what could be a simple matter of 
scratching a few things on a note pad for an idea, then entering the 
numbers, and turns it into a crash course on math I forgot 15 years ago, 
or never took in the first place. :(

Hmm. looks like yours will produce the same basic "shape" that I am 
working with anyway, so for the crystal version it would be quite 
helpful. Planes to clip it.. Not even sure how to manage that, but I can 
probable figure it out. Figuring out how to shave the bits off I don't 
need though is usually the single biggest pain. That is why I tried to 
find a solution that would let me do *one* side, then duplicate it, 
rather than trying to shave all of them. Its really not practical to use 
anything but a flat surface to cut off the parts that will stick out 
past the cylinders, but, while this shape isn't that bad, see the above 
box comment for why its often a complete pain in the ass. ;) lol

In any case, the main goal was to just make something I could carve into 
and I might not do a crystal one anyway, so I may not need such a 
complete solution. Nice to have one though, if I decide to go that way.

-- 
void main () {

    if version = "Vista" {
      call slow_by_half();
      call DRM_everything();
    }
    call functional_code();
  }
  else
    call crash_windows();
}

<A HREF='http://www.daz3d.com/index.php?refid=16130551'>Get 3D Models,
 
3D Content, and 3D Software at DAZ3D!</A>


Post a reply to this message

From: Patrick Elliott
Subject: Re: Ok, seriously, I need help here..
Date: 2 Mar 2008 15:26:10
Message: <MPG.2234bb14eb31d9cc98a111@news.povray.org>
Attempted a compromise solution. Using the prism to "fill" the gaps, 
then the planes to "fill", with proper scaling, the hole inside. This is 
the resulting scene:

camera{
        orthographic
        location <2,2,-3> look_at <0,0,0> angle 60
        right x up y
}

#include "textures.inc"

light_source{<4,4,-9>,1.5}

#declare SQ = sqrt(2);

#declare octaside = 
  merge {
    sphere {<-1,0,0>,0.075}
    sphere {<1,0,0>,0.075}
    sphere {<0,sqrt(2),0>,0.075}
    cylinder {<-1,0,0>,<1,0,0>,0.075}
    cylinder {<0,sqrt(2),0>,<1,0,0>,0.075}
    cylinder {<-1,0,0>,<0,sqrt(2),0>,0.075}
    prism {0,-0.075,3,<-1,0>,<0,sqrt(2)>,<1,0>}
    rotate <45,0,0>
    translate <0,0,-1>
  } 

#declare roundocta = 
merge {
  object {octaside}
  object {octaside
    rotate <0,90,0>}
  object {octaside
    rotate <0,180,0>}
  object {octaside
    rotate <0,270,0>}
  union {
    object {octaside}
    object {octaside
      rotate <0,90,0>}
    object {octaside
      rotate <0,180,0>}
    object {octaside
      rotate <0,270,0>}
    rotate <0,0,180>
  }
  intersection{plane{<0,1,SQ>,1}
    plane{<0,1,SQ>,1 rotate 90*y}
    plane{<0,1,SQ>,1 rotate 180*y}
    plane{<0,1,SQ>,1 rotate 270*y}
    plane{<0,-1,SQ>,1}
    plane{<0,-1,SQ>,1 rotate<0,90,0>}
    plane{<0,-1,SQ>,1 rotate<0,180,0>}
    plane{<0,-1,SQ>,1 rotate<0,270,0>}
    scale <.85,.6,.85>
  }
}

object {roundocta
  texture {
    pigment {rgbt <1,1,1,1>}
  }
  interior {ior 1.45
    fade_distance 2
    fade_power 2
    caustics 2.0}
  rotate <0,10,0>
}

plane {z, 1.7
  texture{pigment{rgb <1,1,1>}}
}

plane {-y, 1.7
  texture{Jade}
}

plane {-x, 1.7
  texture{pigment{rgb <1,0,0>}}
}

Something just doesn't seem right about the result. Without caustics, or 
viewed from a different angle, it looks even worse imho, and I am not 
entirely sure what the problem is... Well, other than the obvious 
possibility that his hack job is producing gaps I don't see when simply 
clipping half the object off, to look for them, or coincident surfaces. 
I kind of don't get why the plane based geometry isn't quite a correct 
match either. I specifically picked the points as I did to give a 
specific "known" triangle between the meridian, the top and 0,0,0, so I 
would be sure the spheres and other things lined up where they needed 
to, and I am not scaling anything, so in theory, the points where the 
intersecting planes meet *should* be the same shape as what I 
produced... Sigh... I have no clue what I am doing, do I? lol

-- 
void main () {

    if version = "Vista" {
      call slow_by_half();
      call DRM_everything();
    }
    call functional_code();
  }
  else
    call crash_windows();
}

<A HREF='http://www.daz3d.com/index.php?refid=16130551'>Get 3D Models,
 
3D Content, and 3D Software at DAZ3D!</A>


Post a reply to this message

From: Jan Dvorak
Subject: Re: Ok, seriously, I need help here..
Date: 2 Mar 2008 15:53:28
Message: <47cb13c8$1@news.povray.org>
Warp napsal(a):
> Jaap Frank <jjf### [at] casemanl> wrote:
>> Because triangles are not solid objects but surfaces only, you can't carve 
>> something out of it.
> 
>   No primitive in POV-Ray is solid. Everything is just a surface.
> 
>   What "solid" means in terms of CSG is that some points can be defined
> to be "outside" the surface and others "inside" it. Thus "closed surface"
> would be a much more accurate term than "solid".
> 
>   The problem with eg. the triangle primitive is that it's not a closed
> surface, but on open one. Thus it can't have a defined interior (ie. there
> aren't points which can be said to be "inside" a triangle).
> 
>   OTOH, a closed triangle mesh can be defined as being "solid" because
> POV-Ray can determine whether a point is inside this closed mesh or not.
> This can be done by using the inside_vector feature of meshes.
> 
well, umm, thanks. And remember the sun doesn't move. But that doesn't 
stop us from saying it does. I often say the sun has moved behind the 
even though there is no such thing as a horizon and the doesn't move at 
all (well, it does). It is because the result is the same (up to some 
feeble effects).

By saying "a sphere is solid" i imply "with respect to the context" and 
I mean "a sphere behaves just like it was solid" i.e. "you can do CSG 
with spheres". (actually, the sphere *doesn't* behave, it has no brain).
What I'm trying to say, people often describe what do objects do 
(interface) rather than how do they do it (implementation).

Your comment would be appropriate as a response to someone claiming the 
raytracer considers the whole object interior when raytracing it. IMO 
your comment is inappropriate here I don't mean to be rude, I simply 
find it strange that you defend something that's not being denied. If 
not inappropriate, your comment is not very hepful (neither is mine, I 
admit)

-- 
You know you've been raytracing too long when...
you ever saw a beautiful scenerey and regretted not to take your 6" 
reflective ball and a digital camera, thinking "this would have been a 
perfect light probe"
-Johnny D


Post a reply to this message

From: Jan Dvorak
Subject: Re: Ok, seriously, I need help here..
Date: 2 Mar 2008 16:03:06
Message: <47cb160a$1@news.povray.org>
> I really wish there was a built in way to define, or at least convert, 
> boxes into the same format as cylinders though, i.e.:
> 
> altbox {<endpoint1>,<endpoint2>,base_width}
> 
You can use Reorient_Trans() from transforms.inc and VDist() from 
math.inc to align the box and a vector average (p1+p2)/2 to position it. 
Not that tough.
-- 
You know you've been raytracing too long when...
you ever saw a beautiful scenerey and regretted not to take your 6" 
reflective ball and a digital camera, thinking "this would have been a 
perfect light probe"
-Johnny D


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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