discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

New forum member, extruding along path

G
gasstationwithoutpumps
Tue, Jul 30, 2019 12:24 AM

Hi, I'm new to the OpenSCAD forum, but I've been using OpenSCAD for about a
year (you can see a few of my rather simple designs at
https://www.thingiverse.com/gasstationwithoutpumps/things
https://www.thingiverse.com/gasstationwithoutpumps/things  ), with more
discussion of them and some unreleased design on my blog at
https://gasstationwithoutpumps.wordpress.com
https://gasstationwithoutpumps.wordpress.com  ).I came to this forum
looking for information on how to do something that I see as one of the
biggest holes in OpenSCAD: extruding along an arbitrary path.  I found out
about sweep.scad in the  list comprehension demos
https://github.com/openscad/list-comprehension-demos  , which provides a
somewhat klugey workaround—I have to have a polygon and a polygonal path
expressed as arrays of points (perhaps with an additional array of
orientation vectors), but what I wanted to start with was an SVG file with a
cross-section and an SVG file of the paths.Unfortunately, OpenSCAD can
convert arrays to geometry, but then provides no way to extract the arrays
again from the geometry.  So I can import SVG into OpenSCAD, but not use the
resulting imported objects as either the cross-sectional profile or as the
path.  One of the biggest things on my wish list is a way to get arrays of
points from objects.I found another link to an inkscape plug-in,
https://www.thingiverse.com/thing:2805184
https://www.thingiverse.com/thing:2805184  , that converts SVG files to
arrays of Bézier curves, which almost completes the task.After playing
around with both, I found some minor bugs:The definition of "cap" in
sweep_polyhedron relied on a test of len(caps), which is not acceptable to
the 2019-05 release.  I changed it to
cap    =  (closed || caps==[]) ? [false,false]:
(caps==true || caps==false)?      [caps,caps] :
(len(caps)==1) ?        [caps[0], caps[0]] :                    inv ?
[caps[1], caps[0]] :                                            [caps[0],
caps[1]]
removing the error message.  There are several other places in the list
comprehension demo code where similar tests relying on len(non_list) being
legal and returning undef are used, but that "feature" seems to have been
deprecated.For the inkscape plugin, I ran into two problems:
One was that a group scaling in my SVG file got applied twice so that the
cross-sectional profile was 96/25.4 times larger that it should have been.
Luckily this could be compensated for by scaling the output arrray, and
OpenScad makes multiplying an array by a constant easy.
A bigger annoyance was that the output created a polygon for each path in
the SVG file, when many of the paths were open paths.  I had to edit the
output code to make functions that returned the bezier_coordinates for each
array of points, rather than making a union of the bezier_polygons in a
module.  Then I could use the points (with to_3d() and
referenced_path_transforms()) to do a sweep.I'd like for the Inkscape plugin
to create those functions for me, so I can just "use" the output .scad file
without having to edit it.
I managed to get everything sort of working, but I still have some minor
problems:
If the number of steps in bezier_coordinates() is too high, then the tangent
computations at the end of the path end up producing "undef", and an ugly
artifact is created at the end of the path.  I think that this may be
related to OpenSCAD rounding to a coarse grid, so that multiple points in a
row are identical and the tangent is indeed undefined.  I fixed this problem
by keeping the number of steps small (6 was ok, 10 was too many for the
curves I was using).
The CGAL interpretation failed, probably because the tubes produced by the
sweep were not capped, and I had not buried the ends of all of them in other
geometry.  I can probably fix this by more careful placement of the end
points.
I would like to thank the creators of the list comprehension demos and the
Inkscape plugin, because I certainly would not have had the patience to
create them myself.  I hope that sometime soon extruding along a path
becomes a built-in to OpenSCAD, and that the language is extended so that
paths can be turned into arrays of points.


gasstationwithoutpumps.wordpress.com
www.thingiverse.com/gasstationwithoutpumps/things

Sent from: http://forum.openscad.org/

Hi, I'm new to the OpenSCAD forum, but I've been using OpenSCAD for about a year (you can see a few of my rather simple designs at https://www.thingiverse.com/gasstationwithoutpumps/things <https://www.thingiverse.com/gasstationwithoutpumps/things> ), with more discussion of them and some unreleased design on my blog at https://gasstationwithoutpumps.wordpress.com <https://gasstationwithoutpumps.wordpress.com> ).I came to this forum looking for information on how to do something that I see as one of the biggest holes in OpenSCAD: extruding along an arbitrary path. I found out about sweep.scad in the list comprehension demos <https://github.com/openscad/list-comprehension-demos> , which provides a somewhat klugey workaround—I have to have a polygon and a polygonal path expressed as arrays of points (perhaps with an additional array of orientation vectors), but what I wanted to start with was an SVG file with a cross-section and an SVG file of the paths.Unfortunately, OpenSCAD can convert arrays to geometry, but then provides no way to extract the arrays again from the geometry. So I can import SVG into OpenSCAD, but not use the resulting imported objects as either the cross-sectional profile or as the path. One of the biggest things on my wish list is a way to get arrays of points from objects.I found another link to an inkscape plug-in, https://www.thingiverse.com/thing:2805184 <https://www.thingiverse.com/thing:2805184> , that converts SVG files to arrays of Bézier curves, which almost completes the task.After playing around with both, I found some minor bugs:The definition of "cap" in sweep_polyhedron relied on a test of len(caps), which is not acceptable to the 2019-05 release. I changed it to cap = (closed || caps==[]) ? [false,false]: (caps==true || caps==false)? [caps,caps] : (len(caps)==1) ? [caps[0], caps[0]] : inv ? [caps[1], caps[0]] : [caps[0], caps[1]] removing the error message. There are several other places in the list comprehension demo code where similar tests relying on len(non_list) being legal and returning undef are used, but that "feature" seems to have been deprecated.For the inkscape plugin, I ran into two problems: One was that a group scaling in my SVG file got applied twice so that the cross-sectional profile was 96/25.4 times larger that it should have been. Luckily this could be compensated for by scaling the output arrray, and OpenScad makes multiplying an array by a constant easy. A bigger annoyance was that the output created a polygon for each path in the SVG file, when many of the paths were open paths. I had to edit the output code to make functions that returned the bezier_coordinates for each array of points, rather than making a union of the bezier_polygons in a module. Then I could use the points (with to_3d() and referenced_path_transforms()) to do a sweep.I'd like for the Inkscape plugin to create those functions for me, so I can just "use" the output .scad file without having to edit it. I managed to get everything sort of working, but I still have some minor problems: If the number of steps in bezier_coordinates() is too high, then the tangent computations at the end of the path end up producing "undef", and an ugly artifact is created at the end of the path. I think that this may be related to OpenSCAD rounding to a coarse grid, so that multiple points in a row are identical and the tangent is indeed undefined. I fixed this problem by keeping the number of steps small (6 was ok, 10 was too many for the curves I was using). The CGAL interpretation failed, probably because the tubes produced by the sweep were not capped, and I had not buried the ends of all of them in other geometry. I can probably fix this by more careful placement of the end points. I would like to thank the creators of the list comprehension demos and the Inkscape plugin, because I certainly would not have had the patience to create them myself. I hope that sometime soon extruding along a path becomes a built-in to OpenSCAD, and that the language is extended so that paths can be turned into arrays of points. ----- gasstationwithoutpumps.wordpress.com www.thingiverse.com/gasstationwithoutpumps/things -- Sent from: http://forum.openscad.org/
C
cgriffith
Fri, Aug 2, 2019 12:05 PM

I think I do something similar to what your asking.  I make cookie cutters
for my wife.  The outline of cookie cutter is created as SVG in inkscape.  I
use the inkscape extension from  https://www.thingiverse.com/thing:2805184
https://www.thingiverse.com/thing:2805184  to convert SVG to bezier
points in scad file.  Then I created a custom SVG in inkscape that is the
profile of the cutter; pulled into scad file as another bezier path.
Finally, I use the  BOSL https://github.com/revarbat/BOSL/wiki  library's
extrude_2d_shapes_along_bezier
https://github.com/revarbat/BOSL/wiki/beziers.scad#extrude_2d_shapes_along_bezier
.  It takes lots of tweeking, but I end up with my profile extruded along
the shape of the cookie cutter.  Let me know if you need more details.

--
Sent from: http://forum.openscad.org/

I think I do something similar to what your asking. I make cookie cutters for my wife. The outline of cookie cutter is created as SVG in inkscape. I use the inkscape extension from https://www.thingiverse.com/thing:2805184 <https://www.thingiverse.com/thing:2805184> to convert SVG to bezier points in scad file. Then I created a custom SVG in inkscape that is the profile of the cutter; pulled into scad file as another bezier path. Finally, I use the BOSL <https://github.com/revarbat/BOSL/wiki> library's extrude_2d_shapes_along_bezier <https://github.com/revarbat/BOSL/wiki/beziers.scad#extrude_2d_shapes_along_bezier> . It takes lots of tweeking, but I end up with my profile extruded along the shape of the cookie cutter. Let me know if you need more details. -- Sent from: http://forum.openscad.org/
G
gasstationwithoutpumps
Sat, Aug 3, 2019 6:47 AM

cgriffith wrote

I think I do something similar to what your asking.  I make cookie cutters
for my wife.  The outline of cookie cutter is created as SVG in inkscape.
I
use the inkscape extension from  https://www.thingiverse.com/thing:2805184
<https://www.thingiverse.com/thing:2805184>  to convert SVG to
bezier
points in scad file.  Then I created a custom SVG in inkscape that is the
profile of the cutter; pulled into scad file as another bezier path.
Finally, I use the  BOSL <https://github.com/revarbat/BOSL/wiki>
library's
extrude_2d_shapes_along_bezier
<https://github.com/revarbat/BOSL/wiki/beziers.scad#extrude_2d_shapes_along_bezier>
.  It takes lots of tweeking, but I end up with my profile extruded along
the shape of the cookie cutter.  Let me know if you need more details.

I am also trying to do cookie cutters.
I tried using the extrude_bezier_along_bezier from the BOSL/beziers.scad
library, but it does not seem to provide any way to control the orientation
of the profile, which seems to twist in arbitrary directions—I had better
luck with the list-comprehension-demos sweep, which has
referenced_path_transforms, where I could get things that previewed almost
right, but got assertion errors from CGAL.

How did you control the orientation of the profile?


gasstationwithoutpumps.wordpress.com
www.thingiverse.com/gasstationwithoutpumps/things

Sent from: http://forum.openscad.org/

cgriffith wrote > I think I do something similar to what your asking. I make cookie cutters > for my wife. The outline of cookie cutter is created as SVG in inkscape. > I > use the inkscape extension from https://www.thingiverse.com/thing:2805184 > &lt;https://www.thingiverse.com/thing:2805184&gt; to convert SVG to > bezier > points in scad file. Then I created a custom SVG in inkscape that is the > profile of the cutter; pulled into scad file as another bezier path. > Finally, I use the BOSL &lt;https://github.com/revarbat/BOSL/wiki&gt; > library's > extrude_2d_shapes_along_bezier > &lt;https://github.com/revarbat/BOSL/wiki/beziers.scad#extrude_2d_shapes_along_bezier&gt; > . It takes lots of tweeking, but I end up with my profile extruded along > the shape of the cookie cutter. Let me know if you need more details. I am also trying to do cookie cutters. I tried using the extrude_bezier_along_bezier from the BOSL/beziers.scad library, but it does not seem to provide any way to control the orientation of the profile, which seems to twist in arbitrary directions—I had better luck with the list-comprehension-demos sweep, which has referenced_path_transforms, where I could get things that previewed almost right, but got assertion errors from CGAL. How did you control the orientation of the profile? ----- gasstationwithoutpumps.wordpress.com www.thingiverse.com/gasstationwithoutpumps/things -- Sent from: http://forum.openscad.org/
TP
Torsten Paul
Sat, Aug 3, 2019 12:16 PM

Here's my simple take on cookie cutters. The examples are
just geometry, but the star() and heart() can be easily
replaced with an import("shape.svg").

$fa = 4;
$fs = .5;

height = 12;

module heart(w = 30) {
translate([0, w * sqrt(2) / 2]) {
rotate(-135) {
square(w);
translate([w / 2, 0]) circle(d = w);
translate([0, w / 2]) circle(d = w);
}
}
}

module star(n = 5, r1 = 22, r2 = 40) {
function r(a) = a % 2 == 0 ? r2 : r1;
function p(a) = [ -sin(a), cos(a) ];

assert(n >= 3);
points = [ for (a = [0 : 2 * n - 1]) r(a) * p(180 / n * a) ];
polygon(points);

}

module outline() {
difference() {
offset(0.01) children();
children();
}
}

module cut(height, base_height, r1, r2) {
translate([0, 0, -base_height]) cylinder(r = 2 * r1, h = base_height);
translate([0, 0, -0.01]) cylinder(r1 = r1, r2 = r2, h = height);
}

module cookie_cutter(height = 12, base_height = 1, r1 = 0.8, r2 = 0.2) {
minkowski() {
linear_extrude(0.01) outline() children();
cut(height, base_height, r1, r2);
}
}

cookie_cutter() star(5, 22, 40);
//cookie_cutter(r1 = 1.2, r2 = 0.6) star(5, 30, 52);
//cookie_cutter(height = 15, r1 = 1.2, r2 = 0.4) star(5, 22, 40);

//cookie_cutter() heart(30);

Here's my simple take on cookie cutters. The examples are just geometry, but the star() and heart() can be easily replaced with an import("shape.svg"). $fa = 4; $fs = .5; height = 12; module heart(w = 30) { translate([0, w * sqrt(2) / 2]) { rotate(-135) { square(w); translate([w / 2, 0]) circle(d = w); translate([0, w / 2]) circle(d = w); } } } module star(n = 5, r1 = 22, r2 = 40) { function r(a) = a % 2 == 0 ? r2 : r1; function p(a) = [ -sin(a), cos(a) ]; assert(n >= 3); points = [ for (a = [0 : 2 * n - 1]) r(a) * p(180 / n * a) ]; polygon(points); } module outline() { difference() { offset(0.01) children(); children(); } } module cut(height, base_height, r1, r2) { translate([0, 0, -base_height]) cylinder(r = 2 * r1, h = base_height); translate([0, 0, -0.01]) cylinder(r1 = r1, r2 = r2, h = height); } module cookie_cutter(height = 12, base_height = 1, r1 = 0.8, r2 = 0.2) { minkowski() { linear_extrude(0.01) outline() children(); cut(height, base_height, r1, r2); } } cookie_cutter() star(5, 22, 40); //cookie_cutter(r1 = 1.2, r2 = 0.6) star(5, 30, 52); //cookie_cutter(height = 15, r1 = 1.2, r2 = 0.4) star(5, 22, 40); //cookie_cutter() heart(30);
A
adrianv
Sat, Aug 3, 2019 1:44 PM

What is the cookie cutter shape you need to produce that makes this task
tricky?  (Or to put it another way, why isn't the posted example good
enough?)

I wonder if the CGAL assertion errors might be occurring due to self
intersection of the polyhedron generated by sweep().  If I'm imagining your
method correctly, that seems especially likely if your cookie cutter has
corners.  Depending on what you're trying to do, exactly, my rounded_sweep()
function might do what you want more easily.  It will handle corners without
trouble.  It extrudes a path with offsets from the original path, and you
can supply your own list of offsets (the "custom" option).  It's included
in BOSL2, but if you explain the cookie cutter problem a little better, I
might try a test of my own.

--
Sent from: http://forum.openscad.org/

What is the cookie cutter shape you need to produce that makes this task tricky? (Or to put it another way, why isn't the posted example good enough?) I wonder if the CGAL assertion errors might be occurring due to self intersection of the polyhedron generated by sweep(). If I'm imagining your method correctly, that seems especially likely if your cookie cutter has corners. Depending on what you're trying to do, exactly, my rounded_sweep() function might do what you want more easily. It will handle corners without trouble. It extrudes a path with offsets from the original path, and you can supply your own list of offsets (the "custom" option). It's included in BOSL2, but if you explain the cookie cutter problem a little better, I might try a test of my own. -- Sent from: http://forum.openscad.org/
C
cgriffith
Sun, Aug 4, 2019 4:32 AM

@gasstationwithoutpumps

See where I say, "It takes lots of tweeking..."  Issues like what you
mention are that tweeking part.  Other issues I have to deal with are that
the output of inkscape bezier extension uses a path format of [[start_pt1,
ctr_pt1, ctr_pt2, end_pt1], [start_pt2, ctr_pt3, ctr_pt4, end_pt2]].  So I
have to convert that to what BOSL lib expects which is [start_pt, ctr_pt1,
ctr_pt2, end_pt1, ctr_pt3, ctr_pt4, ...]  I have used both
extrude_bezier_along_bezier and extrude_2d_shapes_along_bezier.  I first
rotate or flip the profile path around z axis arbitrary amounts till it
comes out correctly.  Once I get a reliable workflow, I plan to modify the
inkscape extension to write it all out the way I want it.

@adrianv and tp3,

I think it just boils down to me wanting to be a PITA about the cutting
profile.  I wanted to create a profile that is straight up and down on the
inside of the cutter, but gradually slope from thin cutting edge at top say
1.2mm to 6-8 mm pressing handle at bottom.  The only way I could figure to
do that was to create the profile as bezier path;
http://forum.openscad.org/file/t2599/cutter_profile.jpg .  None of the
online examples came close to doing this.

--
Sent from: http://forum.openscad.org/

@gasstationwithoutpumps See where I say, "It takes lots of tweeking..." Issues like what you mention are that tweeking part. Other issues I have to deal with are that the output of inkscape bezier extension uses a path format of [[start_pt1, ctr_pt1, ctr_pt2, end_pt1], [start_pt2, ctr_pt3, ctr_pt4, end_pt2]]. So I have to convert that to what BOSL lib expects which is [start_pt, ctr_pt1, ctr_pt2, end_pt1, ctr_pt3, ctr_pt4, ...] I have used both extrude_bezier_along_bezier and extrude_2d_shapes_along_bezier. I first rotate or flip the profile path around z axis arbitrary amounts till it comes out correctly. Once I get a reliable workflow, I plan to modify the inkscape extension to write it all out the way I want it. @adrianv and tp3, I think it just boils down to me wanting to be a PITA about the cutting profile. I wanted to create a profile that is straight up and down on the inside of the cutter, but gradually slope from thin cutting edge at top say 1.2mm to 6-8 mm pressing handle at bottom. The only way I could figure to do that was to create the profile as bezier path; <http://forum.openscad.org/file/t2599/cutter_profile.jpg> . None of the online examples came close to doing this. -- Sent from: http://forum.openscad.org/
A
adrianv
Sun, Aug 4, 2019 12:46 PM

Nothing wrong with creating the profile using beziers, though certainly there
are other ways.  I tried a rough attempt at your profile using my
round_corners function to show an alternative to beziers.  I start with a
basic profile shape drawn with straight lines and then round over the
corners.  Then I use rounded_sweep to create the outside of the cutter and
also the inside.  I added rounded edges at the top so you don't hurt your
fingers pressing on the cutter (though for printability the outside
roundover might need tweaking).  Note that offset() here is a function that
operates on a list of points, not the native offset() module.

http://forum.openscad.org/file/t2477/cutter.png

include<BOSL2/std.scad>
include<BOSL2/rounding.scad>

cutter = star(d = 30, id= 20, n=7);

profile = [[0,0], [-2,9], [-4.5,10],[-5.6,12],[-5,12]];
rprofile = round_corners(profile, size=[0,.3,.2,.3,0],closed=false);

difference(){
rounded_sweep(offset(cutter, r=1.2, closed=true), height=12,
bottom=rs_custom(rprofile));
rounded_sweep(cutter, height=13,bottom=rs_teardrop(r=-1,extra=1));
}

cgriffith wrote

I think it just boils down to me wanting to be a PITA about the cutting
profile.  I wanted to create a profile that is straight up and down on the
inside of the cutter, but gradually slope from thin cutting edge at top
say
1.2mm to 6-8 mm pressing handle at bottom.  The only way I could figure to
do that was to create the profile as bezier path;
<http://forum.openscad.org/file/t2599/cutter_profile.jpg> .  None of
the
online examples came close to doing this.

Nothing wrong with creating the profile using beziers, though certainly there are other ways. I tried a rough attempt at your profile using my round_corners function to show an alternative to beziers. I start with a basic profile shape drawn with straight lines and then round over the corners. Then I use rounded_sweep to create the outside of the cutter and also the inside. I added rounded edges at the top so you don't hurt your fingers pressing on the cutter (though for printability the outside roundover might need tweaking). Note that offset() here is a function that operates on a list of points, not the native offset() module. <http://forum.openscad.org/file/t2477/cutter.png> include<BOSL2/std.scad> include<BOSL2/rounding.scad> cutter = star(d = 30, id= 20, n=7); profile = [[0,0], [-2,9], [-4.5,10],[-5.6,12],[-5,12]]; rprofile = round_corners(profile, size=[0,.3,.2,.3,0],closed=false); difference(){ rounded_sweep(offset(cutter, r=1.2, closed=true), height=12, bottom=rs_custom(rprofile)); rounded_sweep(cutter, height=13,bottom=rs_teardrop(r=-1,extra=1)); } cgriffith wrote > I think it just boils down to me wanting to be a PITA about the cutting > profile. I wanted to create a profile that is straight up and down on the > inside of the cutter, but gradually slope from thin cutting edge at top > say > 1.2mm to 6-8 mm pressing handle at bottom. The only way I could figure to > do that was to create the profile as bezier path; > &lt;http://forum.openscad.org/file/t2599/cutter_profile.jpg&gt; . None of > the > online examples came close to doing this. -- Sent from: http://forum.openscad.org/
G
gasstationwithoutpumps
Sun, Aug 4, 2019 3:36 PM

Torsten, I had seen your design before at
https://forum.openscad.org/Minkowski-Sum-and-Cookie-Cutter-tp20733p20753.html
https://forum.openscad.org/Minkowski-Sum-and-Cookie-Cutter-tp20733p20753.html
and tried that approach.

Your design runs, though the 3D Minkowski operation makes it very slow—I
killed the run after 10 minutes of getting nothing on a simplified version
of the cookie cutter I was trying to make.

Your approach also has no fillets nor rounding in the Z dimension, though
the convex corners are nicely rounded in the XY direction.

I was trying to see whether it is possible to make injection-moldable (not
just 3D-printable) models in OpenSCAD, but getting the necessary 3D fillets,
rounding, and draft angles seems to be very difficult.

For 3D printing, I have no problem working with just linear_extrude.


gasstationwithoutpumps.wordpress.com
www.thingiverse.com/gasstationwithoutpumps/things

Sent from: http://forum.openscad.org/

Torsten, I had seen your design before at https://forum.openscad.org/Minkowski-Sum-and-Cookie-Cutter-tp20733p20753.html <https://forum.openscad.org/Minkowski-Sum-and-Cookie-Cutter-tp20733p20753.html> and tried that approach. Your design runs, though the 3D Minkowski operation makes it *very* slow—I killed the run after 10 minutes of getting nothing on a simplified version of the cookie cutter I was trying to make. Your approach also has no fillets nor rounding in the Z dimension, though the convex corners are nicely rounded in the XY direction. I was trying to see whether it is possible to make injection-moldable (not just 3D-printable) models in OpenSCAD, but getting the necessary 3D fillets, rounding, and draft angles seems to be very difficult. For 3D printing, I have no problem working with just linear_extrude. ----- gasstationwithoutpumps.wordpress.com www.thingiverse.com/gasstationwithoutpumps/things -- Sent from: http://forum.openscad.org/
G
gasstationwithoutpumps
Sun, Aug 4, 2019 4:22 PM

adrianv wrote

Nothing wrong with creating the profile using beziers, though certainly
there
are other ways.  I tried a rough attempt at your profile using my
round_corners function to show an alternative to beziers.  I start with a
basic profile shape drawn with straight lines and then round over the
corners.  Then I use rounded_sweep to create the outside of the cutter
and
also the inside.  I added rounded edges at the top so you don't hurt your
fingers pressing on the cutter (though for printability the outside
roundover might need tweaking).  Note that offset() here is a function
that
operates on a list of points, not the native offset() module.

<http://forum.openscad.org/file/t2477/cutter.png>

This comes much closer to what I was looking for—it runs fast enough to be
usable (41 seconds to render the outline of the cookie cutter) and seems to
do an ok job of providing profiles.  I've only tried it on closed paths so
far (where it works fine), but I'll try it on my full design soon, which
includes a number of open paths.

I think that the custom profiles will let me do both draft angles and
rounding of  edges—I'll play with it to see if I can get the control I want.


gasstationwithoutpumps.wordpress.com
www.thingiverse.com/gasstationwithoutpumps/things

Sent from: http://forum.openscad.org/

adrianv wrote > Nothing wrong with creating the profile using beziers, though certainly > there > are other ways. I tried a rough attempt at your profile using my > round_corners function to show an alternative to beziers. I start with a > basic profile shape drawn with straight lines and then round over the > corners. Then I use rounded_sweep to create the outside of the cutter > and > also the inside. I added rounded edges at the top so you don't hurt your > fingers pressing on the cutter (though for printability the outside > roundover might need tweaking). Note that offset() here is a function > that > operates on a list of points, not the native offset() module. > > &lt;http://forum.openscad.org/file/t2477/cutter.png&gt; This comes much closer to what I was looking for—it runs fast enough to be usable (41 seconds to render the outline of the cookie cutter) and seems to do an ok job of providing profiles. I've only tried it on closed paths so far (where it works fine), but I'll try it on my full design soon, which includes a number of open paths. I think that the custom profiles will let me do both draft angles and rounding of edges—I'll play with it to see if I can get the control I want. ----- gasstationwithoutpumps.wordpress.com www.thingiverse.com/gasstationwithoutpumps/things -- Sent from: http://forum.openscad.org/
G
gasstationwithoutpumps
Mon, Aug 5, 2019 12:36 AM

Using the rounded_sweep() of BOSL2 worked for me, once I fixed a bug in
geometry.scad:

The parallel check in offset should be

<pre> parallelcheck = (len(sharpcorners)==2 && !closed) || all_defined([for (i=[(closed?0:1):len(sharpcorners)-(closed?1:2)]) sharpcorners[i]]) </pre>

as both the first and last corners are undefined for an open path.


gasstationwithoutpumps.wordpress.com
www.thingiverse.com/gasstationwithoutpumps/things

Sent from: http://forum.openscad.org/

Using the rounded_sweep() of BOSL2 worked for me, once I fixed a bug in geometry.scad: The parallel check in offset should be <pre> parallelcheck = (len(sharpcorners)==2 && !closed) || all_defined([for (i=[(closed?0:1):len(sharpcorners)-(closed?1:2)]) sharpcorners[i]]) </pre> as both the first and last corners are undefined for an open path. ----- gasstationwithoutpumps.wordpress.com www.thingiverse.com/gasstationwithoutpumps/things -- Sent from: http://forum.openscad.org/