Alexandre Felipe wrote:
> Here goes a small program wich takes some triangles find it's intersections
> it any exists, and split it in more triangles, it also create a output to
> gnuplot. (Thanks Daniel J Sebald for your help in displaying triangles).
That's more like it Alexandre. The input example you gave here touches at all viewing angles. The output triangles combine correctly to form the two input triangles. But this is a small part of the overall project. Some other elements:
1) Incorporating into gnuplot
2) Keeping track of the newly created triangles, i.e., there's a linked list of some sort
3) Make sure that all triangles are compared against other triangles. I.e., when a triangle breaks into three, those three pieces must be compared against the remain triangles, etc.
5) Proper hiding of not only surface elements but also other parts of the plot such as axes
Regarding 5, if you turn on the hidden3d you'll see there are still issues with proper displaying of these triangles even though they are broken up in a meaningful way:
set pm3d depthorder
(At least on my version of gnuplot.)
> if you want create some tests, enter the number of triangles to test,
> followed by them. each triangle is defined as nine numbers, representing
> three vertexes, each vertex read in the sequence x y z. regarding the format
> is the format that scanf can read.
The next step is to integrate the code into gnuplot and be able to generate examples using gnuplot code rather than have a separate program. Once you've compiled gnuplot it isn't much effort to modify a single source file and recompile.
> I ask that who include it in the project, please, remember me as author.
The best way of doing this Alexandre is to create a patch thread at the gnuplot Sourceforge site:
You'd need to create a Sourceforge account and then simply submit a patch. (Or in this case your original source code authored by you.) From there, others can review and try to help advance things. The reason this is good is that developers of open source programs typically can only get around to things when they have free time.
It sounds as though you are a student. Learning how to work with patch files and such would be of benefit to you down the road. If you have a bit of a break between semesters, compiling gnuplot and creating a patch might be a good project for a few days.