discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

oddShape Import II

JW
Joe Weinpert
Thu, Jan 13, 2022 9:04 PM

Been looking at the suggestions in using the BOSL2 mods and functions.  Ran
through the "star" demo.

As to the odd shapes I referred to in a previous email, it was suggested to
use something like this:

include<BOSL2/std.scad>
include<BOSL2/rounding.scad>
shape = [[3,4],[10,10],...etc];  // Shape defined as list of (x,y)
coordinates,
without repeating the first point.
offset_sweep(shape, height=1INCH, top=os_circle(r=1/4INCH));

Because I am importing pre-designed odd shapes (not generating them), is
there a way to generate a list of points from a 2D imported svg shape that
can be used in the above offset_sweep function?

Been looking at the suggestions in using the BOSL2 mods and functions. Ran through the "star" demo. As to the odd shapes I referred to in a previous email, it was suggested to use something like this: include<BOSL2/std.scad> include<BOSL2/rounding.scad> shape = [[3,4],[10,10],...etc]; // Shape defined as list of (x,y) coordinates, without repeating the first point. offset_sweep(shape, height=1*INCH, top=os_circle(r=1/4*INCH)); Because I am importing pre-designed odd shapes (not generating them), is there a way to generate a list of points from a 2D imported svg shape that can be used in the above offset_sweep function?
DS
Daniel Shriver
Fri, Jan 14, 2022 3:01 AM

I'm kind of thinking aloud here and not completely sure if my suggestions
will work or not.

Isn't there some OpenSCAD function (like offset, can't remember the name)
where you can use a closed polygon, and get back a "concentric" inner
polygon?
If so, then you can do that and iterate over several linear extrudes to
generate a ziggurat top to your shape.

Alternately, you can look into the various "sweep" functions.  At least one
of them (maybe even the one in your email) can apply one "shape/curvature"
to another one.  I don't know if that means the rounded top will get
smaller as your polygon "narrows" at the "end points" or not.

On Thu, Jan 13, 2022 at 4:04 PM Joe Weinpert joe.weinpert@gmail.com wrote:

Been looking at the suggestions in using the BOSL2 mods and functions.
Ran through the "star" demo.

As to the odd shapes I referred to in a previous email, it was
suggested to use something like this:

include<BOSL2/std.scad>
include<BOSL2/rounding.scad>
shape = [[3,4],[10,10],...etc];  // Shape defined as list of (x,y) coordinates,
without repeating the first point.
offset_sweep(shape, height=1INCH, top=os_circle(r=1/4INCH));

Because I am importing pre-designed odd shapes (not generating them), is
there a way to generate a list of points from a 2D imported svg shape that
can be used in the above offset_sweep function?


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

I'm kind of thinking aloud here and not completely sure if my suggestions will work or not. Isn't there some OpenSCAD function (like offset, can't remember the name) where you can use a closed polygon, and get back a "concentric" inner polygon? If so, then you can do that and iterate over several linear extrudes to generate a ziggurat top to your shape. Alternately, you can look into the various "sweep" functions. At least one of them (maybe even the one in your email) can apply one "shape/curvature" to another one. I don't know if that means the rounded top will get smaller as your polygon "narrows" at the "end points" or not. On Thu, Jan 13, 2022 at 4:04 PM Joe Weinpert <joe.weinpert@gmail.com> wrote: > Been looking at the suggestions in using the BOSL2 mods and functions. > Ran through the "star" demo. > > As to the odd shapes I referred to in a previous email, it was > suggested to use something like this: > > include<BOSL2/std.scad> > include<BOSL2/rounding.scad> > shape = [[3,4],[10,10],...etc]; // Shape defined as list of (x,y) coordinates, > without repeating the first point. > offset_sweep(shape, height=1*INCH, top=os_circle(r=1/4*INCH)); > > > Because I am importing pre-designed odd shapes (not generating them), is > there a way to generate a list of points from a 2D imported svg shape that > can be used in the above offset_sweep function? > > > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
RD
Revar Desmera
Fri, Jan 14, 2022 5:01 AM

If you use the pathfinder library ( https://github.com/dinther/pathbuilder ) you should be able to take the path from the SVG path element and use pathfinder to decode it into an OpenSCAD path.  You can then pass that to BOSL2.

-Revar

On Jan 13, 2022, at 1:05 PM, Joe Weinpert joe.weinpert@gmail.com wrote:


Been looking at the suggestions in using the BOSL2 mods and functions.  Ran through the "star" demo.

As to the odd shapes I referred to in a previous email, it was suggested to use something like this:

include<BOSL2/std.scad>
include<BOSL2/rounding.scad>
shape = [[3,4],[10,10],...etc];  // Shape defined as list of (x,y) coordinates, without repeating the first point.
offset_sweep(shape, height=1INCH, top=os_circle(r=1/4INCH));

Because I am importing pre-designed odd shapes (not generating them), is there a way to generate a list of points from a 2D imported svg shape that can be used in the above offset_sweep function?


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

If you use the pathfinder library ( https://github.com/dinther/pathbuilder ) you should be able to take the path from the SVG path element and use pathfinder to decode it into an OpenSCAD path. You can then pass that to BOSL2. -Revar > On Jan 13, 2022, at 1:05 PM, Joe Weinpert <joe.weinpert@gmail.com> wrote: > >  > Been looking at the suggestions in using the BOSL2 mods and functions. Ran through the "star" demo. > > As to the odd shapes I referred to in a previous email, it was suggested to use something like this: > > include<BOSL2/std.scad> > include<BOSL2/rounding.scad> > shape = [[3,4],[10,10],...etc]; // Shape defined as list of (x,y) coordinates, without repeating the first point. > offset_sweep(shape, height=1*INCH, top=os_circle(r=1/4*INCH)); > > Because I am importing pre-designed odd shapes (not generating them), is there a way to generate a list of points from a 2D imported svg shape that can be used in the above offset_sweep function? > > > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org
JW
Joe Weinpert
Fri, Jan 14, 2022 7:18 PM

When running the* points_first_demo.scad demo:*

include <pathbuilder.scad>
pb_petal = "m0 -1c-25-30 25-30 0,0 z";
$pb_spline=66;                                  //  We want 36 line
segments on each spline.
pts = svgPoints(pb_petal);                      //  Generate points list
for the svg path.
//  Do your thing to the points here
for(a=[0:120:360]) rotate([0,15,a]) polygon(pts);

I get this error:

ERROR: Unable to convert points[0] = [[0, -1], [0, -1], [-1.08523,
-2.34298], [-2.07029, -3.64463], [-2.9583, -4.90496], [-3.7524, -6.12397],
[-4.45571, -7.30165], [-5.07137, -8.43802], [-5.60251, -9.53306],
[-6.05226, -10.5868], [-6.42374, -11.5992], [-6.72009, -12.5702],
[-6.94444, -13.5], [-7.09992, -14.3884], [-7.18967, -15.2355], [-7.2168,
-16.0413], [-7.18445, -16.8058], [-7.09575, -17.5289], [-6.95384,
-18.2107], [-6.76183, -18.8512], [-6.52287, -19.4504], [-6.24009,
-20.0083], [-5.9166, -20.5248], [-5.55556, -21], [-5.16007, -21.4339],
[-4.73328, -21.8264], [-4.27832, -22.1777], [-3.79831, -22.4876],
[-3.29639, -22.7562], [-2.77569, -22.9835], [-2.23934, -23.1694],
[-1.69046, -23.314], [-1.13219, -23.4174], [-0.56766, -23.4793], [0,
-23.5], [0.56766, -23.4793], [1.13219, -23.4174], [1.69046, -23.314],
[2.23934, -23.1694], [2.77569, -22.9835], [3.29639, -22.7562], [3.79831,
-22.4876], [4.27832, -22.1777], [4.73328, -21.8264], [5.16007, -21.4339],
[5.55556, -21], [5.9166, -20.5248], [6.24009, -20.0083], [6.52287,
-19.4504], [6.76183, -18.8512], [6.95384, -18.2107], [7.09575, -17.5289],
[7.18445, -16.8058], [7.2168, -16.0413], [7.18967, -15.2355], [7.09992,
-14.3884], [6.94444, -13.5], [6.72009, -12.5702], [6.42374, -11.5992],
[6.05226, -10.5868], [5.60251, -9.53306], [5.07137, -8.43802], [4.45571,
-7.30165], [3.7524, -6.12397], [2.9583, -4.90496], [2.07029, -3.64463],
[1.08523, -2.34298], [0, -1]] to a vec2 of numbers in file
points_first_demo.scad, line 7

Any ideas?

On Fri, Jan 14, 2022 at 12:02 AM Revar Desmera revarbat@gmail.com wrote:

If you use the pathfinder library ( https://github.com/dinther/pathbuilder )
you should be able to take the path from the SVG path element and use
pathfinder to decode it into an OpenSCAD path.  You can then pass that to
BOSL2.

-Revar

On Jan 13, 2022, at 1:05 PM, Joe Weinpert joe.weinpert@gmail.com wrote:


Been looking at the suggestions in using the BOSL2 mods and functions.
Ran through the "star" demo.

As to the odd shapes I referred to in a previous email, it was
suggested to use something like this:

include<BOSL2/std.scad>
include<BOSL2/rounding.scad>
shape = [[3,4],[10,10],...etc];  // Shape defined as list of (x,y) coordinates,
without repeating the first point.
offset_sweep(shape, height=1INCH, top=os_circle(r=1/4INCH));

Because I am importing pre-designed odd shapes (not generating them), is
there a way to generate a list of points from a 2D imported svg shape that
can be used in the above offset_sweep function?


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

When running the* points_first_demo.scad *demo*:* include <pathbuilder.scad> pb_petal = "m0 -1c-25-30 25-30 0,0 z"; $pb_spline=66; // We want 36 line segments on each spline. pts = svgPoints(pb_petal); // Generate points list for the svg path. // Do your thing to the points here for(a=[0:120:360]) rotate([0,15,a]) polygon(pts); I get this error: ERROR: Unable to convert points[0] = [[0, -1], [0, -1], [-1.08523, -2.34298], [-2.07029, -3.64463], [-2.9583, -4.90496], [-3.7524, -6.12397], [-4.45571, -7.30165], [-5.07137, -8.43802], [-5.60251, -9.53306], [-6.05226, -10.5868], [-6.42374, -11.5992], [-6.72009, -12.5702], [-6.94444, -13.5], [-7.09992, -14.3884], [-7.18967, -15.2355], [-7.2168, -16.0413], [-7.18445, -16.8058], [-7.09575, -17.5289], [-6.95384, -18.2107], [-6.76183, -18.8512], [-6.52287, -19.4504], [-6.24009, -20.0083], [-5.9166, -20.5248], [-5.55556, -21], [-5.16007, -21.4339], [-4.73328, -21.8264], [-4.27832, -22.1777], [-3.79831, -22.4876], [-3.29639, -22.7562], [-2.77569, -22.9835], [-2.23934, -23.1694], [-1.69046, -23.314], [-1.13219, -23.4174], [-0.56766, -23.4793], [0, -23.5], [0.56766, -23.4793], [1.13219, -23.4174], [1.69046, -23.314], [2.23934, -23.1694], [2.77569, -22.9835], [3.29639, -22.7562], [3.79831, -22.4876], [4.27832, -22.1777], [4.73328, -21.8264], [5.16007, -21.4339], [5.55556, -21], [5.9166, -20.5248], [6.24009, -20.0083], [6.52287, -19.4504], [6.76183, -18.8512], [6.95384, -18.2107], [7.09575, -17.5289], [7.18445, -16.8058], [7.2168, -16.0413], [7.18967, -15.2355], [7.09992, -14.3884], [6.94444, -13.5], [6.72009, -12.5702], [6.42374, -11.5992], [6.05226, -10.5868], [5.60251, -9.53306], [5.07137, -8.43802], [4.45571, -7.30165], [3.7524, -6.12397], [2.9583, -4.90496], [2.07029, -3.64463], [1.08523, -2.34298], [0, -1]] to a vec2 of numbers in file points_first_demo.scad, line 7 Any ideas? On Fri, Jan 14, 2022 at 12:02 AM Revar Desmera <revarbat@gmail.com> wrote: > If you use the pathfinder library ( https://github.com/dinther/pathbuilder ) > you should be able to take the path from the SVG path element and use > pathfinder to decode it into an OpenSCAD path. You can then pass that to > BOSL2. > > -Revar > > > On Jan 13, 2022, at 1:05 PM, Joe Weinpert <joe.weinpert@gmail.com> wrote: > >  > Been looking at the suggestions in using the BOSL2 mods and functions. > Ran through the "star" demo. > > As to the odd shapes I referred to in a previous email, it was > suggested to use something like this: > > include<BOSL2/std.scad> > include<BOSL2/rounding.scad> > shape = [[3,4],[10,10],...etc]; // Shape defined as list of (x,y) coordinates, > without repeating the first point. > offset_sweep(shape, height=1*INCH, top=os_circle(r=1/4*INCH)); > > > Because I am importing pre-designed odd shapes (not generating them), is > there a way to generate a list of points from a 2D imported svg shape that > can be used in the above offset_sweep function? > > > > > _______________________________________________ > 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 >
AM
Adrian Mariano
Sat, Jan 15, 2022 1:10 AM

You don't give your point list, so I can only guess, but from the
error it appears maybe your point list is nested too deeply, like it's
a list of lists of points instead of just a list of points.  If my
guess is right then it would work if you did polygon(pts[0]).

On Fri, Jan 14, 2022 at 2:18 PM Joe Weinpert joe.weinpert@gmail.com wrote:

When running the points_first_demo.scad demo:

include <pathbuilder.scad>
pb_petal = "m0 -1c-25-30 25-30 0,0 z";
$pb_spline=66;                                  //  We want 36 line segments on each spline.
pts = svgPoints(pb_petal);                      //  Generate points list for the svg path.
//  Do your thing to the points here
for(a=[0:120:360]) rotate([0,15,a]) polygon(pts);

I get this error:

ERROR: Unable to convert points[0] = [[0, -1], [0, -1], [-1.08523, -2.34298], [-2.07029, -3.64463], [-2.9583, -4.90496], [-3.7524, -6.12397], [-4.45571, -7.30165], [-5.07137, -8.43802], [-5.60251, -9.53306], [-6.05226, -10.5868], [-6.42374, -11.5992], [-6.72009, -12.5702], [-6.94444, -13.5], [-7.09992, -14.3884], [-7.18967, -15.2355], [-7.2168, -16.0413], [-7.18445, -16.8058], [-7.09575, -17.5289], [-6.95384, -18.2107], [-6.76183, -18.8512], [-6.52287, -19.4504], [-6.24009, -20.0083], [-5.9166, -20.5248], [-5.55556, -21], [-5.16007, -21.4339], [-4.73328, -21.8264], [-4.27832, -22.1777], [-3.79831, -22.4876], [-3.29639, -22.7562], [-2.77569, -22.9835], [-2.23934, -23.1694], [-1.69046, -23.314], [-1.13219, -23.4174], [-0.56766, -23.4793], [0, -23.5], [0.56766, -23.4793], [1.13219, -23.4174], [1.69046, -23.314], [2.23934, -23.1694], [2.77569, -22.9835], [3.29639, -22.7562], [3.79831, -22.4876], [4.27832, -22.1777], [4.73328, -21.8264], [5.16007, -21.4339], [5.55556, -21], [5.9166, -20.5248], [6.24009, -20.0083], [6.52287, -19.4504], [6.76183, -18.8512], [6.95384, -18.2107], [7.09575, -17.5289], [7.18445, -16.8058], [7.2168, -16.0413], [7.18967, -15.2355], [7.09992, -14.3884], [6.94444, -13.5], [6.72009, -12.5702], [6.42374, -11.5992], [6.05226, -10.5868], [5.60251, -9.53306], [5.07137, -8.43802], [4.45571, -7.30165], [3.7524, -6.12397], [2.9583, -4.90496], [2.07029, -3.64463], [1.08523, -2.34298], [0, -1]] to a vec2 of numbers in file points_first_demo.scad, line 7

Any ideas?

On Fri, Jan 14, 2022 at 12:02 AM Revar Desmera revarbat@gmail.com wrote:

If you use the pathfinder library ( https://github.com/dinther/pathbuilder ) you should be able to take the path from the SVG path element and use pathfinder to decode it into an OpenSCAD path.  You can then pass that to BOSL2.

-Revar

On Jan 13, 2022, at 1:05 PM, Joe Weinpert joe.weinpert@gmail.com wrote:


Been looking at the suggestions in using the BOSL2 mods and functions.  Ran through the "star" demo.

As to the odd shapes I referred to in a previous email, it was suggested to use something like this:

include<BOSL2/std.scad>
include<BOSL2/rounding.scad>
shape = [[3,4],[10,10],...etc];  // Shape defined as list of (x,y) coordinates, without repeating the first point.
offset_sweep(shape, height=1INCH, top=os_circle(r=1/4INCH));

Because I am importing pre-designed odd shapes (not generating them), is there a way to generate a list of points from a 2D imported svg shape that can be used in the above offset_sweep function?


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

You don't give your point list, so I can only guess, but from the error it appears maybe your point list is nested too deeply, like it's a list of lists of points instead of just a list of points. If my guess is right then it would work if you did polygon(pts[0]). On Fri, Jan 14, 2022 at 2:18 PM Joe Weinpert <joe.weinpert@gmail.com> wrote: > > When running the points_first_demo.scad demo: > > include <pathbuilder.scad> > pb_petal = "m0 -1c-25-30 25-30 0,0 z"; > $pb_spline=66; // We want 36 line segments on each spline. > pts = svgPoints(pb_petal); // Generate points list for the svg path. > // Do your thing to the points here > for(a=[0:120:360]) rotate([0,15,a]) polygon(pts); > > > > I get this error: > > ERROR: Unable to convert points[0] = [[0, -1], [0, -1], [-1.08523, -2.34298], [-2.07029, -3.64463], [-2.9583, -4.90496], [-3.7524, -6.12397], [-4.45571, -7.30165], [-5.07137, -8.43802], [-5.60251, -9.53306], [-6.05226, -10.5868], [-6.42374, -11.5992], [-6.72009, -12.5702], [-6.94444, -13.5], [-7.09992, -14.3884], [-7.18967, -15.2355], [-7.2168, -16.0413], [-7.18445, -16.8058], [-7.09575, -17.5289], [-6.95384, -18.2107], [-6.76183, -18.8512], [-6.52287, -19.4504], [-6.24009, -20.0083], [-5.9166, -20.5248], [-5.55556, -21], [-5.16007, -21.4339], [-4.73328, -21.8264], [-4.27832, -22.1777], [-3.79831, -22.4876], [-3.29639, -22.7562], [-2.77569, -22.9835], [-2.23934, -23.1694], [-1.69046, -23.314], [-1.13219, -23.4174], [-0.56766, -23.4793], [0, -23.5], [0.56766, -23.4793], [1.13219, -23.4174], [1.69046, -23.314], [2.23934, -23.1694], [2.77569, -22.9835], [3.29639, -22.7562], [3.79831, -22.4876], [4.27832, -22.1777], [4.73328, -21.8264], [5.16007, -21.4339], [5.55556, -21], [5.9166, -20.5248], [6.24009, -20.0083], [6.52287, -19.4504], [6.76183, -18.8512], [6.95384, -18.2107], [7.09575, -17.5289], [7.18445, -16.8058], [7.2168, -16.0413], [7.18967, -15.2355], [7.09992, -14.3884], [6.94444, -13.5], [6.72009, -12.5702], [6.42374, -11.5992], [6.05226, -10.5868], [5.60251, -9.53306], [5.07137, -8.43802], [4.45571, -7.30165], [3.7524, -6.12397], [2.9583, -4.90496], [2.07029, -3.64463], [1.08523, -2.34298], [0, -1]] to a vec2 of numbers in file points_first_demo.scad, line 7 > > > > Any ideas? > > > > > On Fri, Jan 14, 2022 at 12:02 AM Revar Desmera <revarbat@gmail.com> wrote: >> >> If you use the pathfinder library ( https://github.com/dinther/pathbuilder ) you should be able to take the path from the SVG path element and use pathfinder to decode it into an OpenSCAD path. You can then pass that to BOSL2. >> >> -Revar >> >> >> On Jan 13, 2022, at 1:05 PM, Joe Weinpert <joe.weinpert@gmail.com> wrote: >> >>  >> Been looking at the suggestions in using the BOSL2 mods and functions. Ran through the "star" demo. >> >> As to the odd shapes I referred to in a previous email, it was suggested to use something like this: >> >> include<BOSL2/std.scad> >> include<BOSL2/rounding.scad> >> shape = [[3,4],[10,10],...etc]; // Shape defined as list of (x,y) coordinates, without repeating the first point. >> offset_sweep(shape, height=1*INCH, top=os_circle(r=1/4*INCH)); >> >> >> Because I am importing pre-designed odd shapes (not generating them), is there a way to generate a list of points from a 2D imported svg shape that can be used in the above offset_sweep function? >> >> >> >> >> _______________________________________________ >> 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
JW
Joe Weinpert
Sat, Jan 15, 2022 2:20 AM

Yes, that is correct.  I looked closer and found the list is actually
wrapped in an extra pair of brackets, so using an index 0 array works fine.

On Fri, Jan 14, 2022, 8:11 PM Adrian Mariano avm4@cornell.edu wrote:

You don't give your point list, so I can only guess, but from the
error it appears maybe your point list is nested too deeply, like it's
a list of lists of points instead of just a list of points.  If my
guess is right then it would work if you did polygon(pts[0]).

On Fri, Jan 14, 2022 at 2:18 PM Joe Weinpert joe.weinpert@gmail.com
wrote:

When running the points_first_demo.scad demo:

include <pathbuilder.scad>
pb_petal = "m0 -1c-25-30 25-30 0,0 z";
$pb_spline=66;                                  //  We want 36 line

segments on each spline.

pts = svgPoints(pb_petal);                      //  Generate points list

for the svg path.

 //  Do your thing to the points here

for(a=[0:120:360]) rotate([0,15,a]) polygon(pts);

I get this error:

ERROR: Unable to convert points[0] = [[0, -1], [0, -1], [-1.08523,

-2.34298], [-2.07029, -3.64463], [-2.9583, -4.90496], [-3.7524, -6.12397],
[-4.45571, -7.30165], [-5.07137, -8.43802], [-5.60251, -9.53306],
[-6.05226, -10.5868], [-6.42374, -11.5992], [-6.72009, -12.5702],
[-6.94444, -13.5], [-7.09992, -14.3884], [-7.18967, -15.2355], [-7.2168,
-16.0413], [-7.18445, -16.8058], [-7.09575, -17.5289], [-6.95384,
-18.2107], [-6.76183, -18.8512], [-6.52287, -19.4504], [-6.24009,
-20.0083], [-5.9166, -20.5248], [-5.55556, -21], [-5.16007, -21.4339],
[-4.73328, -21.8264], [-4.27832, -22.1777], [-3.79831, -22.4876],
[-3.29639, -22.7562], [-2.77569, -22.9835], [-2.23934, -23.1694],
[-1.69046, -23.314], [-1.13219, -23.4174], [-0.56766, -23.4793], [0,
-23.5], [0.56766, -23.4793], [1.13219, -23.4174], [1.69046, -23.314],
[2.23934, -23.1694], [2.77569, -22.9835], [3.29639, -22.7562], [3.79831,
-22.4876], [4.27832, -22.1777], [4.73328, -21.8264], [5.16007, -21.4339],
[5.55556, -21], [5.9166, -20.5248], [6.24009, -20.0083], [6.52287,
-19.4504], [6.76183, -18.8512], [6.95384, -18.2107], [7.09575, -17.5289],
[7.18445, -16.8058], [7.2168, -16.0413], [7.18967, -15.2355], [7.09992,
-14.3884], [6.94444, -13.5], [6.72009, -12.5702], [6.42374, -11.5992],
[6.05226, -10.5868], [5.60251, -9.53306], [5.07137, -8.43802], [4.45571,
-7.30165], [3.7524, -6.12397], [2.9583, -4.90496], [2.07029, -3.64463],
[1.08523, -2.34298], [0, -1]] to a vec2 of numbers in file
points_first_demo.scad, line 7

Any ideas?

On Fri, Jan 14, 2022 at 12:02 AM Revar Desmera revarbat@gmail.com

wrote:

If you use the pathfinder library (

https://github.com/dinther/pathbuilder ) you should be able to take the
path from the SVG path element and use pathfinder to decode it into an
OpenSCAD path.  You can then pass that to BOSL2.

-Revar

On Jan 13, 2022, at 1:05 PM, Joe Weinpert joe.weinpert@gmail.com

wrote:


Been looking at the suggestions in using the BOSL2 mods and functions.

Ran through the "star" demo.

As to the odd shapes I referred to in a previous email, it was

suggested to use something like this:

include<BOSL2/std.scad>
include<BOSL2/rounding.scad>
shape = [[3,4],[10,10],...etc];  // Shape defined as list of (x,y)

coordinates, without repeating the first point.

offset_sweep(shape, height=1INCH, top=os_circle(r=1/4INCH));

Because I am importing pre-designed odd shapes (not generating them),

is there a way to generate a list of points from a 2D imported svg shape
that can be used in the above offset_sweep function?


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

Yes, that is correct. I looked closer and found the list is actually wrapped in an extra pair of brackets, so using an index 0 array works fine. On Fri, Jan 14, 2022, 8:11 PM Adrian Mariano <avm4@cornell.edu> wrote: > You don't give your point list, so I can only guess, but from the > error it appears maybe your point list is nested too deeply, like it's > a list of lists of points instead of just a list of points. If my > guess is right then it would work if you did polygon(pts[0]). > > On Fri, Jan 14, 2022 at 2:18 PM Joe Weinpert <joe.weinpert@gmail.com> > wrote: > > > > When running the points_first_demo.scad demo: > > > > include <pathbuilder.scad> > > pb_petal = "m0 -1c-25-30 25-30 0,0 z"; > > $pb_spline=66; // We want 36 line > segments on each spline. > > pts = svgPoints(pb_petal); // Generate points list > for the svg path. > > // Do your thing to the points here > > for(a=[0:120:360]) rotate([0,15,a]) polygon(pts); > > > > > > > > I get this error: > > > > ERROR: Unable to convert points[0] = [[0, -1], [0, -1], [-1.08523, > -2.34298], [-2.07029, -3.64463], [-2.9583, -4.90496], [-3.7524, -6.12397], > [-4.45571, -7.30165], [-5.07137, -8.43802], [-5.60251, -9.53306], > [-6.05226, -10.5868], [-6.42374, -11.5992], [-6.72009, -12.5702], > [-6.94444, -13.5], [-7.09992, -14.3884], [-7.18967, -15.2355], [-7.2168, > -16.0413], [-7.18445, -16.8058], [-7.09575, -17.5289], [-6.95384, > -18.2107], [-6.76183, -18.8512], [-6.52287, -19.4504], [-6.24009, > -20.0083], [-5.9166, -20.5248], [-5.55556, -21], [-5.16007, -21.4339], > [-4.73328, -21.8264], [-4.27832, -22.1777], [-3.79831, -22.4876], > [-3.29639, -22.7562], [-2.77569, -22.9835], [-2.23934, -23.1694], > [-1.69046, -23.314], [-1.13219, -23.4174], [-0.56766, -23.4793], [0, > -23.5], [0.56766, -23.4793], [1.13219, -23.4174], [1.69046, -23.314], > [2.23934, -23.1694], [2.77569, -22.9835], [3.29639, -22.7562], [3.79831, > -22.4876], [4.27832, -22.1777], [4.73328, -21.8264], [5.16007, -21.4339], > [5.55556, -21], [5.9166, -20.5248], [6.24009, -20.0083], [6.52287, > -19.4504], [6.76183, -18.8512], [6.95384, -18.2107], [7.09575, -17.5289], > [7.18445, -16.8058], [7.2168, -16.0413], [7.18967, -15.2355], [7.09992, > -14.3884], [6.94444, -13.5], [6.72009, -12.5702], [6.42374, -11.5992], > [6.05226, -10.5868], [5.60251, -9.53306], [5.07137, -8.43802], [4.45571, > -7.30165], [3.7524, -6.12397], [2.9583, -4.90496], [2.07029, -3.64463], > [1.08523, -2.34298], [0, -1]] to a vec2 of numbers in file > points_first_demo.scad, line 7 > > > > > > > > Any ideas? > > > > > > > > > > On Fri, Jan 14, 2022 at 12:02 AM Revar Desmera <revarbat@gmail.com> > wrote: > >> > >> If you use the pathfinder library ( > https://github.com/dinther/pathbuilder ) you should be able to take the > path from the SVG path element and use pathfinder to decode it into an > OpenSCAD path. You can then pass that to BOSL2. > >> > >> -Revar > >> > >> > >> On Jan 13, 2022, at 1:05 PM, Joe Weinpert <joe.weinpert@gmail.com> > wrote: > >> > >>  > >> Been looking at the suggestions in using the BOSL2 mods and functions. > Ran through the "star" demo. > >> > >> As to the odd shapes I referred to in a previous email, it was > suggested to use something like this: > >> > >> include<BOSL2/std.scad> > >> include<BOSL2/rounding.scad> > >> shape = [[3,4],[10,10],...etc]; // Shape defined as list of (x,y) > coordinates, without repeating the first point. > >> offset_sweep(shape, height=1*INCH, top=os_circle(r=1/4*INCH)); > >> > >> > >> Because I am importing pre-designed odd shapes (not generating them), > is there a way to generate a list of points from a 2D imported svg shape > that can be used in the above offset_sweep function? > >> > >> > >> > >> > >> _______________________________________________ > >> 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 >
AM
Adrian Mariano
Sat, Jan 15, 2022 2:37 AM

My guess is that sometimes the SVG may contain more than one polygon,
and then there will be several pieces, hence multiple point lists are
needed.

On Fri, Jan 14, 2022 at 9:21 PM Joe Weinpert joe.weinpert@gmail.com wrote:

Yes, that is correct.  I looked closer and found the list is actually wrapped in an extra pair of brackets, so using an index 0 array works fine.

On Fri, Jan 14, 2022, 8:11 PM Adrian Mariano avm4@cornell.edu wrote:

You don't give your point list, so I can only guess, but from the
error it appears maybe your point list is nested too deeply, like it's
a list of lists of points instead of just a list of points.  If my
guess is right then it would work if you did polygon(pts[0]).

On Fri, Jan 14, 2022 at 2:18 PM Joe Weinpert joe.weinpert@gmail.com wrote:

When running the points_first_demo.scad demo:

include <pathbuilder.scad>
pb_petal = "m0 -1c-25-30 25-30 0,0 z";
$pb_spline=66;                                  //  We want 36 line segments on each spline.
pts = svgPoints(pb_petal);                      //  Generate points list for the svg path.
//  Do your thing to the points here
for(a=[0:120:360]) rotate([0,15,a]) polygon(pts);

I get this error:

ERROR: Unable to convert points[0] = [[0, -1], [0, -1], [-1.08523, -2.34298], [-2.07029, -3.64463], [-2.9583, -4.90496], [-3.7524, -6.12397], [-4.45571, -7.30165], [-5.07137, -8.43802], [-5.60251, -9.53306], [-6.05226, -10.5868], [-6.42374, -11.5992], [-6.72009, -12.5702], [-6.94444, -13.5], [-7.09992, -14.3884], [-7.18967, -15.2355], [-7.2168, -16.0413], [-7.18445, -16.8058], [-7.09575, -17.5289], [-6.95384, -18.2107], [-6.76183, -18.8512], [-6.52287, -19.4504], [-6.24009, -20.0083], [-5.9166, -20.5248], [-5.55556, -21], [-5.16007, -21.4339], [-4.73328, -21.8264], [-4.27832, -22.1777], [-3.79831, -22.4876], [-3.29639, -22.7562], [-2.77569, -22.9835], [-2.23934, -23.1694], [-1.69046, -23.314], [-1.13219, -23.4174], [-0.56766, -23.4793], [0, -23.5], [0.56766, -23.4793], [1.13219, -23.4174], [1.69046, -23.314], [2.23934, -23.1694], [2.77569, -22.9835], [3.29639, -22.7562], [3.79831, -22.4876], [4.27832, -22.1777], [4.73328, -21.8264], [5.16007, -21.4339], [5.55556, -21], [5.9166, -20.5248], [6.24009, -20.0083], [6.52287, -19.4504], [6.76183, -18.8512], [6.95384, -18.2107], [7.09575, -17.5289], [7.18445, -16.8058], [7.2168, -16.0413], [7.18967, -15.2355], [7.09992, -14.3884], [6.94444, -13.5], [6.72009, -12.5702], [6.42374, -11.5992], [6.05226, -10.5868], [5.60251, -9.53306], [5.07137, -8.43802], [4.45571, -7.30165], [3.7524, -6.12397], [2.9583, -4.90496], [2.07029, -3.64463], [1.08523, -2.34298], [0, -1]] to a vec2 of numbers in file points_first_demo.scad, line 7

Any ideas?

On Fri, Jan 14, 2022 at 12:02 AM Revar Desmera revarbat@gmail.com wrote:

If you use the pathfinder library ( https://github.com/dinther/pathbuilder ) you should be able to take the path from the SVG path element and use pathfinder to decode it into an OpenSCAD path.  You can then pass that to BOSL2.

-Revar

On Jan 13, 2022, at 1:05 PM, Joe Weinpert joe.weinpert@gmail.com wrote:


Been looking at the suggestions in using the BOSL2 mods and functions.  Ran through the "star" demo.

As to the odd shapes I referred to in a previous email, it was suggested to use something like this:

include<BOSL2/std.scad>
include<BOSL2/rounding.scad>
shape = [[3,4],[10,10],...etc];  // Shape defined as list of (x,y) coordinates, without repeating the first point.
offset_sweep(shape, height=1INCH, top=os_circle(r=1/4INCH));

Because I am importing pre-designed odd shapes (not generating them), is there a way to generate a list of points from a 2D imported svg shape that can be used in the above offset_sweep function?


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

My guess is that sometimes the SVG may contain more than one polygon, and then there will be several pieces, hence multiple point lists are needed. On Fri, Jan 14, 2022 at 9:21 PM Joe Weinpert <joe.weinpert@gmail.com> wrote: > > Yes, that is correct. I looked closer and found the list is actually wrapped in an extra pair of brackets, so using an index 0 array works fine. > > On Fri, Jan 14, 2022, 8:11 PM Adrian Mariano <avm4@cornell.edu> wrote: >> >> You don't give your point list, so I can only guess, but from the >> error it appears maybe your point list is nested too deeply, like it's >> a list of lists of points instead of just a list of points. If my >> guess is right then it would work if you did polygon(pts[0]). >> >> On Fri, Jan 14, 2022 at 2:18 PM Joe Weinpert <joe.weinpert@gmail.com> wrote: >> > >> > When running the points_first_demo.scad demo: >> > >> > include <pathbuilder.scad> >> > pb_petal = "m0 -1c-25-30 25-30 0,0 z"; >> > $pb_spline=66; // We want 36 line segments on each spline. >> > pts = svgPoints(pb_petal); // Generate points list for the svg path. >> > // Do your thing to the points here >> > for(a=[0:120:360]) rotate([0,15,a]) polygon(pts); >> > >> > >> > >> > I get this error: >> > >> > ERROR: Unable to convert points[0] = [[0, -1], [0, -1], [-1.08523, -2.34298], [-2.07029, -3.64463], [-2.9583, -4.90496], [-3.7524, -6.12397], [-4.45571, -7.30165], [-5.07137, -8.43802], [-5.60251, -9.53306], [-6.05226, -10.5868], [-6.42374, -11.5992], [-6.72009, -12.5702], [-6.94444, -13.5], [-7.09992, -14.3884], [-7.18967, -15.2355], [-7.2168, -16.0413], [-7.18445, -16.8058], [-7.09575, -17.5289], [-6.95384, -18.2107], [-6.76183, -18.8512], [-6.52287, -19.4504], [-6.24009, -20.0083], [-5.9166, -20.5248], [-5.55556, -21], [-5.16007, -21.4339], [-4.73328, -21.8264], [-4.27832, -22.1777], [-3.79831, -22.4876], [-3.29639, -22.7562], [-2.77569, -22.9835], [-2.23934, -23.1694], [-1.69046, -23.314], [-1.13219, -23.4174], [-0.56766, -23.4793], [0, -23.5], [0.56766, -23.4793], [1.13219, -23.4174], [1.69046, -23.314], [2.23934, -23.1694], [2.77569, -22.9835], [3.29639, -22.7562], [3.79831, -22.4876], [4.27832, -22.1777], [4.73328, -21.8264], [5.16007, -21.4339], [5.55556, -21], [5.9166, -20.5248], [6.24009, -20.0083], [6.52287, -19.4504], [6.76183, -18.8512], [6.95384, -18.2107], [7.09575, -17.5289], [7.18445, -16.8058], [7.2168, -16.0413], [7.18967, -15.2355], [7.09992, -14.3884], [6.94444, -13.5], [6.72009, -12.5702], [6.42374, -11.5992], [6.05226, -10.5868], [5.60251, -9.53306], [5.07137, -8.43802], [4.45571, -7.30165], [3.7524, -6.12397], [2.9583, -4.90496], [2.07029, -3.64463], [1.08523, -2.34298], [0, -1]] to a vec2 of numbers in file points_first_demo.scad, line 7 >> > >> > >> > >> > Any ideas? >> > >> > >> > >> > >> > On Fri, Jan 14, 2022 at 12:02 AM Revar Desmera <revarbat@gmail.com> wrote: >> >> >> >> If you use the pathfinder library ( https://github.com/dinther/pathbuilder ) you should be able to take the path from the SVG path element and use pathfinder to decode it into an OpenSCAD path. You can then pass that to BOSL2. >> >> >> >> -Revar >> >> >> >> >> >> On Jan 13, 2022, at 1:05 PM, Joe Weinpert <joe.weinpert@gmail.com> wrote: >> >> >> >>  >> >> Been looking at the suggestions in using the BOSL2 mods and functions. Ran through the "star" demo. >> >> >> >> As to the odd shapes I referred to in a previous email, it was suggested to use something like this: >> >> >> >> include<BOSL2/std.scad> >> >> include<BOSL2/rounding.scad> >> >> shape = [[3,4],[10,10],...etc]; // Shape defined as list of (x,y) coordinates, without repeating the first point. >> >> offset_sweep(shape, height=1*INCH, top=os_circle(r=1/4*INCH)); >> >> >> >> >> >> Because I am importing pre-designed odd shapes (not generating them), is there a way to generate a list of points from a 2D imported svg shape that can be used in the above offset_sweep function? >> >> >> >> >> >> >> >> >> >> _______________________________________________ >> >> 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
JW
Joe Weinpert
Sat, Jan 15, 2022 3:15 AM

Ah ... very good point.

On Fri, Jan 14, 2022, 9:38 PM Adrian Mariano avm4@cornell.edu wrote:

My guess is that sometimes the SVG may contain more than one polygon,
and then there will be several pieces, hence multiple point lists are
needed.

On Fri, Jan 14, 2022 at 9:21 PM Joe Weinpert joe.weinpert@gmail.com
wrote:

Yes, that is correct.  I looked closer and found the list is actually

wrapped in an extra pair of brackets, so using an index 0 array works fine.

On Fri, Jan 14, 2022, 8:11 PM Adrian Mariano avm4@cornell.edu wrote:

You don't give your point list, so I can only guess, but from the
error it appears maybe your point list is nested too deeply, like it's
a list of lists of points instead of just a list of points.  If my
guess is right then it would work if you did polygon(pts[0]).

On Fri, Jan 14, 2022 at 2:18 PM Joe Weinpert joe.weinpert@gmail.com

wrote:

When running the points_first_demo.scad demo:

include <pathbuilder.scad>
pb_petal = "m0 -1c-25-30 25-30 0,0 z";
$pb_spline=66;                                  //  We want 36 line

segments on each spline.

pts = svgPoints(pb_petal);                      //  Generate points

list for the svg path.

 //  Do your thing to the points here

for(a=[0:120:360]) rotate([0,15,a]) polygon(pts);

I get this error:

ERROR: Unable to convert points[0] = [[0, -1], [0, -1], [-1.08523,

-2.34298], [-2.07029, -3.64463], [-2.9583, -4.90496], [-3.7524, -6.12397],
[-4.45571, -7.30165], [-5.07137, -8.43802], [-5.60251, -9.53306],
[-6.05226, -10.5868], [-6.42374, -11.5992], [-6.72009, -12.5702],
[-6.94444, -13.5], [-7.09992, -14.3884], [-7.18967, -15.2355], [-7.2168,
-16.0413], [-7.18445, -16.8058], [-7.09575, -17.5289], [-6.95384,
-18.2107], [-6.76183, -18.8512], [-6.52287, -19.4504], [-6.24009,
-20.0083], [-5.9166, -20.5248], [-5.55556, -21], [-5.16007, -21.4339],
[-4.73328, -21.8264], [-4.27832, -22.1777], [-3.79831, -22.4876],
[-3.29639, -22.7562], [-2.77569, -22.9835], [-2.23934, -23.1694],
[-1.69046, -23.314], [-1.13219, -23.4174], [-0.56766, -23.4793], [0,
-23.5], [0.56766, -23.4793], [1.13219, -23.4174], [1.69046, -23.314],
[2.23934, -23.1694], [2.77569, -22.9835], [3.29639, -22.7562], [3.79831,
-22.4876], [4.27832, -22.1777], [4.73328, -21.8264], [5.16007, -21.4339],
[5.55556, -21], [5.9166, -20.5248], [6.24009, -20.0083], [6.52287,
-19.4504], [6.76183, -18.8512], [6.95384, -18.2107], [7.09575, -17.5289],
[7.18445, -16.8058], [7.2168, -16.0413], [7.18967, -15.2355], [7.09992,
-14.3884], [6.94444, -13.5], [6.72009, -12.5702], [6.42374, -11.5992],
[6.05226, -10.5868], [5.60251, -9.53306], [5.07137, -8.43802], [4.45571,
-7.30165], [3.7524, -6.12397], [2.9583, -4.90496], [2.07029, -3.64463],
[1.08523, -2.34298], [0, -1]] to a vec2 of numbers in file
points_first_demo.scad, line 7

Any ideas?

On Fri, Jan 14, 2022 at 12:02 AM Revar Desmera revarbat@gmail.com

wrote:

If you use the pathfinder library (

https://github.com/dinther/pathbuilder ) you should be able to take the
path from the SVG path element and use pathfinder to decode it into an
OpenSCAD path.  You can then pass that to BOSL2.

-Revar

On Jan 13, 2022, at 1:05 PM, Joe Weinpert joe.weinpert@gmail.com

wrote:


Been looking at the suggestions in using the BOSL2 mods and

functions.  Ran through the "star" demo.

As to the odd shapes I referred to in a previous email, it was

suggested to use something like this:

include<BOSL2/std.scad>
include<BOSL2/rounding.scad>
shape = [[3,4],[10,10],...etc];  // Shape defined as list of (x,y)

coordinates, without repeating the first point.

offset_sweep(shape, height=1INCH, top=os_circle(r=1/4INCH));

Because I am importing pre-designed odd shapes (not generating

them), is there a way to generate a list of points from a 2D imported svg
shape that can be used in the above offset_sweep function?


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


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Ah ... very good point. On Fri, Jan 14, 2022, 9:38 PM Adrian Mariano <avm4@cornell.edu> wrote: > My guess is that sometimes the SVG may contain more than one polygon, > and then there will be several pieces, hence multiple point lists are > needed. > > On Fri, Jan 14, 2022 at 9:21 PM Joe Weinpert <joe.weinpert@gmail.com> > wrote: > > > > Yes, that is correct. I looked closer and found the list is actually > wrapped in an extra pair of brackets, so using an index 0 array works fine. > > > > On Fri, Jan 14, 2022, 8:11 PM Adrian Mariano <avm4@cornell.edu> wrote: > >> > >> You don't give your point list, so I can only guess, but from the > >> error it appears maybe your point list is nested too deeply, like it's > >> a list of lists of points instead of just a list of points. If my > >> guess is right then it would work if you did polygon(pts[0]). > >> > >> On Fri, Jan 14, 2022 at 2:18 PM Joe Weinpert <joe.weinpert@gmail.com> > wrote: > >> > > >> > When running the points_first_demo.scad demo: > >> > > >> > include <pathbuilder.scad> > >> > pb_petal = "m0 -1c-25-30 25-30 0,0 z"; > >> > $pb_spline=66; // We want 36 line > segments on each spline. > >> > pts = svgPoints(pb_petal); // Generate points > list for the svg path. > >> > // Do your thing to the points here > >> > for(a=[0:120:360]) rotate([0,15,a]) polygon(pts); > >> > > >> > > >> > > >> > I get this error: > >> > > >> > ERROR: Unable to convert points[0] = [[0, -1], [0, -1], [-1.08523, > -2.34298], [-2.07029, -3.64463], [-2.9583, -4.90496], [-3.7524, -6.12397], > [-4.45571, -7.30165], [-5.07137, -8.43802], [-5.60251, -9.53306], > [-6.05226, -10.5868], [-6.42374, -11.5992], [-6.72009, -12.5702], > [-6.94444, -13.5], [-7.09992, -14.3884], [-7.18967, -15.2355], [-7.2168, > -16.0413], [-7.18445, -16.8058], [-7.09575, -17.5289], [-6.95384, > -18.2107], [-6.76183, -18.8512], [-6.52287, -19.4504], [-6.24009, > -20.0083], [-5.9166, -20.5248], [-5.55556, -21], [-5.16007, -21.4339], > [-4.73328, -21.8264], [-4.27832, -22.1777], [-3.79831, -22.4876], > [-3.29639, -22.7562], [-2.77569, -22.9835], [-2.23934, -23.1694], > [-1.69046, -23.314], [-1.13219, -23.4174], [-0.56766, -23.4793], [0, > -23.5], [0.56766, -23.4793], [1.13219, -23.4174], [1.69046, -23.314], > [2.23934, -23.1694], [2.77569, -22.9835], [3.29639, -22.7562], [3.79831, > -22.4876], [4.27832, -22.1777], [4.73328, -21.8264], [5.16007, -21.4339], > [5.55556, -21], [5.9166, -20.5248], [6.24009, -20.0083], [6.52287, > -19.4504], [6.76183, -18.8512], [6.95384, -18.2107], [7.09575, -17.5289], > [7.18445, -16.8058], [7.2168, -16.0413], [7.18967, -15.2355], [7.09992, > -14.3884], [6.94444, -13.5], [6.72009, -12.5702], [6.42374, -11.5992], > [6.05226, -10.5868], [5.60251, -9.53306], [5.07137, -8.43802], [4.45571, > -7.30165], [3.7524, -6.12397], [2.9583, -4.90496], [2.07029, -3.64463], > [1.08523, -2.34298], [0, -1]] to a vec2 of numbers in file > points_first_demo.scad, line 7 > >> > > >> > > >> > > >> > Any ideas? > >> > > >> > > >> > > >> > > >> > On Fri, Jan 14, 2022 at 12:02 AM Revar Desmera <revarbat@gmail.com> > wrote: > >> >> > >> >> If you use the pathfinder library ( > https://github.com/dinther/pathbuilder ) you should be able to take the > path from the SVG path element and use pathfinder to decode it into an > OpenSCAD path. You can then pass that to BOSL2. > >> >> > >> >> -Revar > >> >> > >> >> > >> >> On Jan 13, 2022, at 1:05 PM, Joe Weinpert <joe.weinpert@gmail.com> > wrote: > >> >> > >> >>  > >> >> Been looking at the suggestions in using the BOSL2 mods and > functions. Ran through the "star" demo. > >> >> > >> >> As to the odd shapes I referred to in a previous email, it was > suggested to use something like this: > >> >> > >> >> include<BOSL2/std.scad> > >> >> include<BOSL2/rounding.scad> > >> >> shape = [[3,4],[10,10],...etc]; // Shape defined as list of (x,y) > coordinates, without repeating the first point. > >> >> offset_sweep(shape, height=1*INCH, top=os_circle(r=1/4*INCH)); > >> >> > >> >> > >> >> Because I am importing pre-designed odd shapes (not generating > them), is there a way to generate a list of points from a 2D imported svg > shape that can be used in the above offset_sweep function? > >> >> > >> >> > >> >> > >> >> > >> >> _______________________________________________ > >> >> 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 > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >