Wednesday, August 27, 2008

Trimmed Surfaces are Back and Lookin' Nice

I finished up the majority of the optimizations related to trimmed surface generation.  For those that are interested I was able to remove completely any need to tessellate the projected trim profiles.  I also eliminated a lot of memory reads and writes to/from the GPU.  This was done primarily through the use of a new method I added to both NurbsCurve and NurbsSurface.

This interface is a companion to GenerateClientBuffers and GenerateServerBuffers, it is called GenerateTextureBuffers.  Now you can choose to generate curves and surfaces directly into the most efficient format for how you are going to use them.  Since there are at least four different generation paths for both curves and surfaces, I am sure that there are some holes in places, but the primary paths seem to work well.

The impact on performance is nice.  It is a bit tough to gauge exactly (I need to add better timing ability), but I estimate that the overall trimmed surface generation time was reduced by 25-50%.  Wahoo!

Pictures are coming.  Oh yeah, so is STL support.  Hmm...lots to do.


Monday, August 25, 2008

No More Polygon Triangulation

First, thanks for all the great feedback last week.  I really appreciate everyone's support.  I was asked what the Windows version of Wildcat is lacking.  The core modeling functionality is identical so Win32 isn't lacking anything.  Where it is lacking is in the platform specifics and GUI.  I just don't know the Windows platform APIs well enough to do it justice.  I know that I have talked about using a purely WebKit-based UI, but now I am not so sure about this approach.  What I really need is someone interested in getting the Windows platform better supported via either Win32/MFC or wxWidgets.  Either one would be fine with me.  Wx would be great because then the Linux port would be that much easier.  If ya have some free time and want to chip in, just let me know!

Ok, about the title for today's post.  If you refer back to a post I did a couple of months ago about my approach for trimmed NURBS surfaces, one of the key steps was triangulating the projected trim curves.  This step is the only step that is on the CPU and is not the easiest to implement (I was going to move to using Shewchuck's triangle.c code).  Anyways...

So I was pulling together biblio sources for a paper I am beginning to write, and one of my sources listed another source I wasn't familiar with.  I followed the rabbit a bit and it turns out that there is a method for rendering convex polygons from their ordered boundary points in linear time.  All using the stencil buffer.  No more triangulation needed!  And now the entire trimmed surface generation algorithm will be GPU-based!!!!!  Whoot!

I am in the middle of implementing this approach.  Nothing checked in yet, but it should be up and running by the end of the week.  I will keep you posted and try to upload some screenshots for eye-candy.  It won't look crazy different, but it will be running much faster and be on a nice and clean theoretical basis.


Tuesday, August 19, 2008

Moving Forward


Well I am back from vacation and ready to dig in.  I got a nice chance to relax and contemplate some of the upcoming work I want to accomplish.  I also got a chance to think about what I want to prioritize and what I really need help on.

First, my highest priorities are getting both STL output and all of the remaining geometric intersection routines working.  Neither of these is too terribly difficult, but intersection will just be quite time consuming with lots of little details that need to be taken care of.  STL will be great to have so that the RepRap team can possibly start to try out Wildcat.

Second, I continue to get many requests for more Windows features and a Linux port.  I really really really want to support these platforms.  It is very important to me that Wildcat be able to include as many users as possible, and the entire kernel is being written as very platform agnostic.  But, I simply do not have the time to support these platforms myself.  Sadly, I am a Mac guy, enjoy programming for OSX, and have little desire or need to learn more platforms.  So, what I hope is out there is someone willing to help me pickup the slack for these two platforms.  The work should be mostly UI related as the kernel will continue to be developed for all three platforms.

Lastly, my "real" job is as a Ph.D. student.  For my sanity and my future I need to make sure that this keeps moving forward which will require more of my attention for the next few years.  Wildcat has been my obsession for the past three years and will continue to see significant effort from me, but I need to dial it back a bit.  Don't worry, Wildcat will still be updated almost daily, but the blog and documentation effort will see a bit of a hit.

I hope that everyone understands.  And thank you to all of the people that have voiced their support for this project.  I am happy to go it alone, but knowing that others are out there makes this journey much more fun.


Sunday, August 3, 2008


On Friday I update a bunch of stuff.  Sadly, most of it is not anything to get excited about.  Primarily it was cleaning up a lot of geometry generation paths.  I was starting into the STL export work and saw the sad state of some of the older Nurbs generation code, that I wrote last summer, and decided the time would be well spent improving that since so much relies upon it.

Also, this week got a bit busy at my real job since I had to prepare for an upcoming vacation.  You won't see many updates for several days as I will be hiking in the mountains.  Sorry.  On the plus side, I did make sure that everything compiles and runs OK on Windows.  I might have introduced a bug that will crash you pretty quickly if you try to project a point onto a circle.  There just wasn't time left on Friday evening to track it down and try to fix it.  I will get there, I promise.