I'd like to do something similar to hull()

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

I'd like to do something similar to hull()

cmodyssey
Hi,

I'd like to fill in all the area between these two objects.  When I use
hull, it fills in the area within the arc as well.

What I am after is something that looks a bit like a dam, if that makes
sense.

<http://forum.openscad.org/file/t3018/H.jpg>

Here is my code.  Does anybody have any ideas hoe I can join those shapes in
that way?

*
include <dotSCAD-master\src\rotate_p.scad>;
include <dotSCAD-master\src\polysections.scad>;
include <dotSCAD-master\src\path_extrude.scad>;
include <dotSCAD-master\src\bezier_curve.scad>;




no_steps=100;

t_step=1/no_steps;



shape_pts = [  
    [0, 0],
    [2, 0],
    [2,0.5],
    [0,0.5],

];




bottom_path = [
    [0,0,0],
    [0,-20,0],
    [20,-20,0],
    [20,0,0],
    ];



top_path = [
    [0,0,0],
    [0,-25,0],
    [25,-25,0],
    [25,0,0],
    ];



bottom_path_pts = bezier_curve(t_step,bottom_path);
top_path_pts = bezier_curve(t_step,top_path);


path_extrude(shape_pts, bottom_path_pts, method = "EULER_ANGLE");

translate([-2.5,2,3]) path_extrude(shape_pts, top_path_pts, method =
"EULER_ANGLE");
*



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

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: I'd like to do something similar to hull()

nophead
I would hull the outside paths and then difference with a hull of the inside paths for that particular shape.

On Mon, 16 Nov 2020 at 09:30, cmodyssey <[hidden email]> wrote:
Hi,

I'd like to fill in all the area between these two objects.  When I use
hull, it fills in the area within the arc as well.

What I am after is something that looks a bit like a dam, if that makes
sense.

<http://forum.openscad.org/file/t3018/H.jpg>

Here is my code.  Does anybody have any ideas hoe I can join those shapes in
that way?

*
include <dotSCAD-master\src\rotate_p.scad>;
include <dotSCAD-master\src\polysections.scad>;
include <dotSCAD-master\src\path_extrude.scad>;
include <dotSCAD-master\src\bezier_curve.scad>;




no_steps=100;

t_step=1/no_steps;



shape_pts = [   
    [0, 0],
    [2, 0],
    [2,0.5],
    [0,0.5],

];




bottom_path = [
    [0,0,0],
    [0,-20,0],
    [20,-20,0],
    [20,0,0],
    ];



top_path = [
    [0,0,0],
    [0,-25,0],
    [25,-25,0],
    [25,0,0],
    ];



bottom_path_pts = bezier_curve(t_step,bottom_path);
top_path_pts = bezier_curve(t_step,top_path);


path_extrude(shape_pts, bottom_path_pts, method = "EULER_ANGLE");

translate([-2.5,2,3]) path_extrude(shape_pts, top_path_pts, method =
"EULER_ANGLE");
*



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

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: I'd like to do something similar to hull()

cacb
In reply to this post by cmodyssey
On 16.11.2020 10:29, cmodyssey wrote:

> Hi,
>
> I'd like to fill in all the area between these two objects.  When I use
> hull, it fills in the area within the arc as well.
>
> What I am after is something that looks a bit like a dam, if that makes
> sense.
>
> <http://forum.openscad.org/file/t3018/H.jpg>
>
> Here is my code.  Does anybody have any ideas hoe I can join those shapes in
> that way?

It looks like you want something similar to a lofting function
https://en.wikipedia.org/wiki/Lofting

Probably your best guess is to create 2 solids, one based on the outer
curves  of top an bottom, another from the inner curves. Then subtract
inner from outer.

Carsten Arnholm

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: I'd like to do something similar to hull()

caterpillar
This post was updated on .
In reply to this post by cmodyssey
You want this?

// Based on dotSCAD 2.4
use <bezier_curve.scad>;
use <shape_path_extend.scad>;
use <sweep.scad>;
use <util/reverse.scad>;
no_steps=100;

t_step=1/no_steps;

bottom_path = [
    [0,0,0],
    [0,-20,0],
    [20,-20,0],
    [20,0,0],
    ];

top_path = [
    [0,0,0],
    [0,-25,0],
    [25,-25,0],
    [25,0,0],
    ];

bottom_path_pts = bezier_curve(t_step,bottom_path);
top_path_pts = bezier_curve(t_step,top_path);

stroke = [[0, 0], [2, 0]];
shape1 = shape_path_extend(stroke, bottom_path_pts);
shape2 = shape_path_extend(stroke, top_path_pts);

sweep([
    reverse([for(p = shape1) [p[0], p[1], 0]]),
    reverse([for(p = shape2) [p[0], p[1], 0] + [-2.5,2,3]])
]);

<http://forum.openscad.org/file/t1825/1.jpg



-----
https://openhome.cc
--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: I'd like to do something similar to hull()

cmodyssey
Hi,

Wow, so many great answers, thanks!

I've tried both nophead and caterpillar's suggestions and got what I wanted
out of both.

It was good to do both, as it means I learn more!

Thanks so much, that has got me going now.



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

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org