Hey all,
I often use OpenSCAD to generate models as patterns for real-life objects I
plan to make. I am currently needing to make something out of sheet metal,
and the shape will be mildly complicated: It will be a chip-catching pan
to attach to a metal-cutting lathe. I can't find any sample pictures, but
imagine a wall about 3 feet tall behind the lathe and then folding around
under the lathe in a sort of half-shell manner.
I am certain that OpenSCAD can be used to make such models and to then
"unfold" them to get a flat pattern which would then be copied to the real
piece of sheet metal. But I am wondering if anyone has done this before?
Has anyone made a library and figured out the best way to generalize this
problem?
This YoutTube video (https://www.youtube.com/watch?v=fWG-FPWj8JU) shows how
Fusion360 provides this feature. I just skimmed the video so I didn't get
too deep into its details.
Any thoughts?
Thanks
Kevin
I haven’t come across such a feature, but perhaps someone else has. To do that with any CAD program, though, you would first have to reproduce the outer shape of the lathe with all details in 3D on your PC. I would prefer to make a model out of old cardboard boxes.
I don't know about an app that'd do the unwrap but if you sent me a model I
can manially unwrap it in say Blender and send you back a pattern
On Wed, Sep 21, 2022, 06:36 Kevin Toppenberg kdtop3@gmail.com wrote:
Hey all,
I often use OpenSCAD to generate models as patterns for real-life objects
I plan to make. I am currently needing to make something out of sheet
metal, and the shape will be mildly complicated: It will be a
chip-catching pan to attach to a metal-cutting lathe. I can't find any
sample pictures, but imagine a wall about 3 feet tall behind the lathe and
then folding around under the lathe in a sort of half-shell manner.
I am certain that OpenSCAD can be used to make such models and to then
"unfold" them to get a flat pattern which would then be copied to the real
piece of sheet metal. But I am wondering if anyone has done this before?
Has anyone made a library and figured out the best way to generalize this
problem?
This YoutTube video (https://www.youtube.com/watch?v=fWG-FPWj8JU) shows
how Fusion360 provides this feature. I just skimmed the video so I didn't
get too deep into its details.
Any thoughts?
Thanks
Kevin
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
Bah silly phone.. I meant to add I am no Montroll, but have been doing
origami since the mid 1980's and have designed a few such patterns
On Wed, Sep 21, 2022, 19:09 Joe Greene volgclawtooth@gmail.com wrote:
I don't know about an app that'd do the unwrap but if you sent me a model
I can manially unwrap it in say Blender and send you back a pattern
On Wed, Sep 21, 2022, 06:36 Kevin Toppenberg kdtop3@gmail.com wrote:
Hey all,
I often use OpenSCAD to generate models as patterns for real-life objects
I plan to make. I am currently needing to make something out of sheet
metal, and the shape will be mildly complicated: It will be a
chip-catching pan to attach to a metal-cutting lathe. I can't find any
sample pictures, but imagine a wall about 3 feet tall behind the lathe and
then folding around under the lathe in a sort of half-shell manner.
I am certain that OpenSCAD can be used to make such models and to then
"unfold" them to get a flat pattern which would then be copied to the real
piece of sheet metal. But I am wondering if anyone has done this before?
Has anyone made a library and figured out the best way to generalize this
problem?
This YoutTube video (https://www.youtube.com/watch?v=fWG-FPWj8JU) shows
how Fusion360 provides this feature. I just skimmed the video so I didn't
get too deep into its details.
Any thoughts?
Thanks
Kevin
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
Thank you all for the replies.
I did start with cardboard boxes. And that had it's own special
problems... :-)
Here is some code I came up with. I'd love feedback.
//A folding library
//-------------------------
//author: Kevin Toppenberg
//date: 9/21/2022
//license: public domain
// Test -- fold a paper airplane
/* Instructions:
To see lines that will be folded (but no folding done), set show_folded=0
below
To see folding, set show_folded=1 below
To see lines in addition to folds, set show_fold_line_axis=1 below
To see an animation of folding:
set show_folded=1 below
turn on animation: Menu -> view -> animate
In GUI interface, set FPS = 1 and steps=50 (feel free to play with
these values)
To turn animation back off, toggle with Menu -> view -> animate
NOTE: on my computer, the animate was very slow, about 1 second per
frame
show_folded = 1; //set to 0 to just show lines
show_fold_line_axis = 1;
fold_angle = 180;
size = [inch(8.5),inch(11),0.2];
mode = (show_folded) ? 1 : 2;
fold_z_offset = (mode==2) ? size.z+1 : 0;
t1=sin(360*$t);
time = abs(t1);
fold_line7 = [[0, 0, fold_z_offset], [0,
size.y, fold_z_offset]];
fold_line6 = [[ size.x0.15, 0, fold_z_offset], [ size.x0.15,
size.y, fold_z_offset]];
fold_line5 = [[-size.x0.15, 0, fold_z_offset], [-size.x0.15,
size.y, fold_z_offset]];
fold_line4 = [[ size.x0.53, 0, fold_z_offset], [0,
size.y, fold_z_offset]];
fold_line3 = [[-size.x0.53, 0, fold_z_offset], [0,
size.y, fold_z_offset]];
fold_line2 = [[ size.x0.50, size.y 0.61, fold_z_offset], [0,
size.y, fold_z_offset]];
fold_line1 = [[-size.x0.50, size.y 0.61, fold_z_offset], [0,
size.y, fold_z_offset]];
angle7=sequential_fold_angle(90,7,time);
angle6=-sequential_fold_angle(45,6,time);
angle5=-sequential_fold_angle(45,5,time);
angle4=sequential_fold_angle(fold_angle,4,time);
angle3=sequential_fold_angle(fold_angle,3,time);
angle2=sequential_fold_angle(fold_angle,2,time);
angle1=sequential_fold_angle(fold_angle,1,time);
rotate([0,(show_folded) ? angle7/2: 0,0])
fold(fold_line7, angle7, true, mode, show_fold_line_axis)
fold(fold_line6, angle6, true, mode, show_fold_line_axis)
fold(fold_line5, angle5, false, mode, show_fold_line_axis)
fold(fold_line4, angle4, true, mode, show_fold_line_axis)
fold(fold_line3, angle3, false, mode, show_fold_line_axis)
fold(fold_line2, angle2, true, mode, show_fold_line_axis)
fold(fold_line1, angle1, false, mode, show_fold_line_axis)
translate([-size.x/2, -0*size.y/2,0]) {
color("red") cube(size);
*translate([0,0,-0.1])
color("green") cube(size);
}
function sequential_fold_angle(max_angle, fold_num, time) =
/*
fold_num % t
-------- --- ---------
1 & 2 25% 0.00-0.25
3 & 4 25% 0.26-0.50
5 & 6 25% 0.51-0.75
7 25% 0.76-1.00
/
let(
cutoffs = [0, 0.25, 0.50, 0.75, 1.00],
group = ((fold_num == 1) || (fold_num == 2)) ? 1
: ((fold_num == 3) || (fold_num == 4)) ? 2
: ((fold_num == 5) || (fold_num == 6)) ? 3 : 4,
window_lo = cutoffs[group-1],
window_hi = cutoffs[group],
t2 = (time >= window_hi) ? max_angle
: (time < window_lo) ? 0
: max_angle(time-window_lo)/(window_hi-window_lo)
) t2;
MaxNum = 9999;
fold_mode_fold = 1;
fold_mode_display = 2;
module fold(fold_line = [[0,0,0],[0,1,0]],
angle=90,
move_right_side = true,
mode=fold_mode_fold,
show_fold_lines = false) {
//NOTE: This function is designed to work on thin, flat surface on the
XY plane
//Input: line = [pt1, pt2] each pt is a [x,y,z] point. 2 points define
a line
// This is the line that the object will be folded along.
// angle == the amount of fold angle along line (rotates towards
midline)
// move_right_side : true or false Sets which side of fold to move
// mode: 1 or 2. 1 = perform fold, 2 = only show lines where fold
would occur.
restored_children(fold_line)
if (mode == fold_mode_fold) {
if (move_right_side) {
//the unfolded part
difference() {
positioned_children(fold_line, show_fold_lines)
children();
translate([0, -MaxNum/2, -MaxNum/2])
cube([MaxNum, MaxNum, MaxNum]) ;
}
//the folded part
rotate([0,-angle,0])
intersection() {
positioned_children(fold_line)
children();
translate([0, -MaxNum/2, -MaxNum/2])
cube([MaxNum, MaxNum, MaxNum]) ;
}
} else { //move left side
//the unfolded part
intersection() {
positioned_children(fold_line, show_fold_lines)
children();
translate([0, -MaxNum/2, -MaxNum/2])
cube([MaxNum, MaxNum, MaxNum]) ;
}
//the folded part
rotate([0,angle,0])
difference() {
positioned_children(fold_line)
children();
translate([0, -MaxNum/2, -MaxNum/2])
cube([MaxNum, MaxNum, MaxNum]) ;
}
}
} else if (mode == fold_mode_display) {
positioned_children(fold_line, true)
children();
}
}
module positioned_children(fold_line = [[0,0,0],[0,1,0]], show_line=false) {
pt1 = fold_line[0];
pt2 = fold_line[1];
fold_vect = pt2-pt1;
position_angle = needed_rotation(fold_vect, [0,1,0]);
//echo("position angle=",position_angle);
rotate([0,0,position_angle])
translate(-pt1) {
children();
if (show_line) {
line(pt1, pt2, 0.5, "black");
translate(pt2) color("yellow") sphere(d=3, $fn=15);
}
}
}
module restored_children(fold_line = [[0,0,0],[0,1,0]]) {
pt1 = fold_line[0];
pt2 = fold_line[1];
fold_vect = pt2-pt1;
position_angle = needed_rotation(fold_vect, [0,1,0]);
translate(pt1)
rotate([0,0,-position_angle])
children();
}
function inch(n) = 25.4 * n;
//
---========================
// Vector stuff
//
---========================
function normalize(v) = v / vect_len(v);
function vect_len(v) = norm(v); //in case I forget the easier syntax!
function dot_product(v1,v2) = v1*v2; //in case I forget the easier syntax!
//v1=[1,0,0];
//v2=[0,1,1];
//echo(angle_between(v1,v2));
function angle_between(v1, v2) =
//v1 · v2 = |v1| * |v2| * cos(α)
acos(dot_product(v1, v2) / (vect_len(v1) * vect_len(v2)));
function needed_rotation(v1, v2) =
//return angle (in z axis) needed to orient v1 in direction of v2
// v2 is assumed to be [0,1,0]
let(
a = angle_between(v1, v2),
nv = normalize(v1),
a2 = (nv.x<0) ? -a : a
) a2;
function quadrant(pt) =
let(
quad12 = (pt.y>0),
quad23 = (pt.x<0),
quad14 = !quad23,
quad = (quad12) ?
((quad14) ? 1 : 2)
:
((quad23) ? 3 : 4)
) quad;
function bool_num(bool) = (bool) ? 1 : 0;
//
---========================
//
---========================
module line(p1=[0,0,0], p2=[0,0,10], r=.1, color="black")
{
color(color)
hull()
{
translate(p1) sphere(r);
translate(p2) sphere(r);
}
}
On Wed, Sep 21, 2022 at 8:15 PM Joe Greene volgclawtooth@gmail.com wrote:
Bah silly phone.. I meant to add I am no Montroll, but have been doing
origami since the mid 1980's and have designed a few such patterns
On Wed, Sep 21, 2022, 19:09 Joe Greene volgclawtooth@gmail.com wrote:
I don't know about an app that'd do the unwrap but if you sent me a model
I can manially unwrap it in say Blender and send you back a pattern
On Wed, Sep 21, 2022, 06:36 Kevin Toppenberg kdtop3@gmail.com wrote:
Hey all,
I often use OpenSCAD to generate models as patterns for real-life
objects I plan to make. I am currently needing to make something out of
sheet metal, and the shape will be mildly complicated: It will be a
chip-catching pan to attach to a metal-cutting lathe. I can't find any
sample pictures, but imagine a wall about 3 feet tall behind the lathe and
then folding around under the lathe in a sort of half-shell manner.
I am certain that OpenSCAD can be used to make such models and to then
"unfold" them to get a flat pattern which would then be copied to the real
piece of sheet metal. But I am wondering if anyone has done this before?
Has anyone made a library and figured out the best way to generalize this
problem?
This YoutTube video (https://www.youtube.com/watch?v=fWG-FPWj8JU) shows
how Fusion360 provides this feature. I just skimmed the video so I didn't
get too deep into its details.
Any thoughts?
Thanks
Kevin
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
Joe, thank you for the offer. Let's see if I can do it in OpenSCAD.
:-)
Kevin
On Wed, Sep 21, 2022 at 8:15 PM Joe Greene volgclawtooth@gmail.com wrote:
Bah silly phone.. I meant to add I am no Montroll, but have been doing
origami since the mid 1980's and have designed a few such patterns
On Wed, Sep 21, 2022, 19:09 Joe Greene volgclawtooth@gmail.com wrote:
I don't know about an app that'd do the unwrap but if you sent me a model
I can manially unwrap it in say Blender and send you back a pattern
On Wed, Sep 21, 2022, 06:36 Kevin Toppenberg kdtop3@gmail.com wrote:
Hey all,
I often use OpenSCAD to generate models as patterns for real-life
objects I plan to make. I am currently needing to make something out of
sheet metal, and the shape will be mildly complicated: It will be a
chip-catching pan to attach to a metal-cutting lathe. I can't find any
sample pictures, but imagine a wall about 3 feet tall behind the lathe and
then folding around under the lathe in a sort of half-shell manner.
I am certain that OpenSCAD can be used to make such models and to then
"unfold" them to get a flat pattern which would then be copied to the real
piece of sheet metal. But I am wondering if anyone has done this before?
Has anyone made a library and figured out the best way to generalize this
problem?
This YoutTube video (https://www.youtube.com/watch?v=fWG-FPWj8JU) shows
how Fusion360 provides this feature. I just skimmed the video so I didn't
get too deep into its details.
Any thoughts?
Thanks
Kevin
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
Here is an alternative way, recursive fold...
Folding a sheet material in OpenSCAD
|
|
|
| | |
|
|
|
| |
Folding a sheet material in OpenSCAD
Folding a sheet material in OpenSCAD. GitHub Gist: instantly share code, notes, and snippets.
|
|
|
On Thursday, 22 September 2022 at 03:58:43 BST, Kevin Toppenberg <kdtop3@gmail.com> wrote:
Joe, thank you for the offer. Let's see if I can do it in OpenSCAD.:-)
Kevin
On Wed, Sep 21, 2022 at 8:15 PM Joe Greene volgclawtooth@gmail.com wrote:
Bah silly phone.. I meant to add I am no Montroll, but have been doing origami since the mid 1980's and have designed a few such patterns
On Wed, Sep 21, 2022, 19:09 Joe Greene volgclawtooth@gmail.com wrote:
I don't know about an app that'd do the unwrap but if you sent me a model I can manially unwrap it in say Blender and send you back a pattern
On Wed, Sep 21, 2022, 06:36 Kevin Toppenberg kdtop3@gmail.com wrote:
Hey all,
I often use OpenSCAD to generate models as patterns for real-life objects I plan to make. I am currently needing to make something out of sheet metal, and the shape will be mildly complicated: It will be a chip-catching pan to attach to a metal-cutting lathe. I can't find any sample pictures, but imagine a wall about 3 feet tall behind the lathe and then folding around under the lathe in a sort of half-shell manner.
I am certain that OpenSCAD can be used to make such models and to then "unfold" them to get a flat pattern which would then be copied to the real piece of sheet metal. But I am wondering if anyone has done this before? Has anyone made a library and figured out the best way to generalize this problem?
This YoutTube video (https://www.youtube.com/watch?v=fWG-FPWj8JU) shows how Fusion360 provides this feature. I just skimmed the video so I didn't get too deep into its details.
Any thoughts?
ThanksKevin
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
Do you care about intersecting folds?
It seems like handling any number of non-intersecting folds would be,
maybe not easy, but not awful.
But handling intersecting folds - like folding a sheet length-wise and
then width-wise - would be much harder.
My thoughts were more along the lines of making the tool as robust as
possible. I was initially wanting a tool to model folding sheet metal into
a pan shape. I have since found another solution for that particular
problem, so I don't have anything pressing right now. Has anyone else ever
had a need for this?
Kevin
On Sat, Oct 1, 2022 at 2:44 PM Jordan Brown openscad@jordan.maileater.net
wrote:
Do you care about intersecting folds?
It seems like handling any number of non-intersecting folds would be,
maybe not easy, but not awful.
But handling intersecting folds - like folding a sheet length-wise and
then width-wise - would be much harder.