|
|
Hello,
Let's say I do the following, so what I end up with is two 4-sided CSG objects
somewhere in space. Now, using cylinders like the ones below, I'd like to
connect the 4 corners of the first CSG object to the 4 corners of the second,
but I can't figure out how to do it. Any thoughts?
#declare Smooth = finish {specular 0.3 roughness 0.05}
#declare BondWidth = 0.1;
#declare atoms = rgb < 0, 0, 0.5 >;
#declare bonds = rgb < 0.3, 0.3, 0.3 >;
#declare C =
sphere {
<0.0, 0.0, 0.0>, 0.4
texture {
pigment {colour atoms}
finish {Smooth}
}
}
#declare A1 = < 0, 0, 0 >;
#declare A2 = < 1, 0, 0 >;
#declare A3 = < 1 ,1, 0 >;
#declare A4 = < 0, 1, 0 >;
//CSG object 1
union {
object {
C
translate A1
}
object {
C
translate A2
}
object {
C
translate A3
}
object {
C
translate A4
}
cylinder {
A1,
A2,
BondWidth
pigment {colour bonds}
finish {Smooth}
}
cylinder {
A2,
A3,
BondWidth
pigment {colour bonds}
finish {Smooth}
}
cylinder {
A3,
A4,
BondWidth
pigment {colour bonds}
finish {Smooth}
}
cylinder {
A4,
A1,
BondWidth
pigment {colour bonds}
finish {Smooth}
}
rotate SOME_ROTATE_VECTOR
translate SOME_TRANSLATE_VECTOR
}
//CSG object 2
union {
object {
C
translate A1
}
object {
C
translate A2
}
object {
C
translate A3
}
object {
C
translate A4
}
cylinder {
A1,
A2,
BondWidth
pigment {colour bonds}
finish {Smooth}
}
cylinder {
A2,
A3,
BondWidth
pigment {colour bonds}
finish {Smooth}
}
cylinder {
A3,
A4,
BondWidth
pigment {colour bonds}
finish {Smooth}
}
cylinder {
A4,
A1,
BondWidth
pigment {colour bonds}
finish {Smooth}
}
rotate SOME_OTHER_ROTATE_VECTOR
translate SOME_OTHER_TRANSLATE_VECTOR
}
Post a reply to this message
|
|
|
|
"this is me" <nomail@nomail> wrote in message
news:web.47b2cc652e14cb95988f09540@news.povray.org...
> Hello,
>
> Let's say I do the following, so what I end up with is two 4-sided CSG
> objects
> somewhere in space. Now, using cylinders like the ones below, I'd like to
> connect the 4 corners of the first CSG object to the 4 corners of the
> second,
> but I can't figure out how to do it. Any thoughts?
>
You can declare a transformation for each rotation/translation pair, then
use your transform both to position the objects and to reposition the
location vectors that you need for the ends of the cylinders. Something like
the following:
#declare MyTransform1 = transform {rotate ... translate ...}
object {... transform {MyTransform1}}
...
cylinder
{vtransform(MyPoint1,MyTransform1),vtransform(MyPoint1,MyTransform2),MyRadius
...}
...
Regards,
Chris B.
Post a reply to this message
|
|
|
|
"Chris B" <nom### [at] nomailcom> wrote:
>
> You can declare a transformation for each rotation/translation pair, then
> use your transform both to position the objects and to reposition the
> location vectors that you need for the ends of the cylinders. Something like
> the following:
>
> #declare MyTransform1 = transform {rotate ... translate ...}
> object {... transform {MyTransform1}}
> ...
> cylinder
> {vtransform(MyPoint1,MyTransform1),vtransform(MyPoint1,MyTransform2),MyRadius
> ...}
> ...
>
>
> Regards,
> Chris B.
Excellent! Just the kind of push in the right direction for which I was
looking.
Post a reply to this message
|
|