On Jun 24, 2013, at 02:31 PM, Isaac Kamga <u2isaac@...> wrote:
I have been looking at the metaball primitive and the Blobby method
which was used to implement it. Since 2 spheres to implement the
metaball. I was thinking of using 2 spheres and an elliptical parabola
(epa) to implement the heart. The spheres will serve as the lobes of
the heart and the epa will be the bottom section.
Probably not the example you should be looking at given your goal. I suggest looking at the torus or superell primitives. Look at src/librt/primitives/tor/tor.c in rt_tor_shot() and notice how it builds up a polynomial and ends up calling rt_poly_roots() to evaluate the roots of that 4th order equation.
You need almost that same setup but with a completely different equation. It's a 6th order equation if you use http://mathworld.wolfram.com/HeartSurface.html so start with that. It's unclear whether our root solver can handle a 6th order, but then that's part what made your proposal interesting and useful. ;)
If it turns out our solver isn't stable enough, we can talk about changing the goal to either make it stable or create a cardiod shape instead, which it should be able to handle just fine: http://mathworld.wolfram.com/Cardioid.html
To get started, stub in the basic requisite hooks empty first, add it to the headers (db5.h, rtgeom.h, magic.h, raytrace.h), add a new table.c entry, and implement 'in' command support (src/libged/typein.c) so you can create an object of that type. From there, you'll be able to start implementing and testing specific callbacks for serialization (import/export), textual description (describe), ray tracing (prep+shot), plot, tessellation, curvature, and uv-mapping. I suggest tackling them in that order too.
Get latest updates about Open Source Projects, Conferences and News.