[Charlug] Anyone interested in working on a CAD program?

Pierre Abbat phma at phma.optus.nu
Fri Feb 13 23:02:45 CET 2015


On Thursday, February 12, 2015 03:45:13 Shay Walters wrote:
>     You had asked about file formats.  It seems like DXF would be a good
> option to have, but since there is no Euler/clothoid/cornu function, you'd
> have to approximate the Euler spiral with a series of arcs or something
> like that in order to output something in a DXF format.  Unfortunately,
> I'm not familiar enough with DXF to offer much advice on the specifics of
> doing that.

It'll have to import and export DXF and/or DWG, but that should not be its 
native format.

>     Bezitopo looks like a neat concept.  I found Bezitopo.org and the
> github page.
>     If you're looking for a near-term approach to a specific practical
> need, it seems likely that anyone needing Euler spirals in a commercial
> application is already using Autocad.  Perhaps a lisp function would be
> the simplest approach.  I found one for a clothoid spiral at
> http://www.cadstudio.cz/dl/klot.lsp.  If I understand wikipedia correctly
> clothoid and cornu are other names for Euler spirals.  But I don't see an
> indication that this one incorporates any vertical curve factor.  Perhaps
> it might be a starting point to build on.  At least this way you get
> around the problems of a GUI and file formats, but that doesn't advance
> your cause of developing Bezitopo.

The first omitted term in klot.lsp is l^13/599040a^12. This is 1 when l/a is 
2.78, which corresponds, I think, to t=1.97 as an argument to cornu(t) in 
Bezitopo. (I'd have to write some code to be sure whether to divide or 
multiply.) cornu(t) is accurate up to t=6, and cornu(t,curvature,clothance) 
computes arbitrarily far into the curly tails, which are needed for connecting 
two circular arcs with a spiral. Spirals, including spiral arcs not straight 
at either end, are used extensively in parkways, but their use has declined, 
probably because of the lack of software that handles them well.

On Thursday, February 12, 2015 14:13:37 Peter Senft wrote:
> Hi,
> 
> I know a couple of people that could code a UI that you need and I can
> definitely ask around. But I am not sure if you using the right approach
> here.
> 
> Having written (and still writing) a CAD-like tool myself (and a lot of
> other software), you have to start with the data structure. Which
> directly relates to the file format. I've seen now a lot of really bad
> (and therefor slow or memory intensive) file formats in the CAD world
> and I hope you spend quite some time on this one

Do you know someone who can help me with the file format? The most difficult part 
so far would be reading and writing a TIN surface, which consists of three 
classes that have pointers to each other. The point has a pointer to an edge; 
the edge has pointers to the points at its ends, to the next edge in order at 
each end, and to the triangle on each side; and the triangle has pointers to 
the points at its corners.

What's the CAD tool you're writing? Is it stored somewhere that I can try it?

> And if the Euler spiral is the only thing that is missing, then I would
> question your approach here. And I would agree with Shay. Add the
> functionality to an existing CAD package. And don't get me wrong, I am
> all for building software myself so that it does exactly what I want.
> But in this case I would say that it is overkill.

The spiral is not the only thing that is missing. I started writing Bezitopo 
when I noticed that existing programs use flat triangles for generating 
contours, then smooth them with an algorithm that ignores the surface. 
Bezitopo uses B├ęzier triangles to generate contours that are already curved. 
It took me a few years (I wasn't keeping track in Git yet) to get the TIN 
algorithm right.

The other major data structure is the road class (not written yet). The road 
consists of an alignment (no methods yet) and a sequence of cross-sections 
(not written yet). An alignment is a sequence of curves which may be straight 
line segments, circular arcs, or spiral arcs, joined end-to-end, normally with 
each one tangent to the next at the ends (and osculating if at least one is a 
spiral). Normally, one lays out the alignment in the horizontal plane, then 
takes cross-sections and decides where the vertical curves and slopes will go.

Pierre
-- 
sei do'anai mi'a djuno puze'e noroi nalselganse srera



More information about the CharLUG mailing list