![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Hi,
Here is a question that I thought would be easy. . but it is not and now my
mind is in a intersection-difference loop :)
little history:
I compiled a little program, that I got out of a book some years ago, that
makes a little puzzle. I modified it to export to povray but seemed to be
missing the intersection that fills in the gaps < see thumbnail >
it is a collection of spheres and cylinders to make an array of trapezoids.
My problem is filling in the centers.
My idea is to difference 2 planes and take that and add it back. . just
seems like it is not the most efficient way
Any ideas?
here is the snippets of code to make one trapezoid:
#declare trpzd = union {
sphere {
<0,0,0>,1
scale 0.1
translate <0.1, 0.1, 0.0>
}
sphere { <0,0,0>,1
scale 0.1
translate <0.1, 0.9, 0.0>
}
sphere { <0,0,0>,1
scale 0.1
translate <0.90119, 0.89002, 0.0>
}
sphere { <0,0,0>,1
scale 0.1
translate <0.9, 0.1, 0.0>
}
cylinder { <0,0,1>, <0,0,0>, 1
scale <0.1, 0.1, 0.8>
rotate 90.0*y
translate <0.1, 0.1, 0.0>
}
cylinder { <0,0,1>, <0,0,0>, 1
scale <0.1, 0.1, 0.8>
rotate 270.0*x
translate <0.1, 0.1, 0.0>
}
cylinder { <0,0,1>, <0,0,0>, 1
scale <0.1, 0.1, 0.790021>
rotate <89.913696, 270.000214, 0.0>
translate <0.90119, 0.89002, 0.0>
}
cylinder { <0,0,1>, <0,0,0>, 1
scale <0.1, 0.1, 0.801252>
rotate <359.286346, 270.0, 0.0>
translate <0.90119, 0.89002, 0.0>
}
}
object { trpzd
material {
T_Grnt19
}
}
Post a reply to this message
Attachments:
Download 'puzzle-test.JPG' (38 KB)
Preview of image 'puzzle-test.JPG'
![puzzle-test.JPG](/povray.newusers/attachment/%3C3f999db9%40news.povray.org%3E/puzzle-test.JPG?ttop=440477&toff=1950&preview=1)
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Sorry about the image; I thought it was ok if it was a small thumbnail.
Please don't flame me for this one time. :^>
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
// Hi Thomas,
//
// your pieces seem to be flat, so a prism will do what you need.
// If the pieces are not transparent and are not seen from below,
// a polygon instead of the prism will suffice.
//
// I've provided a small scene below showing the piece you posted
// with a prism for the inside. Additionally I've changed the
// code for the spheres and cylinders which is unneccessarily
// complicated and inaccurate; only single precision seems to
// be used (270.000214 instead of 270), so these calculations
// should be done by POV-Ray's double precision arithmetic: you
// should change the code that generates the spheres and cylinders.
//
// Sputnik
// Trapezoid with filled-in prism
// -F +D +A0.1 +AM2 +R3
#declare P1 = <0.1, 0.1, 0>;
#declare P2 = <0.1, 0.9, 0>;
#declare P3 = <0.90119, .89002, 0>; // try <1.2, 0.6, 0>
#declare P4 = <0.9, 0.1, 0>;
#declare Trpzd =
union {
sphere { P1, 0.1 }
sphere { P2, 0.1 }
sphere { P3, 0.1 }
sphere { P4, 0.1 }
cylinder { P1, P2, 0.1 }
cylinder { P2, P3, 0.1 }
cylinder { P3, P4, 0.1 }
cylinder { P4, P1, 0.1 }
prism { -0.1, 0.1, 4,
<P1.x,P1.y>, <P2.x,P2.y>, <P3.x,P3.y>, <P4.x,P4.y>
rotate -90*x
}
}
object { Trpzd
pigment { color rgb 1 }
finish { ambient .3 diffuse .7 }
}
plane { -z, -0.1
pigment { checker }
finish { ambient .3 diffuse .7 }
}
light_source { <-1, 2, -3>*100, rgb 1 }
camera { location -1.5*z look_at 0
rotate <50, -20, 0>
rotate -90*x
translate <0.5, 0.4, 0>
}
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Thomas Barnes wrote:
>
> Sorry about the image; I thought it was ok if it was a small thumbnail.
> Please don't flame me for this one time. :^>
<flame on>
I'll let it slide this time, but, just don't let it happen again, please.
<flame off>
--
Ken Tyler
POV-Ray News Group Administrator
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
I asked please. . jeesh :^>
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
That is a great idea!
I did not know about the prism . . yet.
The last time is used pov was in the 2.0 days. . that is very cool
unfortunatly, I lost the code in a fire, along with the book. . . I am just
making a quick bourne shell script to parse the output and put it into pov
3.5 compatability.
Later, I think a macro would be nice to take all these verticies and make
some kind of mesh. . . that will be the next exercise :)
THANKS!
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |