[OpenSCAD] DXF for cut and engrave

Torsten Paul Torsten.Paul at gmx.de
Thu Oct 24 10:37:03 EDT 2019


On 24.10.19 15:22, Troberg wrote:
> OpenSCAD does 2D fairly good, so usually it works out,
> but there are two missing primitives which would help
> a lot: line and point.

That question does come up now and again, but nobody
really took the plunge to design something that fits
into OpenSCAD.

It's not as simple as just adding line() as that
would break some of the current assumptions. However
I believe having a state with unclosed polygons is
not a problem in general as for example this happens
inside of text() too.

Just to highlight what I mean, here's some dummy code
that could model something resembling the letter L

p = [
  [36,-5],[12,-5],[12,-48)],[6,-48],[6, 0],[36, 0]
];

polygon() {
  point(p[0]);
  for (a = [1:len(p)])
    line(p[a - 1], p[a]);
}

Now that looks not very impressive as this would
work with just polygon(p) too, but text() also uses
quadratic and cubic splines. At that point it gets
much more interesting I think.

In the example above, the polygon() would also mean
that at this point the polygon is closed and could
be extruded to 3D. Without that guaranty it would be
still exportable to DXF or SVG.

ciao,
  Torsten.



More information about the Discuss mailing list