|
|
Coverer, LDraw sheet
generator
Version Française ici.

Coverer utility
creates a sheet of triangle and quads between two sets of lines.
Each set is provided to the utility as separate LDraw files.
A third file containing the surface (and its conditional lines)
is created.
It is a simple console application, source code
is provided below to anyone willing to integrate it in a more
palatable interface.
Download
Coverer
package, including program for Windows and
Linux, documentation, source files (Visual C++ 6.0), sample
files.
Note: Linux version courtesy of Mufti.
Note: Macintosh version (universal binary) courtesy of Jim
DeVona
History
Usage
Prepare the input LDraw files. Coverer uses only lines
of input files (line type 2). Other LDraw line types are
ignored. If you want to compute surface between edge primitives,
they must be inlined down to lines. LDDesignPad
does this very conveniently.
Launch a command prompt
Type the command line: coverer [-r]
[-l <length>] LdrawLineFile1 LdrawLineFile2 LdrawSurfaceFileOut.
Coverer will create LdrawSurfaceFileOut,
containing the surface. Note that if file LdrawSurfaceFileOut
exists it will be overwritten without warning. -r and -l
are optional parameters controlling the behavior of Coverer. These options will
be detailed below.
Coverer
output file with 6 digits after decimal point, this precision
is excessive for most usages and values should be rounded.
Here again, LDDesignPad
does that very well.
Here is a screen shot of a sample run:

How Coverer
works
- Both input files are read and parsed. All line apexes
are stored in arrays (limited to 2000 lines, should be more
than enough!).
- These arrays are sorted, allowing to use LDraw files
with lines in non-consecutive order (e.g. files coming from
Isecalc). If more than one line
path is found, a warning is issued as this probably denotes
a wrong input files, and will likely produce a buggy result.
- If -r option is present,
order of the second file is reversed. Use this option when
the resulting surface join lines from opposite ends (often
looking like a jagged butterfly).
- if -l xxx option is
used, lines longer than xxx are split in smaller segments.
You may get smoother surfaces using this option.
- Triangles are created between both paths, progressing
proportionally along them. When degenerated triangles (reduced
to a line) happen (for example when paths have common points),
they are suppressed.
- A scan is done in the generated triangle. If two consecutive
triangles are in the same plane and form a convex quad,
they are condensed. If they are not in the same plane, a
conditional line is added.
- Output file is created.
Examples

|
A nice looking surface between 2 arcs. Files:
arc1.dat, arc2.dat --> arc-out.dat
Command line: Coverer arc1.dat arc2.dat arc-out.dat |

|
Here the order and direction of the lines of
the second file was inverted. Files: arc1.dat,
arc2-r.dat --> arc-r-out.dat, arc-rok-out.dat
Command line: Coverer arc1.dat arc2-r.dat arc-r-out.dat
created that weird shape. The -r parameter corrects
the order and returns the same surface as the first
example.
Corrected command line: Coverer -r arc1.dat arc2-r.dat arc-rok-out.dat |

|
Fitting a square to a circle. Files: sqc1.dat,
sqc2.dat --> sqc-out.dat
Command line: Coverer sqc1.dat sqc2.dat sqc-out.dat |

|
Note that the relative orientation of the paths
matters, even if they are symmetrical. Here the
circle was turned by 45°, the result is twisted.
Files: sqc1.dat, sqc2-45.dat --> sqc-45-out.dat
Command line: Coverer sqc1.dat sqc2-45.dat sqc-45-out.dat |

|
This example shows how to create twisted surfaces
such as the one in 43721
sloped wedge. Two single lines form the edges.
A simple application of coverer provides a chunky
result... Files: wedge1.dat; wedge2.dat -->
wedge-out.dat
Command line: Coverer wedge1.dat wedge2.dat wedge-out.dat |

|
...the -l parameter improves the result:
Files: wedge1.dat; wedge2.dat --> wedge-l-out.dat
Command line: Coverer -l 10 wedge1.dat wedge2.dat wedge-l-out.dat |

|
Adapter rings are probably the most useful application
of Coverer. They allow to join regular 16- or 48-primitives
to section of parts with different period. I used
this extensively in gears, wheels and tires, such
as 30391 tire that has a 16-primitives based core
but 40 bumps on its rim. Files: cir21.dat, cir16.dat
--> adapt1621.dat
Command line: Coverer cir16.dat cir21.dat adapt1621.dat |

|