Saturday, April 30, 2011

Current Progress: Modified Point Array

We have just modified the Point Array of the output mesh.

So now, all of the vertices of different facets at the same position will be represented by one single point in Maya. Instead of creating separate facets, we have now generated a closed model with all of its facets merged initially.

Oh yes, one bug that we were struggling with was the value of the first argument in meshFS.create(), it should be the number of vertices, but not size of FaceConnects.

Cheers!

Friday, April 29, 2011

Current Progress: Poster done and a few flaws remain

So in the past week, we made several models with our plugin successfully, including the China Pavilion on World Expo Shanghai 2010, a gun and also some random shapes. These examples showed the eligibility of our work to model 3D objects from 2D silhouettes, as well as the ability of real time user interaction. We will show the screen shots by the end of the report.

However, we have also found some new bugs, which are generally related to the combination with Maya operations. We voided the uniqueness of each vertex, but append each vertex to the PointArray even it has existed, i.e. it has the same position with one of the appended vertices in the PointArray. In doing so Maya cannot merge the meshes correctly. It is so implicit that we can not identify the problem merely from unsmoothed polygons. However, if we try to smooth the mesh using Maya MEL, we will get wired output. Normals are also not always right in real time user interaction. Although we can modify the normal using MEL, we think it is best for us to adjust the order of vertices to get it correct.

That is our goal in the following week.

China Pavilion on World Expo Shanghai 2010

Gun Model, all of its components are made using our plugin

Submachine Gun, from the above gun model using our user interaction 
Cheers!

Friday, April 22, 2011

Nearly All!

Haha so we have also modified the 3rd silhouette!

This time, we produced models that matched the silhouettes perfectly!
And also, compared with Maya Boolean, we can see that our mesh is even cleaner and better!

Take a look at our composition!
;)


So the meshed model with green outline is generated by our algorithm from the three silhouettes(blue), and the the white model is generated my Maya Boolean, see which is better.

Carry on! Let's get more!

Cheers!

Bug Done! Though another appeared~

So We have fixed the trivial facet bug by modifying the results of 2D boolean operation!

Here we go:

You see, the annoying triangle is gone!

However, another bug is founded in triple silhouette cylinder intersection, let's sweep it away!

Cheers

Debugging

So there is a bug that two polygons might be connected during boolean computation.

As shown below


The triangle between the feet of the mesh is not expected. Have been working on it for a while, I think we will figure it out soon!

Cheers!

Thursday, April 21, 2011

Construction using 3 Silhouettes!

So we've got further towards our final goal!
We have extended the construction of CSG from 2 silhouettes to 3!
In this step, for each cylinder's facet, we intersect it with the other silhouettes' cross shape polygon, and in doing so create the mesh for the final 3D model.


Construction from 3 silhouettes
Cheers!

Wednesday, April 20, 2011

Right Output!

Good News!

We have just debugged a flaw and created the right mesh!

So the bug lied in the function which converts 2D projections to 3D facets:
It should follow the formula of
Ax + By + Cz + D = 0
But when solving x, y and z, for example, x, it was incorrectly calculated as
x = ( D - By - Cz ) / A, where a (-1) is missing before D.

Alright, just some posters, and let's make it better!

Front Silhouette

Top Silhouette

Output Wire Frame

Output Shaded Mesh

Meshes

More complex model


Cheers!

First Output!

 So now we got our first output after combining the Maya API and C++ algorithm!
The First Output Is TOTALLY Wrong!
But happy about that, at least we can see it can be better.
Carry it on and figure it out!

Cheers!

Bugs Eliminated!

Hey God, we swept out the bug! It is only the difference between float and double, but cost me four days or longer to eliminate it! Don't know whether we should be happy or sad about it.

Anyway, less and less time remained. Carry on man! We will make it! And we will update this blog as soon as we get an output in Maya this evening!

Cheers

Sunday, April 10, 2011

Current Progress: Combining

So now we are combining Maya API and C++ boolean operator, hopefully we will have our output debugged before this Thursday!

Monday, April 4, 2011

Tips of Curve Editor and CGAL for potential transplant

Key functions:

Spline::PolygonBoolean()
Spline::COnvertToCGAL()
Spline::ConvertFromCGAL();

Headerfile information:



#include "CGAL/Boolean_set_operations_2.h"
#include "CGAL/Cartesian.h"
#include "CGAL/Polygon_2.h"
#include "CGAL/Polygon_set_2.h"
#include "CGAL/Polygon_with_holes_2.h"
#include <list>


struct Kernel : public CGAL::Cartesian<float>{};
typedef Kernel::Point_2 Point_2;
typedef CGAL::Polygon_2<Kernel> Polygon_2;
typedef CGAL::Polygon_with_holes_2<Kernel> Polygon_with_holes_2;//this is for union
typedef std::list<Polygon_with_holes_2> Pwh_list_2;//this is for intersection and subtraction
typedef CGAL::Polygon_set_2<Kernel> Polygon_set_2;




void PolygonBoolean();
void ConvertToCGAL(std::vector<vec3> PointList, Polygon_2 & P);
void ConvertFromCGAL(std::vector<vec3> & PointList, Polygon_2 P);


vector<vec3> curve1;
vector<vec3> results;