Thursday, March 31, 2011

Current Progress: CGAL lib and Curve Editor

Just successfully got the output of union operation for two polygons using CGAL.

experimental results:
                                                     original polygons

                                                   union operator

                                                      intersection operator


                                                     subtraction operator
Some tips:

The variable <Number_type> in the examples should be specified, and float is working well.

The points composing the polygons should be arranged counter clockwise in the x-y plane, or the program will crash down.

CGAL Polygon_2 class could close a polygon automatically, which means we do not have to reload the starting point as the ending point.

The input type of union operation should be Polygon_2, while the output should be Polygon_with_holes_2.

The type of Polygon_2 is actually a list, so [] operator is very convenient. However, Polygon_with_holes_2 is much more complex, and the member function outer_boundary() could get the result as Polygon_2 for further conversion to vec3 and curve editor drawer.

Something annoying is that, IntelliSence does not work for this project. oops...

Cheers, let's carry on to more excitement!

Wednesday, March 30, 2011

Current Progress: CGAL lib for boolean computation

Successfully modified curve editor system to display 2D polygons.

Found a library for 2D operations including polygon boolean computation: CGAL, seems be powerful for it.

Finally embedded it in the project. Some tips for memory in case of transplanting it to other computers:

file link: http://www.cgal.org/
edition: 3.8 beta
first download CGAL and install it.
download boost and install it, take care: must click THREAD for CMake generation!
download and run CMake to generate the project of CGAL, compile it (seems should in release mode)
embed the include folder and set up the linker to the lib folder in CGAL project and boost folder
transplant the "compiler_config.h" from the project of CGAL to the include folder
COMPILE & DONEPublish Post

Tuesday, March 29, 2011

Current Progress

Doing boolean computation using the OpenGL system in Curve Editor framework to get an output of the results.


After comparison between different methods, determined to use the winding number method to test the relative positions of the vertices and resort them in vectors.

reference: http://softsurfer.com/Archive/algorithm_0103/algorithm_0103.htm

Monday, March 21, 2011

Weekly Report

Sad that we did not report for the last couple of weeks.

So right now we have made several progresses:

1. We made a rough user interface on Maya platform, using MEL. The user will have to draw some 2D enclosed shapes with Maya's curve tool to represent the two or three view images. Then these 2D shapes will be automatically duplicated and departed to form the "visual hull" in the Maya 3D window. Using the 3D tools, we can get the 3D cylinder with the input cross shape accurately. The boolean operators, including union, intersection and subtraction, are implemented by Maya 3D boolean tool directly. In this way we can get a result for most simple shapes and boolean computation.

2.However, what we want to make use of in Maya is only its 3 view plane and the 3D window. We want to compute the boolean operations ourselves in order to get a faster and more convenient approach. For this aspect, we are now trying to implement boolean operations for 2D polygons in one plane, which is the fundamental part of the whole algorithm. As Dr. Lane put it, we will also introduce OpenGL at this step to get a vividly graphic feedback for the algorithm.

Alright, that is where we are. We will make more progress and thank you for keeping an eye on us!

Sunday, March 13, 2011

About the Maya API

Hey you know what, although Maya's user interface is basically for 3D editing, we may make use of curves in the three view planes and record the positions of the control points as input to the CSG algorithm. Let's discuss it sweetly.