Monday, July 14, 2008

Argh, more topology

I am out the other side of a busy work week last week.  Sorry for not making many updates or posts; this week should be better.  Despite being out last week I continued to receive a lot of comments regarding RepRap and STL files.  I want to talk about that for a bit and then a quick update on what I am working on this week.

I have now been contacted by several people that are either directly or loosely affiliated with the RepRap project.  This project looks great and I am very very supportive of their objectives and approach.  They have been using Art of Illusion as the "CAD" package, but it really doesn't seem to be meeting many of their needs.  I believe that in due time Wildcat will be an ideal partner.  I say in due time because Wildcat is still quite limited in its modeling abilities, boolean operations being the biggest omission currently.

After a bit of education, I now realize that exporting a Wildcat model to an STL file will be quite easy.  I need to write one routine to fully tessellate trimmed surfaces and then write a routine to output an entire part into an STL formatted file.

Full tessellation of a trimmed surface can be difficult, but I think that I have an easy and efficient way to do it.  Wildcat can already generate tessellated NURBS surfaces, trimming textures, and bounding curves.  This is really all we need.  Here are the steps as I envision this algorithm:
  1. Generate tessellation of underlying NURBS surface
  2. Generate trimming texture
  3. Generate bounding curve points and place into triangle.c array and mark as boundary (if you are not familiar with triangle.c please see this - very fast Delaunay triangulator)
  4. Test every underlying surface point against the trim texture (basically do a quick reverse lookup to see if for a given [u,v] it is in the filled portion of the trim texture - if it is in the texture then add it to the "output" list and mark as interior
  5. Now we have a list of all tessellation points (either marked as boundary or interior) - pass this list to triangle.c and let it output the best triangulation.  And we are done!
Not too bad eh?  Should be very little code to write and should be at least moderately efficient.  There could be some complications in making sure that all of the surface-surface boundaries align nicely, but I think that I have ways of dealing with this.  This approach will also let Wildcat do nice LOD scaling on all types of surfaces.  Hopefully I can get this working in beta form in the later portion of this week.  Once this is done then all I have to do it write everything out to an STL file.  Then test, test, test.

So, what am I working on now?  As I mentioned last week, I really want to get topology working for Part Pad operations.  I continue to be amazed at how complex this is for such a conceptually simple operation (I am really not looking forward to topology for swept solids!).  I spent my downtime last week working on the algorithm and I am implementing it this week.  After a day of working on it, I am about half way done, but I have left the really tough part for last.  My brain is numb.  Working on STL output will serve as a good distraction.  Once this is done I can finally start working on some of the boolean routines.

Talk to you all tomorrow.  Cheers,
   Graham


2 comments:

Anonymous said...

Im glad to hear that you are working hard on the minimum reprap requirements: stl export, boolean operations.

As soon as the boolean operation add and substract is implemented, I try to use your software.

Best regards,
Khirly

Lampbus said...

I would like to give wildcat a run, but i am on XP/Vista and I dont have visual studio. THe free studio express wont let me use the header fles from the windows SDK.

Any ideas ?