Ovals

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

Ovals

FourthDr
I see in the documentation how to create a sphere. But how would I create an
oval shape?



--
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: Ovals

nophead
Use scale() with different scale factors on each axis on a circle, cylinder or sphere.

On 2 September 2018 at 10:47, FourthDr <[hidden email]> wrote:
I see in the documentation how to create a sphere. But how would I create an
oval shape?



--
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: Ovals

FourthDr
Hi Nophead:

I'm actually looking to create an ogive nose cone with a spherical point.
There was a model on Thingiverse someone made that included what looked like
a nice set of cones snub ogive, ogive, and conical, plus a few others. But
when I tried to cut it to fit my printer it crashed OpenSCAD. Upon closer
inspection, the model was full of errors that where not easily fixed. So I
thought I'd try and make my own. I'm looking to create the cone plus a base
that fits a body tube and includes a loop to attach a shock cord for a model
rocket. See attached model:  nosecone.zip
<http://forum.openscad.org/file/t1425/nosecone.zip>  

Model Rocket Kit <https://www.thingiverse.com/thing:685617>  





--
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: Ovals

christophe malvasio
the nosecone of this rocket does not look oval
basic : hull( ){translate([0,0,($Z-$1_
diameter])sphere($1_diameter);cylinder($2_diameter);}
printers are not very good with spheres
Le mar. 4 sept. 2018 à 07:21, FourthDr <[hidden email]> a écrit :

>
> Hi Nophead:
>
> I'm actually looking to create an ogive nose cone with a spherical point.
> There was a model on Thingiverse someone made that included what looked like
> a nice set of cones snub ogive, ogive, and conical, plus a few others. But
> when I tried to cut it to fit my printer it crashed OpenSCAD. Upon closer
> inspection, the model was full of errors that where not easily fixed. So I
> thought I'd try and make my own. I'm looking to create the cone plus a base
> that fits a body tube and includes a loop to attach a shock cord for a model
> rocket. See attached model:  nosecone.zip
> <http://forum.openscad.org/file/t1425/nosecone.zip>
>
> Model Rocket Kit <https://www.thingiverse.com/thing:685617>
>
>
>
>
>
> --
> 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: Ovals

Troberg
In reply to this post by FourthDr
How I would have done the nose cone:

A succession of spheres of appropriate sizes (just calculate the diameter at
different heights), hull() them together. It doesn't take many spheres to
get a good, smooth surface.

Then, of course, cut off the bottom with difference().

If you want it hollow, make another, scale it down a bit, and use
difference() to hollow the first one out.



--
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: Ovals

nophead
I had to look up https://en.wikipedia.org/wiki/Ogive. Looks like you can rotate_extrude the intersection of a circle and a square.

On 4 September 2018 at 08:21, Troberg <[hidden email]> wrote:
How I would have done the nose cone:

A succession of spheres of appropriate sizes (just calculate the diameter at
different heights), hull() them together. It doesn't take many spheres to
get a good, smooth surface.

Then, of course, cut off the bottom with difference().

If you want it hollow, make another, scale it down a bit, and use
difference() to hollow the first one out.



--
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: Ovals

FourthDr
In reply to this post by Troberg
Troberg:

Not quite sure I visualize how you are suggesting I code up a cone. Would
that produce a true ogive? And then how would I add a spherical tip instead
of the usual point? Have some example code?



--
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: Ovals

nophead
From the diagram on Wikipedia I saw that half the cross section of an ogive is the intersection of a circle and a rectangle.



To blunt the point you need to position another circle that is tangential to the first one and truncate the ogive at the tangential point and then hull it with a semi circle.




On 4 September 2018 at 10:32, FourthDr <[hidden email]> wrote:
Troberg:

Not quite sure I visualize how you are suggesting I code up a cone. Would
that produce a true ogive? And then how would I add a spherical tip instead
of the usual point? Have some example code?



--
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: Ovals

cbernhardt
Or, if you have access to a CAD program that creates DXF files you could draw
the ogive shape as a cross section of a shell and import it.
<http://forum.openscad.org/file/t1309/ogive.jpg>



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

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

Re: Ovals

jsc
In reply to this post by nophead
On the subject of rocket nosecones, I created an OpenSCAD model some time ago
to generate Haack series shapes:

https://www.thingiverse.com/thing:804129

These shapes are calculated to minimize drag in supersonic flows, so not
something that is functionally useful for model rockets. Still, I thought it
might be of interest.

Some work would need to be done to make it suitable for fitting to a rocket.



--
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: Ovals

RevarBat


On Sep 4, 2018, at 8:44 AM, jsc <[hidden email]> wrote:

On the subject of rocket nosecones, I created an OpenSCAD model some time ago
to generate Haack series shapes:

https://www.thingiverse.com/thing:804129

These shapes are calculated to minimize drag in supersonic flows, so not
something that is functionally useful for model rockets. Still, I thought it
might be of interest.

Some work would need to be done to make it suitable for fitting to a rocket.


Of course I only see this post AFTER I wrote my own.  :)
Well, I might as well post it:


