POV-Ray : Newsgroups : povray.newusers : Problem with union of several touching polygons resulting in closed surface Server Time
22 Dec 2024 06:55:52 EST (-0500)
  Problem with union of several touching polygons resulting in closed surface (Message 1 to 4 of 4)  
From:
Subject: Problem with union of several touching polygons resulting in closed surface
Date: 23 Mar 2013 15:15:00
Message: <web.514dfe1cfd5a842d3ece0fa0@news.povray.org>
Hello everyone,

is there a common thing that I might have overlooked in the following problem?
I am trying to make an image of what is called the "first brillouinzone of an
fcc lattice". Essential I want to make an image of a closed surface that I think
can be constructed by
- first defining three touching polygons and make a union of them
- making a mirrored copy of this union using the scale object-modifier
- rotating the result four times by 90 degrees around the same axis
- mirroring the result with respect to a different plane.

However, one of the side faces I am looking for always turns out white. When I
tried to debug this and left out some of operations above I saw that I also get
different artifacts.

An approximate image of what I am trying to make can be found for example at:
http://www.ioffe.rssi.ru/SVA/NSM/Semicond/Append/figs/fmd11_2.gif

A snippet of the source code I use to implement the 4 operations is here, the
definitions of the points making up the polygon are given afterwards.

I'd appreciate any feedback. Thanks in advance!

Best,

Andreas

#declare irrBZSeiteX=object{
        polygon{4, X, W, Wp, X }
};

#declare irrBZSeiteL=object{
        polygon{6, Up, K, W, Wp, Wpp, Up}
};

#declare irrBZSeiteXp=object{
        polygon{4, Xp, Up, Wpp, Xp}
};

#declare irrBZSeiten=union{
        object{irrBZSeiteL}
        object{irrBZSeiteXp}
        object{irrBZSeiteX}
};

#declare irrBZSeiten2=union{
        object{irrBZSeiten}
        object{irrBZSeiten scale mirrorxz}
};
#declare irrBZSeiten3=union{
        object{irrBZSeiten2 rotate 0*rotz}
        object{irrBZSeiten2 rotate -90*rotz}
        object{irrBZSeiten2 rotate 180*rotz}
        object{irrBZSeiten2 rotate -90*rotz}
};
#declare irrBZSeiten4=union{
        object{irrBZSeiten3 }
        object{irrBZSeiten3 scale mirrorxy}
};


//The vectors used to define the original polygon are:
#declare G= <0, 0, 0>;
#declare L = 0.5*(k1+k2+k3) ;
#declare X = 0.5*(k2+k3);
#declare Xp = 0.5*(k1+k2);
#declare K = 0.25*(1+1/(2*coc*coc))*(k1+k2+2*k3);
#declare W = 0.5*((1/(2*coc*coc))*k1 +k2 + (1+1/(2*coc*coc))*k3);
#declare U = 0.125*( (1+1/(coc*coc))*k1 + 5*k2 + (4+1/(coc*coc))*k3);
#declare Wp = 0.25*(k1+3*k2+2*k3);
#declare Kp = 0.5*(0.75*k1+ (1.75 - 0.25/(coc*coc))*k2 + (1-0.25/(coc*coc))*k3
);
#declare Wpp = 0.5*k1 + (1-0.25/(coc*coc))*k2 + (0.5-0.25/(coc*coc))*k3;
#declare Up = 0.5*( (1.5-0.25/(coc*coc))*k1 + (1.5-0.25/(coc*coc))*k2 +
(1-0.5/(coc*coc))*k3 );

//where k1,k2, and k3 are
#declare k1=(-xdach+ydach+(1/coc)*zdach);
#declare k2=(xdach-ydach+(1/coc)*zdach);
#declare k3=(xdach+ydach-(1/coc)*zdach);

//and the vectors xdach, ydach, and zdach are used to define a right-handed
//cartesian coordinate system:
#declare xdach=<0,0,-1>;
#declare zdach=<0,1,0>;
#declare ydach=<1,0,0>;

//and the vectors rotz,roty, and rotx and mirrorxy, mirrorxz and mirroryz are
//used to implement rotations and mirrors with respect to the right-handed
//system:

#declare roty=<-1,0,0>;
#declare rotx=<0,0,-1>;
#declare rotz=<0,-1,0>;
#declare mirrorxz=<-1,1,1>;
#declare mirroryz=<1,1,-1>;
#declare mirrorxy=<1,-1,1>;


Post a reply to this message

From: waggy
Subject: Re: Problem with union of several touching polygons resulting in closed sur=
Date: 23 Mar 2013 19:00:01
Message: <web.514e32be3382d33621be1230@news.povray.org>
I don't think POV-Ray can make a solid object with an interior form polygons.

Looking at the linked image, I see a convex hull with flat sides that is an
intersection of an octahedron with a cube. Taking Gamma as the origin, the point
labeled X appears to be on one surface of the cube, with its normal pointing
along the vector from Gamma to X. Similarly, L appears to be on a surface of the
octahedron with its normal pointing from Gamma to L.

