What is Picture to People ?

"Picture to People" (P2P) is a huge Computer Graphics project. It was started to create new softwares able to make 2D drawing, 3D rendering, vexel drawing, text effects, photo effects, image filtering and other complex Computer Graphics operations. It has been made from scratch, including its low level Computer Graphics libraries like Maccala. Nowadays, most final features produced for this project are released as free online tools available from its official website. This blog talks about Computer Graphics, mainly concerning Picture to People development.

"Only who makes has true knowledge. Knowledge is control. True power depends on total control. Only who makes from scratch has the real power."

Showing posts with label set operations on simple polygons. Show all posts
Showing posts with label set operations on simple polygons. Show all posts

Saturday, April 12, 2008

Self-intersecting polygons


I'm trying to make my set operations work over polygons with self-intersections. It's has been a hard work, cause I lost a lot of tricks/assumptions used in my old algorithms.

It's possible to make it using pixel combinations among the drawn polygons and after making some kind of bitmap vectorization, but I don't want it. I want to make it just by euclidean geometry.

I'm making my model, my algorithm ... Sometimes it's hard even to make tests. Let's play a little bit more.

PS: image was drawn using Windows GDI.

Wednesday, April 9, 2008

Set operations again



Sometimes is hard to make algorithms to satisfy the very much generic situations. I intend reformulate my data structures and algorithms to allow set operations over polygons, curves, multi-curves and shapes.

Now is time to think about that, cause I'm going to project and code multi-curves.

My algorithms for set operations work well for polygons (the orthodox case). The picture shows in thick blue the difference between two very weird polygons.

Anyway, I still need to solve a very degenerated case for polygons before try to generalize for more complex objects: polygons with self-intersections. Let's work.

PS: this screenshot was drawn using Windows GDI.

Monday, October 22, 2007

Set operations on simple polygons



Finally set operations on polygons are working well.

Now It's time to care about complex polygons (polygons made of several ones, including representing roles).

The end of works about lines and curves are so far ... Tomorrow is another day.

Friday, October 19, 2007

Polygons, Curves, Glyphs and more

For now, I'm very concentrated about set operations on polygons/curves.

I have the known articles about this theme. Some are not enough to degenerated cases, others have closure but are very hard to understand in deep or not so good for a "real" implementation.

I'm making my algorithm. By my math tests, it has closure if you know how to deal with the "bad" cases. Unfortunately, the implementation is getting infinite loop for some degenerated situations. How the coding has a lot of pointer indirections and the internal tasks are not so obvious, the debugging is a little bit hard. I suspect this behavior is coming from floating point imprecision. I should be very bad ... I hope I'm wrong.

Most of set operations in polygons can be "simulated" by correct use of layers. So, why this work? Cause I'm making my own code for font rendering also. I want to get a unique library for dealing with polygons, curves and font glyphs. A glyph can be very complex and usually you can understand it how a list of curves interacting by set operations. That's the reason.

Maybe I will not write here again until this part is done.