When an svg is imported, it will (within the limits of openscad svg
imports) generate a polygon (or number of polygons). Is there any way
that the individual points of the polygon can be accessed. As it is,
apart from rotate, translate, difference and similar, the polygon's
points can not be manipulated.
import is a statement, so it cant return any data. There could be an import
function that returns polygon data.
On Fri, 21 Oct 2022 at 13:00, Raymond West raywest@raywest.com wrote:
When an svg is imported, it will (within the limits of openscad svg
imports) generate a polygon (or number of polygons). Is there any way
that the individual points of the polygon can be accessed. As it is,
apart from rotate, translate, difference and similar, the polygon's
points can not be manipulated.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
import is a statement, so it cant return any data.
I had hoped that as the svg is imported as a more or less a list of
numbers, somewhere within the bowels of openscad that list would exist,
and would be relatively easy to bring it to the surface. I am indeed
wishing for openscad to be able to import lists of numbers, (and save
them, from within the scripts.) I think that feature would save a lot of
future feature requests. At the moment, I, and I expect others, export
the whole thing in whatever format, edit it outside of openscad, and
have to import it again, probably in a separate openscad program. And,
(asking for a friend) it would allow a simple way of getting a random
(timer based) seed for rands whenever required. It would also allow a
klunky way of returning values from modules, too.
On 21/10/2022 13:21, nop head wrote:
There could be an import function that returns polygon data.h
I'm not sure this will be helpful, but it's close enough to the original question that it might be. I use Inkscape v0.92 (as more recent versions don't do this) and the extension Path To OpenSCAD rather than import an SVG file. Since I'm in Inkscape for editing the SVG, it's just one other step to create the .SCAD file.
|
|
|
| | |
|
|
|
| |
Inkscape to OpenSCAD converter v6 by dnewman
Please Note I have not been maintaining this Thing. It is kept up on Thingiverse because of the many extant ref...
|
|
|
The result is a set of points from the original creation. One sets the thickness in the extension, which creates a three dimensional set of points, of course, but one could massage the thickness to provide a bare minimum in order to create the set one requires.
The extension can be a little flaky if there are openings in the image, i.e., the counters of a letter or other character, but the solution is to configure the drawing for a fill rather than a stroke and ensure that all paths are closed.
On Friday, October 21, 2022 at 08:00:43 AM EDT, Raymond West <raywest@raywest.com> wrote:
When an svg is imported, it will (within the limits of openscad svg
imports) generate a polygon (or number of polygons). Is there any way
that the individual points of the polygon can be accessed. As it is,
apart from rotate, translate, difference and similar, the polygon's
points can not be manipulated.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org