[Haskell-cafe] ANN: mecha-0.0.5

Vo Minh Thu noteed at gmail.com
Sun Jun 5 21:20:35 CEST 2011


2011/6/5 Tom Hawkins <tomahawkins at gmail.com>:
> On Sun, Jun 5, 2011 at 10:41 AM, Andrew Coppin
> <andrewcoppin at btinternet.com> wrote:
>> On 04/06/2011 08:25 PM, Tom Hawkins wrote:
>>
>>> What is the easiest way to generate polygon meshes from constructive
>>> solid geometry?  Marching cubes [4] seems pretty involved.
>>
>> 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.
>
> 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.

Once the conversion to triangles (or polygons) is handled, you should
be able to import the model into some rendering engine. Orthographic
projection isn't more difficult to achieve than perspective
projection. You would have to chose the renderer so it comes with the
kind of effect you want. (The feature detection you mean such that
they are for instance rendered as strokes is a rendering effect, so no
need I believe to first detect them then render them. I also believe
there are such rendering that are done as a post-effect, on the 2d
data (possibly with dept or normal information available)).

Don't povray provides such a rendering mode?

Otherwise, given a mesh model, idetifying the edges (with no respect
to the screen) is quite easy in the principle: make any edge that
separates two faces whose normals make an angle above some thresold a
hard edge. To take the screen into account, you would have probably to
compare the surface normal at the edge and the camera direction.

One thing that would be neat for you, but I have no idea if it exists,
would be to turn directly the CSG models to 2d vector graphics.

Cheers,
Thu



More information about the Haskell-Cafe mailing list