# create a collection of vertex for a solid with a collection of Planes?

I want to draw mineral crystal with Geogebra. Basically, I input a collection of Planes in 3D, and want to get the solid which is enclosed with all these Planes.

Take octahedron for example, i cannot use the octahedron command, since crystal in real world does not have the theoretical shape, it is just all eight surface keep the same angle as octahedron, but different surface can have different distance to the center point of the crystal.

A Plane is represented with equation: ax+by+cz=k. So, I define two lists for my "octahedron":

one list named "O" is for the eight "k"s of the equations, which is proportional to the distance of the plane to point (0,0,0).

the other list named "Oabc" is a matrix of the eight a,b,c coefficient, which represents intercepts on three axis.

Then, i can define a sequence of eight Planes named "OPlanes" with these two lists.

Next, i get sequence named "OPlanesIntersect", which is the collection of lines created by IntersectPath of Planes.

After that, I can get a collection of Points named "LineIntersects" by Intersect those lines in "OPlanesIntersect".

Not all these points is useful for me, only those points on at least three lines form a vertex of the solid. So, i need to get those points, the problem is how? the points in "LineIntersects" have duplicates, seems that i only need to count the frequency, and get those with frequency count more than 3.

I tried the command Frequency(LineIntersects), but it does not work, and Sort(LineIntersects) does not seem to return result as i expect.

If these cannot be done with ggb command, is it possible with javascript? or develope a new command with Java will be better for this?

ggb file share link:https://www.geogebra.org/m/ws5bdcma

Note: I do not know if the mathematical principles are correct. The following only refers to the question "at least 3 OPlanesInterset for one LineIntersect

----------------------------------------

"OPlanesIntersect" and "LineIntersects" have duplicates

eliminate duplicates with: Unique(<list>) and eliminate undefines with RemoveUndefined(<list>)

now you can count how many OplanesIntersect has one LineIntersects with:

l3 = Zip(Sum(Zip(If(Distance(Li, OP) ≟ 0, 1, 0), OP, OPlanesIntersect)), Li, LineIntersects)

in your sample all has 3 or 6 OPlanesIntersect.

If not, you can write

LineIntersects_3 = RemoveUndefined(Sequence(If(l3(n) ≥ 3, LineIntersects(n)), n, 1, Length(l3)))

he intentado hacer la figura pero al no haber visto la forma esperada ni entender bien la descripción en ingles no he conseguido hacerla entera

por otra parte si tengo dos rectas que se cortan, dadas por planos r1={pi1,pi2} y r2={pi3,pi4} entonces los cuatro planos forman un sistema compatible determinado y entonces el punto de interseccion está en r1, r2 y además en r3={pi1,pi3} si los planos no son paralelos. así que si un punto está en dos de las rectas entonces está en tres y no es necesario discriminarlo

es ésta? si es así hay formas más faciles de llegar a hacerla

Loading...Comments have been locked on this page!