FH
Father Horton
Fri, Oct 21, 2022 3:43 PM
My understanding is that OpenSCAD as currently constituted does not expose
the internals of objects, native or imported.
On Fri, Oct 21, 2022 at 10:22 AM fred via Discuss <
discuss@lists.openscad.org> wrote:
---------- Forwarded message ----------
From: fred fred_dot_u@yahoo.com
To: OpenSCAD general discussion Mailing-list discuss@lists.openscad.org
Cc:
Bcc:
Date: Fri, 21 Oct 2022 15:22:02 +0000 (UTC)
Subject: [OpenSCAD] Re: svg conversion in openscad
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
https://www.thingiverse.com/thing:25036 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...
https://www.thingiverse.com/thing:25036
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
---------- Forwarded message ----------
From: fred via Discuss discuss@lists.openscad.org
To: OpenSCAD general discussion Mailing-list discuss@lists.openscad.org
Cc: fred fred_dot_u@yahoo.com
Bcc:
Date: Fri, 21 Oct 2022 15:22:02 +0000 (UTC)
Subject: [OpenSCAD] Re: svg conversion in openscad
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
My understanding is that OpenSCAD as currently constituted does not expose
the internals of objects, native or imported.
On Fri, Oct 21, 2022 at 10:22 AM fred via Discuss <
discuss@lists.openscad.org> wrote:
>
>
>
> ---------- Forwarded message ----------
> From: fred <fred_dot_u@yahoo.com>
> To: OpenSCAD general discussion Mailing-list <discuss@lists.openscad.org>
> Cc:
> Bcc:
> Date: Fri, 21 Oct 2022 15:22:02 +0000 (UTC)
> Subject: [OpenSCAD] Re: svg conversion in openscad
> 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
> <https://www.thingiverse.com/thing:25036> 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...
> <https://www.thingiverse.com/thing:25036>
>
>
>
> 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
>
>
>
> ---------- Forwarded message ----------
> From: fred via Discuss <discuss@lists.openscad.org>
> To: OpenSCAD general discussion Mailing-list <discuss@lists.openscad.org>
> Cc: fred <fred_dot_u@yahoo.com>
> Bcc:
> Date: Fri, 21 Oct 2022 15:22:02 +0000 (UTC)
> Subject: [OpenSCAD] Re: svg conversion in openscad
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
>
RW
Raymond West
Fri, Oct 21, 2022 4:46 PM
Thanks for the suggestions, I've temporarily solved half the problem,
simply write a file with my list of variables, in a text editor, or
generated by some other program, and include. So, instead of my
generating and formatting a text file, and copying/paste it in as a list
of points, I simply generate a valid scad file. Wood, trees, not seeing
comes to mind.
That file can be included wherever I want in the scad file, now to try
to find a way of saving data wherever I want e.g from within a module.
Virtually any programming language, maybe powershell, can create a line
like
seed=22102017152530;
based on the time, and save it as an scad file. It'll need to refresh
every second or so, however, depending on needs.
On 21/10/2022 16:43, Father Horton wrote:
My understanding is that OpenSCAD as currently constituted does not
expose the internals of objects, native or imported.
On Fri, Oct 21, 2022 at 10:22 AM fred via Discuss
discuss@lists.openscad.org wrote:
---------- Forwarded message ----------
From: fred <fred_dot_u@yahoo.com>
To: OpenSCAD general discussion Mailing-list
<discuss@lists.openscad.org>
Cc:
Bcc:
Date: Fri, 21 Oct 2022 15:22:02 +0000 (UTC)
Subject: [OpenSCAD] Re: svg conversion in openscad
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
<https://www.thingiverse.com/thing:25036> 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...
<https://www.thingiverse.com/thing:25036>
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
---------- Forwarded message ----------
From: fred via Discuss <discuss@lists.openscad.org>
To: OpenSCAD general discussion Mailing-list
<discuss@lists.openscad.org>
Cc: fred <fred_dot_u@yahoo.com>
Bcc:
Date: Fri, 21 Oct 2022 15:22:02 +0000 (UTC)
Subject: [OpenSCAD] Re: svg conversion in openscad
_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
OpenSCAD mailing list
To unsubscribe send an email todiscuss-leave@lists.openscad.org
Thanks for the suggestions, I've temporarily solved half the problem,
simply write a file with my list of variables, in a text editor, or
generated by some other program, and include. So, instead of my
generating and formatting a text file, and copying/paste it in as a list
of points, I simply generate a valid scad file. Wood, trees, not seeing
comes to mind.
That file can be included wherever I want in the scad file, now to try
to find a way of saving data wherever I want e.g from within a module.
Virtually any programming language, maybe powershell, can create a line
like
seed=22102017152530;
based on the time, and save it as an scad file. It'll need to refresh
every second or so, however, depending on needs.
On 21/10/2022 16:43, Father Horton wrote:
> My understanding is that OpenSCAD as currently constituted does not
> expose the internals of objects, native or imported.
>
> On Fri, Oct 21, 2022 at 10:22 AM fred via Discuss
> <discuss@lists.openscad.org> wrote:
>
>
>
>
> ---------- Forwarded message ----------
> From: fred <fred_dot_u@yahoo.com>
> To: OpenSCAD general discussion Mailing-list
> <discuss@lists.openscad.org>
> Cc:
> Bcc:
> Date: Fri, 21 Oct 2022 15:22:02 +0000 (UTC)
> Subject: [OpenSCAD] Re: svg conversion in openscad
> 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
> <https://www.thingiverse.com/thing:25036> 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...
>
> <https://www.thingiverse.com/thing:25036>
>
>
>
> 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
>
>
>
> ---------- Forwarded message ----------
> From: fred via Discuss <discuss@lists.openscad.org>
> To: OpenSCAD general discussion Mailing-list
> <discuss@lists.openscad.org>
> Cc: fred <fred_dot_u@yahoo.com>
> Bcc:
> Date: Fri, 21 Oct 2022 15:22:02 +0000 (UTC)
> Subject: [OpenSCAD] Re: svg conversion in openscad
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
>
>
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email todiscuss-leave@lists.openscad.org
RW
Raymond West
Fri, Oct 21, 2022 8:46 PM
include<R:\Users\Ray\source\repos\timerapp\seeder>
echo (rands(0,10,2,9));
echo (rands(10,20,2));
echo (rands(20,30,2,ft));
The last random number pair can always be reseeded with a different
different seed (currently the ft seed is incremented every two seconds)
If it runs continuously, it;ll be about 15 years before it repeats.
-------- Forwarded Message --------
Subject: [OpenSCAD] Re: svg conversion in openscad
Date: Fri, 21 Oct 2022 17:46:41 +0100
From: Raymond West raywest@raywest.com
Reply-To: OpenSCAD general discussion Mailing-list
discuss@lists.openscad.org
To: discuss@lists.openscad.org
Thanks for the suggestions, I've temporarily solved half the problem,
simply write a file with my list of variables, in a text editor, or
generated by some other program, and include. So, instead of my
generating and formatting a text file, and copying/paste it in as a list
of points, I simply generate a valid scad file. Wood, trees, not seeing
comes to mind.
That file can be included wherever I want in the scad file, now to try
to find a way of saving data wherever I want e.g from within a module.
Virtually any programming language, maybe powershell, can create a line
like
seed=22102017152530;
based on the time, and save it as an scad file. It'll need to refresh
every second or so, however, depending on needs.
On 21/10/2022 16:43, Father Horton wrote:
My understanding is that OpenSCAD as currently constituted does not
expose the internals of objects, native or imported.
On Fri, Oct 21, 2022 at 10:22 AM fred via Discuss
discuss@lists.openscad.org wrote:
---------- Forwarded message ----------
From: fred <fred_dot_u@yahoo.com>
To: OpenSCAD general discussion Mailing-list
<discuss@lists.openscad.org>
Cc:
Bcc:
Date: Fri, 21 Oct 2022 15:22:02 +0000 (UTC)
Subject: [OpenSCAD] Re: svg conversion in openscad
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
<https://www.thingiverse.com/thing:25036> 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...
<https://www.thingiverse.com/thing:25036>
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
---------- Forwarded message ----------
From: fred via Discuss <discuss@lists.openscad.org>
To: OpenSCAD general discussion Mailing-list
<discuss@lists.openscad.org>
Cc: fred <fred_dot_u@yahoo.com>
Bcc:
Date: Fri, 21 Oct 2022 15:22:02 +0000 (UTC)
Subject: [OpenSCAD] Re: svg conversion in openscad
_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
OpenSCAD mailing list
To unsubscribe send an email todiscuss-leave@lists.openscad.org
include<R:\Users\Ray\source\repos\timerapp\seeder>
echo (rands(0,10,2,9));
echo (rands(10,20,2));
echo (rands(20,30,2,ft));
The last random number pair can always be reseeded with a different
different seed (currently the ft seed is incremented every two seconds)
If it runs continuously, it;ll be about 15 years before it repeats.
-------- Forwarded Message --------
Subject: [OpenSCAD] Re: svg conversion in openscad
Date: Fri, 21 Oct 2022 17:46:41 +0100
From: Raymond West <raywest@raywest.com>
Reply-To: OpenSCAD general discussion Mailing-list
<discuss@lists.openscad.org>
To: discuss@lists.openscad.org
Thanks for the suggestions, I've temporarily solved half the problem,
simply write a file with my list of variables, in a text editor, or
generated by some other program, and include. So, instead of my
generating and formatting a text file, and copying/paste it in as a list
of points, I simply generate a valid scad file. Wood, trees, not seeing
comes to mind.
That file can be included wherever I want in the scad file, now to try
to find a way of saving data wherever I want e.g from within a module.
Virtually any programming language, maybe powershell, can create a line
like
seed=22102017152530;
based on the time, and save it as an scad file. It'll need to refresh
every second or so, however, depending on needs.
On 21/10/2022 16:43, Father Horton wrote:
> My understanding is that OpenSCAD as currently constituted does not
> expose the internals of objects, native or imported.
>
> On Fri, Oct 21, 2022 at 10:22 AM fred via Discuss
> <discuss@lists.openscad.org> wrote:
>
>
>
>
> ---------- Forwarded message ----------
> From: fred <fred_dot_u@yahoo.com>
> To: OpenSCAD general discussion Mailing-list
> <discuss@lists.openscad.org>
> Cc:
> Bcc:
> Date: Fri, 21 Oct 2022 15:22:02 +0000 (UTC)
> Subject: [OpenSCAD] Re: svg conversion in openscad
> 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
> <https://www.thingiverse.com/thing:25036> 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...
>
> <https://www.thingiverse.com/thing:25036>
>
>
>
> 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
>
>
>
> ---------- Forwarded message ----------
> From: fred via Discuss <discuss@lists.openscad.org>
> To: OpenSCAD general discussion Mailing-list
> <discuss@lists.openscad.org>
> Cc: fred <fred_dot_u@yahoo.com>
> Bcc:
> Date: Fri, 21 Oct 2022 15:22:02 +0000 (UTC)
> Subject: [OpenSCAD] Re: svg conversion in openscad
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
>
>
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email todiscuss-leave@lists.openscad.org
AM
Adrian Mariano
Fri, Oct 21, 2022 9:08 PM
I'm not sure I understand your concerns about the random numbers. With a
well-designed psueodrandom number generator, you're going to get
satisfactory outputs with a single seed. If you are constantly reseeding
("increment the seed every two seconds") the most likely result of this is
that you will make the results less random. Assuming the initializing is
good, you normally only need to worry about the seed if you need
repeatability, that is, if you specifically want to generate the same
sequence again.
There is no way to programmatically write data from OpenSCAD. This is seen
as a security risk so I'm guessing it is unlikely to happen. At risk of
repeating previous posts, I think there are libraries that will change SVG
to point lists, and there are OpenSCAD libraries that will parse SVG into a
point list, so you embed the SVG text content into your scad file.
On Fri, Oct 21, 2022 at 4:48 PM Raymond West raywest@raywest.com wrote:
include<R:\Users\Ray\source\repos\timerapp\seeder>
echo (rands(0,10,2,9));
echo (rands(10,20,2));
echo (rands(20,30,2,ft));
The last random number pair can always be reseeded with a different
different seed (currently the ft seed is incremented every two seconds) If
it runs continuously, it;ll be about 15 years before it repeats.
-------- Forwarded Message --------
Subject: [OpenSCAD] Re: svg conversion in openscad
Date: Fri, 21 Oct 2022 17:46:41 +0100
From: Raymond West raywest@raywest.com raywest@raywest.com
Reply-To: OpenSCAD general discussion Mailing-list
discuss@lists.openscad.org discuss@lists.openscad.org
To: discuss@lists.openscad.org
Thanks for the suggestions, I've temporarily solved half the problem,
simply write a file with my list of variables, in a text editor, or
generated by some other program, and include. So, instead of my generating
and formatting a text file, and copying/paste it in as a list of points, I
simply generate a valid scad file. Wood, trees, not seeing comes to mind.
That file can be included wherever I want in the scad file, now to try to
find a way of saving data wherever I want e.g from within a module.
Virtually any programming language, maybe powershell, can create a line
like
seed=22102017152530;
based on the time, and save it as an scad file. It'll need to refresh
every second or so, however, depending on needs.
On 21/10/2022 16:43, Father Horton wrote:
My understanding is that OpenSCAD as currently constituted does not expose
the internals of objects, native or imported.
On Fri, Oct 21, 2022 at 10:22 AM fred via Discuss <
discuss@lists.openscad.org> wrote:
---------- Forwarded message ----------
From: fred fred_dot_u@yahoo.com
To: OpenSCAD general discussion Mailing-list discuss@lists.openscad.org
Cc:
Bcc:
Date: Fri, 21 Oct 2022 15:22:02 +0000 (UTC)
Subject: [OpenSCAD] Re: svg conversion in openscad
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
https://www.thingiverse.com/thing:25036 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...
https://www.thingiverse.com/thing:25036
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
---------- Forwarded message ----------
From: fred via Discuss discuss@lists.openscad.org
To: OpenSCAD general discussion Mailing-list discuss@lists.openscad.org
Cc: fred fred_dot_u@yahoo.com
Bcc:
Date: Fri, 21 Oct 2022 15:22:02 +0000 (UTC)
Subject: [OpenSCAD] Re: svg conversion in openscad
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
I'm not sure I understand your concerns about the random numbers. With a
well-designed psueodrandom number generator, you're going to get
satisfactory outputs with a single seed. If you are constantly reseeding
("increment the seed every two seconds") the most likely result of this is
that you will make the results less random. Assuming the initializing is
good, you normally only need to worry about the seed if you need
repeatability, that is, if you specifically want to generate the same
sequence again.
There is no way to programmatically write data from OpenSCAD. This is seen
as a security risk so I'm guessing it is unlikely to happen. At risk of
repeating previous posts, I think there are libraries that will change SVG
to point lists, and there are OpenSCAD libraries that will parse SVG into a
point list, so you embed the SVG text content into your scad file.
On Fri, Oct 21, 2022 at 4:48 PM Raymond West <raywest@raywest.com> wrote:
> include<R:\Users\Ray\source\repos\timerapp\seeder>
> echo (rands(0,10,2,9));
> echo (rands(10,20,2));
> echo (rands(20,30,2,ft));
>
> The last random number pair can always be reseeded with a different
> different seed (currently the ft seed is incremented every two seconds) If
> it runs continuously, it;ll be about 15 years before it repeats.
>
>
> -------- Forwarded Message --------
> Subject: [OpenSCAD] Re: svg conversion in openscad
> Date: Fri, 21 Oct 2022 17:46:41 +0100
> From: Raymond West <raywest@raywest.com> <raywest@raywest.com>
> Reply-To: OpenSCAD general discussion Mailing-list
> <discuss@lists.openscad.org> <discuss@lists.openscad.org>
> To: discuss@lists.openscad.org
>
> Thanks for the suggestions, I've temporarily solved half the problem,
> simply write a file with my list of variables, in a text editor, or
> generated by some other program, and include. So, instead of my generating
> and formatting a text file, and copying/paste it in as a list of points, I
> simply generate a valid scad file. Wood, trees, not seeing comes to mind.
>
> That file can be included wherever I want in the scad file, now to try to
> find a way of saving data wherever I want e.g from within a module.
>
> Virtually any programming language, maybe powershell, can create a line
> like
>
> seed=22102017152530;
>
> based on the time, and save it as an scad file. It'll need to refresh
> every second or so, however, depending on needs.
> On 21/10/2022 16:43, Father Horton wrote:
>
> My understanding is that OpenSCAD as currently constituted does not expose
> the internals of objects, native or imported.
>
> On Fri, Oct 21, 2022 at 10:22 AM fred via Discuss <
> discuss@lists.openscad.org> wrote:
>
>>
>>
>>
>> ---------- Forwarded message ----------
>> From: fred <fred_dot_u@yahoo.com>
>> To: OpenSCAD general discussion Mailing-list <discuss@lists.openscad.org>
>> Cc:
>> Bcc:
>> Date: Fri, 21 Oct 2022 15:22:02 +0000 (UTC)
>> Subject: [OpenSCAD] Re: svg conversion in openscad
>> 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
>> <https://www.thingiverse.com/thing:25036> 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...
>> <https://www.thingiverse.com/thing:25036>
>>
>>
>>
>> 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
>>
>>
>>
>> ---------- Forwarded message ----------
>> From: fred via Discuss <discuss@lists.openscad.org>
>> To: OpenSCAD general discussion Mailing-list <discuss@lists.openscad.org>
>> Cc: fred <fred_dot_u@yahoo.com>
>> Bcc:
>> Date: Fri, 21 Oct 2022 15:22:02 +0000 (UTC)
>> Subject: [OpenSCAD] Re: svg conversion in openscad
>> _______________________________________________
>> OpenSCAD mailing list
>> To unsubscribe send an email to discuss-leave@lists.openscad.org
>>
>
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
>
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
>
JB
Jordan Brown
Fri, Oct 21, 2022 11:11 PM
On 10/21/2022 2:08 PM, Adrian Mariano wrote:
I'm not sure I understand your concerns about the random numbers.
Mostly I agree with you, but OpenSCAD does behave perversely if you try
to mix non-repeatable random numbers (based on the internal timer+pid
entropy) with repeatable ones based on your custom seed.
The problem is that the PRNG isn't reseeded every run, and so your
second and successive runs all get the same sequence, because they are
all seeded from your (presumably fixed) last custom seed.
Try running this program repeatedly:
|echo(rands(0,1,1)); echo(rands(0,1,1,1));|
You would expect the first number to be "random" and the second number
to be fixed, but what actually happens is that they are both fixed
because on the second and subsequent runs, the first rands() call
generates the second value from the seed=1 sequence.
See issue #4391 https://github.com/openscad/openscad/issues/4391.
Generally, if you want to mix non-repeatable random numbers with
custom-seeded random numbers, you can do it by saving away one of the
non-repeatable numbers and setting it as the seed after you generate
your sequence of custom-seeded numbers.
function fixedRands(a, b, n, seed) =
let (old = rands(0,1,1)[0])
let (result = rands(a,b,n,seed))
let (junk = rands(0,0,0,old))
result;
echo(rands(0,1,1));
echo(fixedRands(0,1,1,1));
echo(rands(0,1,1));
will echo three numbers at a time, with the first and third varying from
run to run and the second remaining constant. Of course, if you want to
generate multiple sets of your repeatable custom-seeded numbers, you
have to use different seeds.
This isn't a general save-restore mechanism, because the value returned
from rands() isn't the current seed, but if you were already on a
non-repeatable sequence, this leaves you on a non-repeatable sequence.
Caution: this is one of the few cases where you can tell that OpenSCAD
doesn't evaluate in the same order that most languages do.
save = rands(0,1,0);
junk1 = rands(0,1,1,1);
echo(rands(0,1,1));
junk2 = rands(0,0,1,save);
You might think that the number printed would be repeatable - it's based
off of the seed=1, isn't it? Nope. Assignments are all evaluated
before module calls, so all three assignments (save, junk1, junk2) are
evaluated before the echo() is evaluated.
On 10/21/2022 2:08 PM, Adrian Mariano wrote:
> I'm not sure I understand your concerns about the random numbers.
Mostly I agree with you, but OpenSCAD does behave perversely if you try
to mix non-repeatable random numbers (based on the internal timer+pid
entropy) with repeatable ones based on your custom seed.
The problem is that the PRNG isn't reseeded every run, and so your
second and successive runs all get the same sequence, because they are
all seeded from your (presumably fixed) last custom seed.
Try running this program repeatedly:
|echo(rands(0,1,1)); echo(rands(0,1,1,1));|
You would expect the first number to be "random" and the second number
to be fixed, but what actually happens is that they are both fixed
because on the second and subsequent runs, the first rands() call
generates the second value from the seed=1 sequence.
See issue #4391 <https://github.com/openscad/openscad/issues/4391>.
Generally, if you want to mix non-repeatable random numbers with
custom-seeded random numbers, you can do it by saving away one of the
non-repeatable numbers and setting it as the seed after you generate
your sequence of custom-seeded numbers.
function fixedRands(a, b, n, seed) =
let (old = rands(0,1,1)[0])
let (result = rands(a,b,n,seed))
let (junk = rands(0,0,0,old))
result;
echo(rands(0,1,1));
echo(fixedRands(0,1,1,1));
echo(rands(0,1,1));
will echo three numbers at a time, with the first and third varying from
run to run and the second remaining constant. Of course, if you want to
generate multiple sets of your repeatable custom-seeded numbers, you
have to use different seeds.
This isn't a general save-restore mechanism, because the value returned
from rands() isn't the current seed, but if you were already on a
non-repeatable sequence, this leaves you on a non-repeatable sequence.
---
Caution: this is one of the few cases where you can tell that OpenSCAD
doesn't evaluate in the same order that most languages do.
save = rands(0,1,0);
junk1 = rands(0,1,1,1);
echo(rands(0,1,1));
junk2 = rands(0,0,1,save);
You might think that the number printed would be repeatable - it's based
off of the seed=1, isn't it? Nope. Assignments are all evaluated
before module calls, so all three assignments (save, junk1, junk2) are
evaluated before the echo() is evaluated.
RW
Raymond West
Fri, Oct 21, 2022 11:18 PM
Hi Adrian,
The random number concern was the fact that other languages that I have
used in the past could use a system timer for reseeding. I can do that
now, if i need to, within openscad. The two seconds is the approx time I
set for sleep in the external program to increment the seeder code. I
will probably never need it, but it was an easy example to set up.
In the past I had written external code to import, manipulate or
generate svg code, and save it such that openscad could import the
changed svg. Now I can import the svg as a list of points, or whatever,
more or less anywhere in the openscad script.
I'm not sure what security risk is created by exporting a list of
numbers from within openscad. A risk to who, or what? As it is, openscad
exports/imports it's own version of svgs and dxfs, which leads to errors
in other programs, so I can't see a list of numbers generated by the
user's scripting as being any more risky.
Best wishes,
Ray
On 21/10/2022 22:08, Adrian Mariano wrote:
I'm not sure I understand your concerns about the random numbers.
With a well-designed psueodrandom number generator, you're going to
get satisfactory outputs with a single seed. If you are constantly
reseeding ("increment the seed every two seconds") the most likely
result of this is that you will make the results less random.
Assuming the initializing is good, you normally only need to worry
about the seed if you need repeatability, that is, if you specifically
want to generate the same sequence again.
There is no way to programmatically write data from OpenSCAD. This is
seen as a security risk so I'm guessing it is unlikely to happen. At
risk of repeating previous posts, I think there are libraries that
will change SVG to point lists, and there are OpenSCAD libraries that
will parse SVG into a point list, so you embed the SVG text content
into your scad file.
On Fri, Oct 21, 2022 at 4:48 PM Raymond West raywest@raywest.com wrote:
include<R:\Users\Ray\source\repos\timerapp\seeder>
echo (rands(0,10,2,9));
echo (rands(10,20,2));
echo (rands(20,30,2,ft));
The last random number pair can always be reseeded with a
different different seed (currently the ft seed is incremented
every two seconds) If it runs continuously, it;ll be about 15
years before it repeats.
-------- Forwarded Message --------
Subject: [OpenSCAD] Re: svg conversion in openscad
Date: Fri, 21 Oct 2022 17:46:41 +0100
From: Raymond West <raywest@raywest.com>
<mailto:raywest@raywest.com>
Reply-To: OpenSCAD general discussion Mailing-list
<discuss@lists.openscad.org> <mailto:discuss@lists.openscad.org>
To: discuss@lists.openscad.org
Thanks for the suggestions, I've temporarily solved half the
problem, simply write a file with my list of variables, in a text
editor, or generated by some other program, and include. So,
instead of my generating and formatting a text file, and
copying/paste it in as a list of points, I simply generate a valid
scad file. Wood, trees, not seeing comes to mind.
That file can be included wherever I want in the scad file, now to
try to find a way of saving data wherever I want e.g from within a
module.
Virtually any programming language, maybe powershell, can create a
line like
seed=22102017152530;
based on the time, and save it as an scad file. It'll need to
refresh every second or so, however, depending on needs.
On 21/10/2022 16:43, Father Horton wrote:
My understanding is that OpenSCAD as currently constituted does
not expose the internals of objects, native or imported.
On Fri, Oct 21, 2022 at 10:22 AM fred via Discuss
<discuss@lists.openscad.org> wrote:
---------- Forwarded message ----------
From: fred <fred_dot_u@yahoo.com>
To: OpenSCAD general discussion Mailing-list
<discuss@lists.openscad.org>
Cc:
Bcc:
Date: Fri, 21 Oct 2022 15:22:02 +0000 (UTC)
Subject: [OpenSCAD] Re: svg conversion in openscad
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 <https://www.thingiverse.com/thing:25036>
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...
<https://www.thingiverse.com/thing:25036>
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
---------- Forwarded message ----------
From: fred via Discuss <discuss@lists.openscad.org>
To: OpenSCAD general discussion Mailing-list
<discuss@lists.openscad.org>
Cc: fred <fred_dot_u@yahoo.com>
Bcc:
Date: Fri, 21 Oct 2022 15:22:02 +0000 (UTC)
Subject: [OpenSCAD] Re: svg conversion in openscad
_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email todiscuss-leave@lists.openscad.org
_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
OpenSCAD mailing list
To unsubscribe send an email todiscuss-leave@lists.openscad.org
Hi Adrian,
The random number concern was the fact that other languages that I have
used in the past could use a system timer for reseeding. I can do that
now, if i need to, within openscad. The two seconds is the approx time I
set for sleep in the external program to increment the seeder code. I
will probably never need it, but it was an easy example to set up.
In the past I had written external code to import, manipulate or
generate svg code, and save it such that openscad could import the
changed svg. Now I can import the svg as a list of points, or whatever,
more or less anywhere in the openscad script.
I'm not sure what security risk is created by exporting a list of
numbers from within openscad. A risk to who, or what? As it is, openscad
exports/imports it's own version of svgs and dxfs, which leads to errors
in other programs, so I can't see a list of numbers generated by the
user's scripting as being any more risky.
Best wishes,
Ray
On 21/10/2022 22:08, Adrian Mariano wrote:
> I'm not sure I understand your concerns about the random numbers.
> With a well-designed psueodrandom number generator, you're going to
> get satisfactory outputs with a single seed. If you are constantly
> reseeding ("increment the seed every two seconds") the most likely
> result of this is that you will make the results less random.
> Assuming the initializing is good, you normally only need to worry
> about the seed if you need repeatability, that is, if you specifically
> want to generate the same sequence again.
>
> There is no way to programmatically write data from OpenSCAD. This is
> seen as a security risk so I'm guessing it is unlikely to happen. At
> risk of repeating previous posts, I think there are libraries that
> will change SVG to point lists, and there are OpenSCAD libraries that
> will parse SVG into a point list, so you embed the SVG text content
> into your scad file.
>
>
> On Fri, Oct 21, 2022 at 4:48 PM Raymond West <raywest@raywest.com> wrote:
>
> include<R:\Users\Ray\source\repos\timerapp\seeder>
> echo (rands(0,10,2,9));
> echo (rands(10,20,2));
> echo (rands(20,30,2,ft));
>
> The last random number pair can always be reseeded with a
> different different seed (currently the ft seed is incremented
> every two seconds) If it runs continuously, it;ll be about 15
> years before it repeats.
>
>
>
> -------- Forwarded Message --------
> Subject: [OpenSCAD] Re: svg conversion in openscad
> Date: Fri, 21 Oct 2022 17:46:41 +0100
> From: Raymond West <raywest@raywest.com>
> <mailto:raywest@raywest.com>
> Reply-To: OpenSCAD general discussion Mailing-list
> <discuss@lists.openscad.org> <mailto:discuss@lists.openscad.org>
> To: discuss@lists.openscad.org
>
>
>
> Thanks for the suggestions, I've temporarily solved half the
> problem, simply write a file with my list of variables, in a text
> editor, or generated by some other program, and include. So,
> instead of my generating and formatting a text file, and
> copying/paste it in as a list of points, I simply generate a valid
> scad file. Wood, trees, not seeing comes to mind.
>
> That file can be included wherever I want in the scad file, now to
> try to find a way of saving data wherever I want e.g from within a
> module.
>
> Virtually any programming language, maybe powershell, can create a
> line like
>
> seed=22102017152530;
>
> based on the time, and save it as an scad file. It'll need to
> refresh every second or so, however, depending on needs.
>
> On 21/10/2022 16:43, Father Horton wrote:
>> My understanding is that OpenSCAD as currently constituted does
>> not expose the internals of objects, native or imported.
>>
>> On Fri, Oct 21, 2022 at 10:22 AM fred via Discuss
>> <discuss@lists.openscad.org> wrote:
>>
>>
>>
>>
>> ---------- Forwarded message ----------
>> From: fred <fred_dot_u@yahoo.com>
>> To: OpenSCAD general discussion Mailing-list
>> <discuss@lists.openscad.org>
>> Cc:
>> Bcc:
>> Date: Fri, 21 Oct 2022 15:22:02 +0000 (UTC)
>> Subject: [OpenSCAD] Re: svg conversion in openscad
>> 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 <https://www.thingiverse.com/thing:25036>
>> 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...
>>
>> <https://www.thingiverse.com/thing:25036>
>>
>>
>>
>> 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
>>
>>
>>
>> ---------- Forwarded message ----------
>> From: fred via Discuss <discuss@lists.openscad.org>
>> To: OpenSCAD general discussion Mailing-list
>> <discuss@lists.openscad.org>
>> Cc: fred <fred_dot_u@yahoo.com>
>> Bcc:
>> Date: Fri, 21 Oct 2022 15:22:02 +0000 (UTC)
>> Subject: [OpenSCAD] Re: svg conversion in openscad
>> _______________________________________________
>> OpenSCAD mailing list
>> To unsubscribe send an email to discuss-leave@lists.openscad.org
>>
>>
>> _______________________________________________
>> OpenSCAD mailing list
>> To unsubscribe send an email todiscuss-leave@lists.openscad.org
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
>
>
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email todiscuss-leave@lists.openscad.org
AM
Adrian Mariano
Fri, Oct 21, 2022 11:30 PM
The only reason you'd want to reseed based on the clock is the one Jordan
mentioned, that you need to mix repeatable and non-repeatable number
streams.
I'm just reporting what I've read in the past on this forum: if you can't
write to the disk you can't cause harm. If you can write to the disk,
maybe you can. Maybe you obliterate some important file with numbers and
it causes problems. Maybe there's an openscad bug that lets you cause it
to write something else. Basically, it creates a possibility that isn't
otherwise present.
On Fri, Oct 21, 2022 at 7:20 PM Raymond West raywest@raywest.com wrote:
Hi Adrian,
The random number concern was the fact that other languages that I have
used in the past could use a system timer for reseeding. I can do that now,
if i need to, within openscad. The two seconds is the approx time I set for
sleep in the external program to increment the seeder code. I will probably
never need it, but it was an easy example to set up.
In the past I had written external code to import, manipulate or generate
svg code, and save it such that openscad could import the changed svg. Now
I can import the svg as a list of points, or whatever, more or less
anywhere in the openscad script.
I'm not sure what security risk is created by exporting a list of numbers
from within openscad. A risk to who, or what? As it is, openscad
exports/imports it's own version of svgs and dxfs, which leads to errors in
other programs, so I can't see a list of numbers generated by the user's
scripting as being any more risky.
Best wishes,
Ray
On 21/10/2022 22:08, Adrian Mariano wrote:
I'm not sure I understand your concerns about the random numbers. With a
well-designed psueodrandom number generator, you're going to get
satisfactory outputs with a single seed. If you are constantly reseeding
("increment the seed every two seconds") the most likely result of this is
that you will make the results less random. Assuming the initializing is
good, you normally only need to worry about the seed if you need
repeatability, that is, if you specifically want to generate the same
sequence again.
There is no way to programmatically write data from OpenSCAD. This is
seen as a security risk so I'm guessing it is unlikely to happen. At risk
of repeating previous posts, I think there are libraries that will change
SVG to point lists, and there are OpenSCAD libraries that will parse SVG
into a point list, so you embed the SVG text content into your scad file.
On Fri, Oct 21, 2022 at 4:48 PM Raymond West raywest@raywest.com wrote:
include<R:\Users\Ray\source\repos\timerapp\seeder>
echo (rands(0,10,2,9));
echo (rands(10,20,2));
echo (rands(20,30,2,ft));
The last random number pair can always be reseeded with a different
different seed (currently the ft seed is incremented every two seconds) If
it runs continuously, it;ll be about 15 years before it repeats.
-------- Forwarded Message --------
Subject: [OpenSCAD] Re: svg conversion in openscad
Date: Fri, 21 Oct 2022 17:46:41 +0100
From: Raymond West raywest@raywest.com raywest@raywest.com
Reply-To: OpenSCAD general discussion Mailing-list
discuss@lists.openscad.org discuss@lists.openscad.org
To: discuss@lists.openscad.org
Thanks for the suggestions, I've temporarily solved half the problem,
simply write a file with my list of variables, in a text editor, or
generated by some other program, and include. So, instead of my generating
and formatting a text file, and copying/paste it in as a list of points, I
simply generate a valid scad file. Wood, trees, not seeing comes to mind.
That file can be included wherever I want in the scad file, now to try to
find a way of saving data wherever I want e.g from within a module.
Virtually any programming language, maybe powershell, can create a line
like
seed=22102017152530;
based on the time, and save it as an scad file. It'll need to refresh
every second or so, however, depending on needs.
On 21/10/2022 16:43, Father Horton wrote:
My understanding is that OpenSCAD as currently constituted does not
expose the internals of objects, native or imported.
On Fri, Oct 21, 2022 at 10:22 AM fred via Discuss <
discuss@lists.openscad.org> wrote:
Cc:
Bcc:
Date: Fri, 21 Oct 2022 15:22:02 +0000 (UTC)
Subject: [OpenSCAD] Re: svg conversion in openscad
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
https://www.thingiverse.com/thing:25036 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...
https://www.thingiverse.com/thing:25036
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
---------- Forwarded message ----------
From: fred via Discuss discuss@lists.openscad.org
To: OpenSCAD general discussion Mailing-list <discuss@lists.openscad.org
The only reason you'd want to reseed based on the clock is the one Jordan
mentioned, that you need to mix repeatable and non-repeatable number
streams.
I'm just reporting what I've read in the past on this forum: if you can't
write to the disk you can't cause harm. If you can write to the disk,
maybe you can. Maybe you obliterate some important file with numbers and
it causes problems. Maybe there's an openscad bug that lets you cause it
to write something else. Basically, it creates a possibility that isn't
otherwise present.
On Fri, Oct 21, 2022 at 7:20 PM Raymond West <raywest@raywest.com> wrote:
> Hi Adrian,
>
> The random number concern was the fact that other languages that I have
> used in the past could use a system timer for reseeding. I can do that now,
> if i need to, within openscad. The two seconds is the approx time I set for
> sleep in the external program to increment the seeder code. I will probably
> never need it, but it was an easy example to set up.
>
> In the past I had written external code to import, manipulate or generate
> svg code, and save it such that openscad could import the changed svg. Now
> I can import the svg as a list of points, or whatever, more or less
> anywhere in the openscad script.
>
> I'm not sure what security risk is created by exporting a list of numbers
> from within openscad. A risk to who, or what? As it is, openscad
> exports/imports it's own version of svgs and dxfs, which leads to errors in
> other programs, so I can't see a list of numbers generated by the user's
> scripting as being any more risky.
>
> Best wishes,
>
>
> Ray
>
>
>
> On 21/10/2022 22:08, Adrian Mariano wrote:
>
> I'm not sure I understand your concerns about the random numbers. With a
> well-designed psueodrandom number generator, you're going to get
> satisfactory outputs with a single seed. If you are constantly reseeding
> ("increment the seed every two seconds") the most likely result of this is
> that you will make the results less random. Assuming the initializing is
> good, you normally only need to worry about the seed if you need
> repeatability, that is, if you specifically want to generate the same
> sequence again.
>
> There is no way to programmatically write data from OpenSCAD. This is
> seen as a security risk so I'm guessing it is unlikely to happen. At risk
> of repeating previous posts, I think there are libraries that will change
> SVG to point lists, and there are OpenSCAD libraries that will parse SVG
> into a point list, so you embed the SVG text content into your scad file.
>
>
> On Fri, Oct 21, 2022 at 4:48 PM Raymond West <raywest@raywest.com> wrote:
>
>> include<R:\Users\Ray\source\repos\timerapp\seeder>
>> echo (rands(0,10,2,9));
>> echo (rands(10,20,2));
>> echo (rands(20,30,2,ft));
>>
>> The last random number pair can always be reseeded with a different
>> different seed (currently the ft seed is incremented every two seconds) If
>> it runs continuously, it;ll be about 15 years before it repeats.
>>
>>
>> -------- Forwarded Message --------
>> Subject: [OpenSCAD] Re: svg conversion in openscad
>> Date: Fri, 21 Oct 2022 17:46:41 +0100
>> From: Raymond West <raywest@raywest.com> <raywest@raywest.com>
>> Reply-To: OpenSCAD general discussion Mailing-list
>> <discuss@lists.openscad.org> <discuss@lists.openscad.org>
>> To: discuss@lists.openscad.org
>>
>> Thanks for the suggestions, I've temporarily solved half the problem,
>> simply write a file with my list of variables, in a text editor, or
>> generated by some other program, and include. So, instead of my generating
>> and formatting a text file, and copying/paste it in as a list of points, I
>> simply generate a valid scad file. Wood, trees, not seeing comes to mind.
>>
>> That file can be included wherever I want in the scad file, now to try to
>> find a way of saving data wherever I want e.g from within a module.
>>
>> Virtually any programming language, maybe powershell, can create a line
>> like
>>
>> seed=22102017152530;
>>
>> based on the time, and save it as an scad file. It'll need to refresh
>> every second or so, however, depending on needs.
>> On 21/10/2022 16:43, Father Horton wrote:
>>
>> My understanding is that OpenSCAD as currently constituted does not
>> expose the internals of objects, native or imported.
>>
>> On Fri, Oct 21, 2022 at 10:22 AM fred via Discuss <
>> discuss@lists.openscad.org> wrote:
>>
>>>
>>>
>>>
>>> ---------- Forwarded message ----------
>>> From: fred <fred_dot_u@yahoo.com>
>>> To: OpenSCAD general discussion Mailing-list <discuss@lists.openscad.org
>>> >
>>> Cc:
>>> Bcc:
>>> Date: Fri, 21 Oct 2022 15:22:02 +0000 (UTC)
>>> Subject: [OpenSCAD] Re: svg conversion in openscad
>>> 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
>>> <https://www.thingiverse.com/thing:25036> 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...
>>> <https://www.thingiverse.com/thing:25036>
>>>
>>>
>>>
>>> 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
>>>
>>>
>>>
>>> ---------- Forwarded message ----------
>>> From: fred via Discuss <discuss@lists.openscad.org>
>>> To: OpenSCAD general discussion Mailing-list <discuss@lists.openscad.org
>>> >
>>> Cc: fred <fred_dot_u@yahoo.com>
>>> Bcc:
>>> Date: Fri, 21 Oct 2022 15:22:02 +0000 (UTC)
>>> Subject: [OpenSCAD] Re: svg conversion in openscad
>>> _______________________________________________
>>> OpenSCAD mailing list
>>> To unsubscribe send an email to discuss-leave@lists.openscad.org
>>>
>>
>> _______________________________________________
>> OpenSCAD mailing list
>> To unsubscribe send an email to discuss-leave@lists.openscad.org
>>
>> _______________________________________________
>> OpenSCAD mailing list
>> To unsubscribe send an email to discuss-leave@lists.openscad.org
>>
>
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
>
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
>
JB
Jordan Brown
Sat, Oct 22, 2022 12:29 AM
On 10/21/2022 4:18 PM, Raymond West wrote:
I'm not sure what security risk is created by exporting a list of
numbers from within openscad. A risk to who, or what?
You're a Linux user, right? Suppose that we had a module
export(filename, value) that writes the specified value to the specified
file.
export(".profile", [0]);
... destroys the user's login script, if they run OpenSCAD in their home
directory.
for (i=[1:999999], j=[1:999999]) export(str(i,"-",j), [0]);
fills up the user's disk by creating ~10^12 files in the current directory.
As it is, openscad exports/imports it's own version of svgs and dxfs,
which leads to errors in other programs, so I can't see a list of
numbers generated by the user's scripting as being any more risky.
There's a big difference between allowing the user to save the output
from the program to a file of their choice, and allowing the program to
save data to a name of its choice without the user's intervention.
One could easily imagine having a user action "save the log from the
last run" - but that would be the user taking an action and controlling
the name of the file to be written.
On 10/21/2022 4:18 PM, Raymond West wrote:
> I'm not sure what security risk is created by exporting a list of
> numbers from within openscad. A risk to who, or what?
You're a Linux user, right? Suppose that we had a module
export(filename, value) that writes the specified value to the specified
file.
export(".profile", [0]);
... destroys the user's login script, if they run OpenSCAD in their home
directory.
for (i=[1:999999], j=[1:999999]) export(str(i,"-",j), [0]);
fills up the user's disk by creating ~10^12 files in the current directory.
> As it is, openscad exports/imports it's own version of svgs and dxfs,
> which leads to errors in other programs, so I can't see a list of
> numbers generated by the user's scripting as being any more risky.
There's a big difference between allowing the user to save the output
from the program to a file of their choice, and allowing the program to
save data to a name of its choice without the user's intervention.
One could easily imagine having a user action "save the log from the
last run" - but that would be the user taking an action and controlling
the name of the file to be written.