Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difference between sweep() and skin() #3

Open
jgrizou opened this issue Jan 12, 2015 · 6 comments
Open

Difference between sweep() and skin() #3

jgrizou opened this issue Jan 12, 2015 · 6 comments

Comments

@jgrizou
Copy link

jgrizou commented Jan 12, 2015

I have been testing the sweep() and skin() function, they are trully amazing. I am still confused about the difference between these two functions. Which is more suited for what? For example, here are two ways to do the same thing:

use <scad-utils/transformations.scad>
use <scad-utils/trajectory_path.scad>
use <scad-utils/trajectory.scad>
use <scad-utils/shapes.scad>

use <skin.scad>
use <sweep.scad>

path_definition = [
trajectory(forward = 10, roll  =  0),
trajectory(forward =  5*3.14159265359, pitch = 180),
trajectory(forward = 10, roll  =  0)
];

// sweep
path = quantize_trajectories(path_definition, steps=100);
sweep(rectangle_profile([2,3]), path);

// skin
trans = [ for (i=[0:len(path)-1]) transform(path[i], rectangle_profile([2,3])) ];

translate([0,10,0])
  skin(trans);

Is there any fundamental differences between these two methods?
Do you recommend one of them for this kind of part?

@NateTG
Copy link

NateTG commented Feb 11, 2015

I haven't looked at the code in the examples, but it's probably that sweep is for rigidly transformed profiles, and skin is for more plastic changes in profiles.

There's a discussion about the various ways to handle more general notions of extrusion where it came up.

openscad/openscad#114

@kintel
Copy link
Member

kintel commented Feb 11, 2015

@jgrizou One primary difference is that skin() will be able to skin differently shaped layers, while sweep can only do linear transformations.

@atartanian
Copy link

@jgrizou this is the difference

use <scad-utils/transformations.scad>
use <scad-utils/trajectory_path.scad>
use <scad-utils/trajectory.scad>
use <scad-utils/shapes.scad>

use <list-comprehension-demo/skin.scad>
use <list-comprehension-demo/sweep.scad>

path_definition = [
trajectory(forward = 10, roll  =  0),
trajectory(forward =  5*3.14159265359, pitch = 180),
trajectory(forward = 10, roll  =  0)
];

// sweep
path = quantize_trajectories(path_definition, steps=100);
sweep(rectangle_profile([2,3]), path);

// skin
myLen = len(path)-1;
trans = [ for (i=[0:len(path)-1]) transform(path[i], rounded_rectangle_profile([4,4], i/myLen*2)) ];

translate([0,10,0])
  skin(trans);

screen shot 2015-07-24 at 10 15 32 am

@petaflot
Copy link

I cannot find rounded_rectangle_profile()... can someone point?

@t-paul
Copy link
Member

t-paul commented Aug 29, 2023

@petaflot
Copy link

petaflot commented Sep 8, 2023

Probably that one: https://github.com/openscad/scad-utils/blob/26f8c2cf8124cdafe2fc21f9f9bbf2514e404834/shapes.scad#L7

doesn't look rounded to me ; also, see line 16:

// FIXME: Move rectangle and rounded rectangle from extrusion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants