[Haskell-cafe] ANN: mecha-0.0.5

Andrew Coppin andrewcoppin at btinternet.com
Sun Jun 5 23:28:21 CEST 2011

>> As I understand it, this is a Very Hard Problem. This is (one of the
>> reasons) why there are so few converters from POV-Ray to mesh-based formats;
>> it's highly non-trivial to tesselate CSG.
> POV-Ray is pretty fast.  I had contemplated just rendering a bunch of
> POV-Ray images to emulate a realtime 3D view.  Images could be
> buffered up based on the current camera position.

That's an... interesting way of doing it. It's probably easier to build 
a simple renderer internal to your program, but I suppose calling 
POV-Ray gives you lots of functionality without having it to implement 
it yourself.

> Another goal of the project is to generate 2D prints from 3D models.
> Any idea how hard is this going to be?  Basically it needs to identify
> features (holes, edges, etc), then project these features to an
> orthographic plane, alone with associated dimensions.

That ought to be reasonably easy.

If you think of each shape's surface as being the set of points 
satisfying an equation, then the edges of the intersection of those 
shapes would be the set of points satisfying a set of simultanious 
equations. (Quite possibly non-linear ones, depending on which kinds of 
shapes you allow.)

The only really tricky part is if you want to represent all of these 
shapes as "simple" curves such as lines, ellipses and paraboliods. See, 
for example,


"The curves of intersection of two cylinders of radii a and b, shown 
above, are given by the parametric equations

   x(t) = b cos t
   y(t) = b sin t
   z(t) = +/- Sqrt(a^2 - b^2 sin^2 t)

(Gray 1997, p. 204)."

A curve like that is not the sort of thing you can easily represent in 
SVG, unless you turn it into a general spline.

More information about the Haskell-Cafe mailing list