pi = 3.1415926536;

function haack(x, L, R, C) = let(
        h = acos(1-(2*x/L))
    ) (R/sqrt(pi)) * sqrt(h*pi/180 - sin(2*h)/2 + C*pow(sin(h),3));

function haack_series(L, R, C, steps) = [ 
        for(i = [0:steps]) let(x = i*L/steps) [x, haack(x, L, R, C)] 
    ];  

// L is the length of the nosecone.
// R is the radius of the nosecone base.
// C should be 0 for a Von-Kármán ogive.
// steps is the granularity of the shape along the length.
module haack_nosecone(L, R, C=0, steps=100) {
    pts=concat(
        haack_series(L, R, C, steps),
        [[L, R], [L, 0], [0, 0]] 
    );  
    translate([0,0,L]) {
        rotate_extrude(angle=360, convexity=2) {
            rotate([0,0,-90]) polygon(points=pts);
        }   
    }   
}   

haack_nosecone(L=80, R=50, C=0);




- Revar



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

Re: Ovals

FourthDr
RevarBat:

Thanks for the code. I'll have to tinker with it a while. I also found this
code on another discussion forum, I added the sphere and was trying to merge
it with the cone.

 // rotate-extrude test
// by Oliver Fenn
$fn=64; // Bem .: 2nd power

// Shaping function x from [x0: xe], steadily increasing in [x0: xe]
x0=0.0;
xe=1.0;
// Examples:
// x, xx, xxx,
// 1-sin(acos(x)), 1-cos(90x), 1-cos(180x), sin(90x)
// log(x+1), 1-1/(x+1)
function f(x) = 1-sin(acos(x)); // ball, at half the height of the diameter!

// Two-dimensional polygon determined by f (x), x from [x0: xe]
module shape (start, end, to)
{
steps = (end-start)/to;
polygon
(
[
for(x=[start:steps:(end+steps)])
(x<=end)?[x-start, f(x)-f(start)]:[0, f(end)-f(start)]
]
);
} // shape

// cone over radius and height
module cone_r (rad, height)
{
hfact = height/(f(xe)-f(x0));
translate([34, 34, height])
mirror([0, 0, 1])
scale([rad/(xe-x0), rad/(xe-x0), hfact]) // Scale the cone to size
rotate_extrude()
shape(x0, xe, $fn);
} // cone_r

// construction
{
    //added by FourthDr
    translate([34,34,112.5])
        sphere(3., $fn=100);
}
cone_r(16.945, 114.94);
// join cone_r and sphere




--
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: Ovals

FourthDr
In reply to this post by RevarBat
The whole reason for this exercise in the first place is because I needed to
cut the part into two to fit my printer using the pizzlecut library. I think
I can eventually get this working since it's just basically a geometric
shape problem.

But with other models, this is a huge problem. I can't just easily redesign
more complex designs/shapes. Especially, since I don't always have the
original design files just an stl file. So any time there is some problem no
matter how small with the model OpenSCAD throws a hissyfit. Sometimes I can
"fix" the model where OpenSCAD will accept it. Bust most of the time not.

Case and point, I have two models attached below that I need cut into two
parts. They both look and preview fine. My slic3r has no problems. But when
I try to cut them, OpenSCAD will not render them. And in worst case such as
with the nose cone will actually crash OpenSCAD with a C++ error.

It's too bad there is not a way to just cut with defects and all. It just
needs to be accepted by a slicer and look ok to the eye. A diagnostic tool
of some sort that could fix these problem would be great. Or that could
point out problems and give suggestions on fixing them so OpenSCAD will
accept the file.

I'm trying to get these two attached stl files split by tomorrow. I've been
tinkering with them for months. So far without success. Any one interested
in seeing if they can find and correct the two files for me? And maybe give
some tips and or suggest some software tools I have not already tried?
Cryptic CGAL errors don't really help me find and fix what OpenSCAD is
complaining about.

back-cover-no-stand-2.stl
<http://forum.openscad.org/file/t1425/back-cover-no-stand-2.stl>  
_LCD_face_plate_LCD_hole_open_(repaired).stl
<http://forum.openscad.org/file/t1425/_LCD_face_plate_LCD_hole_open_%28repaired%29.stl>  
puzzlecutlib3.scad <http://forum.openscad.org/file/t1425/puzzlecutlib3.scad>  

Thanks for all the help.





--
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: Ovals

christophe malvasio
i suggest you to code in openscad the entire objects/parts from your
view of the stl
it will make you print faster ;)
Le mer. 5 sept. 2018 à 03:03, FourthDr <[hidden email]> a écrit :

>
> The whole reason for this exercise in the first place is because I needed to
> cut the part into two to fit my printer using the pizzlecut library. I think
> I can eventually get this working since it's just basically a geometric
> shape problem.
>
> But with other models, this is a huge problem. I can't just easily redesign
> more complex designs/shapes. Especially, since I don't always have the
> original design files just an stl file. So any time there is some problem no
> matter how small with the model OpenSCAD throws a hissyfit. Sometimes I can
> "fix" the model where OpenSCAD will accept it. Bust most of the time not.
>
> Case and point, I have two models attached below that I need cut into two
> parts. They both look and preview fine. My slic3r has no problems. But when
> I try to cut them, OpenSCAD will not render them. And in worst case such as
> with the nose cone will actually crash OpenSCAD with a C++ error.
>
> It's too bad there is not a way to just cut with defects and all. It just
> needs to be accepted by a slicer and look ok to the eye. A diagnostic tool
> of some sort that could fix these problem would be great. Or that could
> point out problems and give suggestions on fixing them so OpenSCAD will
> accept the file.
>
> I'm trying to get these two attached stl files split by tomorrow. I've been
> tinkering with them for months. So far without success. Any one interested
> in seeing if they can find and correct the two files for me? And maybe give
> some tips and or suggest some software tools I have not already tried?
> Cryptic CGAL errors don't really help me find and fix what OpenSCAD is
> complaining about.
>
> back-cover-no-stand-2.stl
> <http://forum.openscad.org/file/t1425/back-cover-no-stand-2.stl>
> _LCD_face_plate_LCD_hole_open_(repaired).stl
> <http://forum.openscad.org/file/t1425/_LCD_face_plate_LCD_hole_open_%28repaired%29.stl>
> puzzlecutlib3.scad <http://forum.openscad.org/file/t1425/puzzlecutlib3.scad>
>
> Thanks for all the help.
>
>
>
>
>
> --
> 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: Ovals

ednisley
In reply to this post by FourthDr
On 09/04/2018 09:02 PM, FourthDr wrote:
> They both look and preview fine.

Meshlab shows both have the usual assortment of mesh errors and are
non-manifold: hot death on a stick for further operations.

My (admittedly limited) experience with automatic mesh repair suggests
the algorithms generally make the choices I expect, but sometimes
produce weirdly shaped patches, if not completely bizarre shapes, around
the non-manifold geometry. The fact a "repaired" STL file still contains
geometry errors shows the automation doesn't always get it right.

Agreed, OpenSCAD shouldn't fall over dead when handed a broken STL file,
but AFAICT the explosion happens deep in the CGAL machinery where it's
out of anyone's control. The only defense seems to be not handing it
non-manifold models.

Which rules out many attractive STLs scattered around the Interwebs ...

--
Ed
https://softsolder.com

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

Re: Ovals

FourthDr
In reply to this post by christophe malvasio
That's simply not possible. I don't have the ability or programming skills to
do that. I would need to have the help of some sort of automated tool to
repair any model I might need to print. Or lots of help from some one that
is highly skilled in OpenSCAD.



--
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: Ovals

nophead
In reply to this post by ednisley
Or manifold STL files with vertices closer than the OpenSCAD grid. They actually become non-manifold during import.

On 5 September 2018 at 15:46, Ed Nisley <[hidden email]> wrote:
On 09/04/2018 09:02 PM, FourthDr wrote:
They both look and preview fine.

Meshlab shows both have the usual assortment of mesh errors and are non-manifold: hot death on a stick for further operations.

My (admittedly limited) experience with automatic mesh repair suggests the algorithms generally make the choices I expect, but sometimes produce weirdly shaped patches, if not completely bizarre shapes, around the non-manifold geometry. The fact a "repaired" STL file still contains geometry errors shows the automation doesn't always get it right.

Agreed, OpenSCAD shouldn't fall over dead when handed a broken STL file, but AFAICT the explosion happens deep in the CGAL machinery where it's out of anyone's control. The only defense seems to be not handing it non-manifold models.

Which rules out many attractive STLs scattered around the Interwebs ...

--
Ed
https://softsolder.com


_______________________________________________
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: Ovals

FourthDr
This post was updated on .
In reply to this post by ednisley
What I don't understand is how it can preview a broken stl with no problem.
But a render, which you would think uses the same process fails.

There needs to be some kind of built-in utility that can tell you just where
in the mesh it is having a problems. It's impossible to figure out a
problem, if the cause it shrouded inside of a black box. There is basically
no visualization of problem areas. Or helpful error messages.

The only way I was able to see one of the major flaws in the nose cone was
when I imported it into Tinkercad and tried to slice the cone off the base.
It was then that by chance after separating the cone from the base that I
saw a ton of artifact triangles still connected to the cone-less base. Then
I knew there where major issues with the model. But OpenSCAD said nothing
about it other than crashing when I tried to render.

So once I know there are problems. What's the easiest way to identify and
repair them without being an expert. Every time I try to manually repair an
stl it breaks another part of the model in some way.



--
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: Ovals

FourthDr
This post was updated on .
In reply to this post by nophead
NopHead:

You've mentioned OpenSCAD's grid a few times before. But is that actually
documented anywhere? For example, if the designer of a model was made aware
that any export to stl needed to have triangles of a specific maximum size
there would be one less problems to deal with.

That is exactly what's needed, guide lines. Any shared stl should have the
following traits. Right now you have no idea what program the stl was
originally exported from or what settings where used.

If some one could document exact minimum traits an stl file needs to be
successfully imported, manipulated, and then exported from OpenSCAD that
would be very helpful.



--
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: Ovals

nophead
>But a render, which you would think uses the same process fails.

No preview is a totally different process to render. Preview just draws all the triangles in the correct order to show a pixel representation of the object. render calculates the geometry if there are any CSG ops (including the implict union) and then draws that. It uses the GCAL library and that expects it to be 2-manifold, without degenerate triangles.

I have never had much success with other people's STLs for 3D printing. Even if they are manifold they are often not correct for 3D printing on my machines. I mostly design everything I print from scratch in OpenSCAD.

On 5 September 2018 at 16:28, FourthDr <[hidden email]> wrote:
NopHead:

You've mentioned OpenSCAD's grid a few times before. But is that actually
documented anywhere? For example, if the designer of a model was made aware
that any export to stl needed to have triangles of a specific maximum size
there would be one less problem to deal with.

That is exactly what's needed, guide lines. Any shared stl should have the
following traits. Right now you have no idea what program the stl was
originally exported from or what settings where used.

If some one could document exact minimum traits an stl file needs to be
successfully imported, manipulated, and then exported from OpenSCAD that
would be very helpful.



--
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
12