hull() not working for a pair of ellipses..

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

hull() not working for a pair of ellipses..

ps91Rick
Ok.. I've got the code below that I've stripped down from a bigger piece I'm
playing with.  It was using cylinders before without issue..

but now I'm playing with ellipses which are based on 2d circles instead of
3d cylinders.  I'm guessing that is what is messing with my hull()
operation.  What I'm ultimately trying to do is create an elliptical
cylinder that is X units high.  What are my options here?  Below is the code
that misbehaves -- what it should do is create two ellipses -- one above the
other and use hull() to create a shell between them -- or at least that's
what I'm expecting as it worked fine with cylinders instead of ellipses.

$fn=360;

ellipse_height=37.55;
ellipse_width=76.2*2;
object_height=155;
wall_thickness=2;
draft_angle=6;

// MCAD implementation of Ellipse.. Taken for simplicy sake for this example
module ellipse(width, height) {
  scale([1, height/width, 1]) circle(r=width/2);
}
 
module build_cylinder_shell_wall(ellipse_width,
                                 ellipse_height,
                                 object_height) {
    hull() {
        translate([0, 0, object_height])
            ellipse(ellipse_width, ellipse_height);
        ellipse(ellipse_width, ellipse_height);  
    }
}

build_cylinder_shell_wall(ellipse_width,ellipse_height, object_height);



--
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: hull() not working for a pair of ellipses..

nophead
You can't hull 2D shapes so change the circles to very thin cylinders. If they are more complex 2D shapes linear_extrude them a small amount.

On Thu, 23 Apr 2020 at 21:23, ps91Rick <[hidden email]> wrote:
Ok.. I've got the code below that I've stripped down from a bigger piece I'm
playing with.  It was using cylinders before without issue..

but now I'm playing with ellipses which are based on 2d circles instead of
3d cylinders.  I'm guessing that is what is messing with my hull()
operation.  What I'm ultimately trying to do is create an elliptical
cylinder that is X units high.  What are my options here?  Below is the code
that misbehaves -- what it should do is create two ellipses -- one above the
other and use hull() to create a shell between them -- or at least that's
what I'm expecting as it worked fine with cylinders instead of ellipses.

$fn=360;

ellipse_height=37.55;
ellipse_width=76.2*2;
object_height=155;
wall_thickness=2;
draft_angle=6;

// MCAD implementation of Ellipse.. Taken for simplicy sake for this example
module ellipse(width, height) {
  scale([1, height/width, 1]) circle(r=width/2);
}

module build_cylinder_shell_wall(ellipse_width,
                                 ellipse_height,
                                 object_height) {
    hull() {
        translate([0, 0, object_height])
            ellipse(ellipse_width, ellipse_height);
        ellipse(ellipse_width, ellipse_height);   
    }
}

build_cylinder_shell_wall(ellipse_width,ellipse_height, object_height);



--
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: hull() not working for a pair of ellipses..

ps91Rick
thanks!  I was able to get it to work with your suggestion!

nop head wrote on 4/23/20 1:39 PM:
> You can't hull 2D shapes so change the circles to very thin cylinders.
> If they are more complex 2D shapes linear_extrude them a small amount.

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

Re: hull() not working for a pair of ellipses..

Ronaldo

thanks!  I was able to get it to work with your suggestion!

nop head wrote on 4/23/20 1:39 PM:
> You can't hull 2D shapes so change the circles to very thin cylinders.
> If they are more complex 2D shapes linear_extrude them a small amount.
 
To be fair, you can hull() 2D objects to shape a 2D object. You can't expect to get a 3D object hulling 2D object in OpenSCAD. Consider that 2D objects live in the XY plane and their translation in Z should be forbidden as they are useless (for instance, they are ignored by render). Rotation of 2D shapes other than about Z axis also should be avoided once they are not forbidden but are also misleading.

In your case of a upright cylinder, you can just linear_extrude the base ellipse.

linear_extrude(object_height)
  ellipse(ellipse_width, ellipse_height);


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

Re: hull() not working for a pair of ellipses..

nophead
Or scale a tall cylinder.

On Thu, 23 Apr 2020 at 23:01, Ronaldo Persiano <[hidden email]> wrote:

thanks!  I was able to get it to work with your suggestion!

nop head wrote on 4/23/20 1:39 PM:
> You can't hull 2D shapes so change the circles to very thin cylinders.
> If they are more complex 2D shapes linear_extrude them a small amount.
 
To be fair, you can hull() 2D objects to shape a 2D object. You can't expect to get a 3D object hulling 2D object in OpenSCAD. Consider that 2D objects live in the XY plane and their translation in Z should be forbidden as they are useless (for instance, they are ignored by render). Rotation of 2D shapes other than about Z axis also should be avoided once they are not forbidden but are also misleading.

In your case of a upright cylinder, you can just linear_extrude the base ellipse.

linear_extrude(object_height)
  ellipse(ellipse_width, ellipse_height);

_______________________________________________
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: hull() not working for a pair of ellipses..

ps91Rick
Got it.. Thx

nop head wrote on 4/23/20 3:23 PM:
Or scale a tall cylinder.

On Thu, 23 Apr 2020 at 23:01, Ronaldo Persiano <[hidden email]> wrote:

thanks!  I was able to get it to work with your suggestion!

nop head wrote on 4/23/20 1:39 PM:
> You can't hull 2D shapes so change the circles to very thin cylinders.
> If they are more complex 2D shapes linear_extrude them a small amount.
 
To be fair, you can hull() 2D objects to shape a 2D object. You can't expect to get a 3D object hulling 2D object in OpenSCAD. Consider that 2D objects live in the XY plane and their translation in Z should be forbidden as they are useless (for instance, they are ignored by render). Rotation of 2D shapes other than about Z axis also should be avoided once they are not forbidden but are also misleading.

In your case of a upright cylinder, you can just linear_extrude the base ellipse.

linear_extrude(object_height)
  ellipse(ellipse_width, ellipse_height);

_______________________________________________
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

--
Sent from Postbox

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