I like to make flat-sided convex hulls by intersecting planes.

#version 3.7;

#declare coc=1;// Guessed

#declare xdach=<0,0,-1>;
#declare zdach=<0,1,0>;
#declare ydach=<1,0,0>;
#declare k1=(-xdach+ydach+(1/coc)*zdach);
#declare k2=(xdach-ydach+(1/coc)*zdach);
#declare k3=(xdach+ydach-(1/coc)*zdach);
#declare L = 0.5*(k1+k2+k3) ;
#declare X = 0.5*(k2+k3);
#declare Xp = 0.5*(k1+k2);

#local X_pt = Xp;//<0,2,0>;
#local L_pt = L ;//<1,1,1>;

sphere{X_pt,0.05 pigment{color rgb<1,0,0>}}
sphere{L_pt,0.05 pigment{color rgb<0,1,0>}}

intersection{
   // Octahedron
   plane{L_pt,vlength(L_pt)             }
   plane{L_pt,vlength(L_pt) rotate  90*z}
   plane{L_pt,vlength(L_pt) rotate 180*z}
   plane{L_pt,vlength(L_pt) rotate 270*z}
   plane{L_pt,vlength(L_pt)              scale<1,1,-1>}
   plane{L_pt,vlength(L_pt) rotate  90*z scale<1,1,-1>}
   plane{L_pt,vlength(L_pt) rotate 180*z scale<1,1,-1>}
   plane{L_pt,vlength(L_pt) rotate 270*z scale<1,1,-1>}

   // Cube
   plane{X_pt,vlength(X_pt) }
   plane{X_pt,vlength(X_pt) rotate  90*z}
   plane{X_pt,vlength(X_pt) rotate 180*z}
   plane{X_pt,vlength(X_pt) rotate 270*z}
   plane{X_pt,vlength(X_pt) rotate  90*x}
   plane{X_pt,vlength(X_pt) rotate -90*x}

   pigment{color rgb<1,1,1>}
}
light_source{<1,1,1>*10, rgb<1,1,1>}
camera{location <4,2,2> look_at<0,0,0>}
// By default, x points to the right, y points upwards, and depth is along z.


Post a reply to this message

From: Alain
Subject: Re: Problem with union of several touching polygons resulting in closed surface
Date: 24 Mar 2013 17:07:48
Message: <514f6b24$1@news.povray.org>

> Hello everyone,
>
> is there a common thing that I might have overlooked in the following problem?
> I am trying to make an image of what is called the "first brillouinzone of an
> fcc lattice". Essential I want to make an image of a closed surface that I think
> can be constructed by
> - first defining three touching polygons and make a union of them
> - making a mirrored copy of this union using the scale object-modifier
> - rotating the result four times by 90 degrees around the same axis
> - mirroring the result with respect to a different plane.
>
> However, one of the side faces I am looking for always turns out white. When I
> tried to debug this and left out some of operations above I saw that I also get
> different artifacts.
>
> An approximate image of what I am trying to make can be found for example at:
> http://www.ioffe.rssi.ru/SVA/NSM/Semicond/Append/figs/fmd11_2.gif
>
> A snippet of the source code I use to implement the 4 operations is here, the
> definitions of the points making up the polygon are given afterwards.
>
> I'd appreciate any feedback. Thanks in advance!
>
> Best,
>
> Andreas
>
Did some testing with your sample. I needed to reordinate the #declare, 
you posted them in a reversed order... Your "coc" variable is BOTH a 
scaling factor AND a shape modifier and you don't provide a starting 
value for it. It's not a good practice. I used a value of 1 in my tests.

Found a problem:
#declare irrBZSeiten3=union{
         object{irrBZSeiten2 rotate 0*rotz}
         object{irrBZSeiten2 rotate -90*rotz}
         object{irrBZSeiten2 rotate 180*rotz}
         object{irrBZSeiten2 rotate -90*rotz}// two identical rotate
};
Change one of the rotate -90*rotz as rotate 90*rotz


I don't see any white face, both with the 2 coincident elements or after 
having corrected that error. I even rotated your object in several ways 
without showing your isue.

You don't provide the texture you used. Maybe it have some specular 
highlight or reflection that could make a face white...
Also, if the elements are individualy textured, the coincident ones can 
cause some problem.




Alain


Post a reply to this message

From: Alain
Subject: Re: Problem with union of several touching polygons resulting in closed sur=
Date: 24 Mar 2013 17:08:23
Message: <514f6b47$1@news.povray.org>

> I don't think POV-Ray can make a solid object with an interior form polygons.
>
>

You can make a "solid" object from any patch, triangles, or polygons. 
You just can't use them in a difference if it's not the first element.
In an intersection, it don't behave as expected.

In an intersection, you only get the surface. It will look somewhat like 
a clipped_by. If you make a difference of 2 such objects, you get nothing.
In a difference, it removes nothing, but a solid object will cut it and 
you'll see the second object's surface.

It CAN have an interior. That interior CAN have colour fading. It can 
also contain some media. It CAN'T have an inside_vector.


Alain


Post a reply to this message

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