To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.devOpen lugnet.cad.dev in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Development / 10173
10172  |  10174
Subject: 
Re: TrueType font converter?
Newsgroups: 
lugnet.cad.dev
Date: 
Sat, 26 Feb 2005 21:49:50 GMT
Viewed: 
1931 times
  
In lugnet.cad.dev, Stefan Gustavson wrote:
In lugnet.cad.dev, Ross Crawford wrote:
Does anyone know of a utility to convert TT font glyphs to LDraw DATs? I would
be interested in looking at writing such a beast, if it hasn't already been
done. I'm looking at this to be able to create LDraw representations of custom
stickers.

Your best bet to get a quick result would probably be to look in
some 3D graphics libraries for OpenGL and find working code to
get a TT glyph out into a mesh model. Exporting a flat mesh model
to LDraw format yourself is not very difficult, but if you happen
to find a utility that writes 3DS files, I have a freshly written
converter from 3DS to LDR format that also handles optional lines
and outline edges correctly, if yo need that:

Thanks Stefan, I have already written the basic code to export the glyph using
the FreeType library.

1. An algorithm to approximate 2-d bezier curves with line segments

Two methods are commonly used: either you just use a fixed amount
of steps and eveluate the curve at N points along each segment, or
you apply some error metric and state that the straight line segments
should nveer deviate more than some distance from the smooth curve.
Most 3D modeling software uses the fixed amount of steps method
for simplicity and polygon count consistency during deformations.
Good 2D rendering software like PostScript uses the adaptive method.
The fixed steps method creates many unnecessary line segments, but
is very simple to implement using only the definition of the Bezier
curve polynomials.

Thanks for that info too - I have now found some refs on the net.

2. An algorithm for filling a closed curve with tris/quads

This is far from trivial, but a number of methods exist and can be found
in good computer graphics textbooks, or occasionally on the Internet:

http://www.cosy.sbg.ac.at/~held/projects/triang/triang.html
http://web.informatik.uni-bonn.de/I/GeomLab/Triangulation/index.html.en

A very good summary of the theory behind triangulation,
and a few pracitical algorithms (no code, but lots of good
information) is on:

http://www.cs.ucsb.edu/~suri/cs235/Triangulation.pdf

Thanks again for all the info! I worked out fairly quickly that this would be
the hardest part of the problem, your references will help enormously!

ROSCO



Message is in Reply To:
  Re: TrueType font converter?
 
(...) Your best bet to get a quick result would probably be to look in some 3D graphics libraries for OpenGL and find working code to get a TT glyph out into a mesh model. Exporting a flat mesh model to LDraw format yourself is not very difficult, (...) (20 years ago, 26-Feb-05, to lugnet.cad.dev)

5 Messages in This Thread:


Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR