POV-Ray : Newsgroups : povray.advanced-users : Ok, seriously, I need help here.. : Re: Ok, seriously, I need help here.. Server Time
5 Jul 2024 15:48:35 EDT (-0400)
  Re: Ok, seriously, I need help here..  
From: Patrick Elliott
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

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