|
|
vinhphunguyen nous illumina en ce 2008-06-19 03:50 -->
> Hi Chris,
>
> I have two intersecting spheres as follows:
>
> #declare sphere1=
> sphere{ <0,0,0>, 5.0 pigment { color Red}}
>
>
> #declare sphere2=
> sphere{ <7,0,0>, 5.0 pigment { color Green}}
>
>
> #declare grains=merge{
> object{sphere1}
> object{sphere2}
> }
>
> Therefore, the common region of these two spheres has mixed color (Red and
> Green). However, I would like to have this intersection region Red colored,
> instead. I have found a way to do this: using more CSG operations
>
> #declare grains=union{
> object{sphere1}
> difference{
> object{sphere2}
> object{sphere1}
> }
> }
>
> But I think that this way is time-consuming in case that I have thousand spheres
> or even more. There exists another better way for this? If so, please show me
> the way to go.
>
> Thank you very much.
>
> Vinh Phu
>
>
Simple, remove the pigments from the two original spheres and apply the red
pigment to the complete CSG.
As your object is opaque, you should use union instead of merge. Merge is
usefull with transparent objects when you want to remove the internal surfaces.
It's also slower then the equivalent union.
--
Alain
-------------------------------------------------
For a people who are free, and who mean to remain so, a well-organized and
armed militia is their best security.
Thomas Jefferson
Post a reply to this message
|
|