openSCAD learning resource

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

openSCAD learning resource

Eric Matthes
Hello Everyone,

I have been a longtime lurker on this list.  I teach high school math and science in southeast Alaska, and I have been introducing students to modeling with openSCAD from time to time.  This is a wonderful piece of software for use in a math class; students get to do something they never thought they could do, and with the use of parameters they use algebraic concepts in a way they never thought of before.

I have written a summary of the openscad basics, which I use to introduce non-technical students to the language.  I love the openscad documentation, but students who have no background in programming are a bit intimidated by it.  I don't expect this  resource to be of much direct use to most people on this list, but it may be a meaningful reference for some who ask you questions about getting started with openSCAD.  If anyone catches any misunderstandings on my part, I will happily revise what I have written.


If this comes across as spammy, I sincerely apologize.

Eric Matthes
Pacific High School
Sitka, AK
Reply | Threaded
Open this post in threaded view
|

Re: openSCAD learning resource

kintel
Administrator
On 2013-01-14, at 10:43 , Eric Matthes wrote:
>
> http://peak5390.wordpress.com/2013/01/08/an-introduction-to-3d-modeling-with-openscad-openscad-basics/
>
Thanks a lot!
Tutorials for non-programmers are an important gateway for new OpenSCAD users - I've linked to your post from http://openscad.org.

Cheers,

 -Marius



Reply | Threaded
Open this post in threaded view
|

Re: openSCAD learning resource

Brent Burton
In reply to this post by Eric Matthes
Eric, not spammy at all.

With the interest in and need for STEM educational topics, I think using OpenSCAD in this way is a great idea! You summary is a good introduction to the OpenSCAD system.

You mention 3d printing twice in your summary. Do you have access to a 3d printer, and do you utilize it to solidify (no pun intended) these abstract concepts?

-Brent
Reply | Threaded
Open this post in threaded view
|

Re: openSCAD learning resource

donbright
In reply to this post by Eric Matthes


On Mon, Jan 14, 2013 at 9:43 AM, Eric Matthes <[hidden email]> wrote:
Hello Everyone,

I have been a longtime lurker on this list.  I teach high school math and science in southeast Alaska, and I have been introducing students to modeling with openSCAD from time to time.  This is a wonderful piece of software for use in a math class; students get to do something they never thought they could do, and with the use of parameters they use algebraic concepts in a way they never thought of before.

I have written a summary of the openscad basics, which I use to introduce non-technical students to the language.  I love the openscad documentation, but students who have no background in programming are a bit intimidated by it.  I don't expect this  resource to be of much direct use to most people on this list, but it may be a meaningful reference for some who ask you questions about getting started with openSCAD.  If anyone catches any misunderstandings on my part, I will happily revise what I have written.


If this comes across as spammy, I sincerely apologize.

Eric Matthes
Pacific High School
Sitka, AK

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


This is great!!!

One thing though that I have always wondered about is brought up in your article.

"There is a zero overlap between the outer and inner cylinders, which creates a “skin” of thickness 0. This is a bad thing in modeling, and will result in errors when trying to render or upload to a 3d printer. Using parameters demonstrates a good approach to this issue:"

I used to believe this too.... but over time I have come to wonder if these 'skin' cases are just rendering bugs in OpenSCAD's OpenCSG and Throwntogether 'quick preview' renderers.... due to OpenGL z-fighting ( http://en.wikipedia.org/wiki/Z-fighting ) ... there is even a line in the docs/TODO.txt file about maybe fixing this in OpenCSG. In these situations the CGAL renderer (f6), which calculates 3d points, doesn't have the skin.

The clearest example I can think of is to do a CGAL (f6) render on something like this

difference() { cube();cube(); }

CGAL gives the correct answer ( 0 ), but OpenCSG gives the answer "big green box".

How this relates to problems of Manifoldness --- i cannot be sure....

-DB


Reply | Threaded
Open this post in threaded view
|

Re: openSCAD learning resource

terramir
not spammy at all I'll be reading the thing, I could have used it five months ago though lol
terramir

On Mon, Jan 14, 2013 at 5:44 PM, Don Bright <[hidden email]> wrote:


On Mon, Jan 14, 2013 at 9:43 AM, Eric Matthes <[hidden email]> wrote:
Hello Everyone,

I have been a longtime lurker on this list.  I teach high school math and science in southeast Alaska, and I have been introducing students to modeling with openSCAD from time to time.  This is a wonderful piece of software for use in a math class; students get to do something they never thought they could do, and with the use of parameters they use algebraic concepts in a way they never thought of before.

I have written a summary of the openscad basics, which I use to introduce non-technical students to the language.  I love the openscad documentation, but students who have no background in programming are a bit intimidated by it.  I don't expect this  resource to be of much direct use to most people on this list, but it may be a meaningful reference for some who ask you questions about getting started with openSCAD.  If anyone catches any misunderstandings on my part, I will happily revise what I have written.


If this comes across as spammy, I sincerely apologize.

Eric Matthes
Pacific High School
Sitka, AK

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


This is great!!!

One thing though that I have always wondered about is brought up in your article.

"There is a zero overlap between the outer and inner cylinders, which creates a “skin” of thickness 0. This is a bad thing in modeling, and will result in errors when trying to render or upload to a 3d printer. Using parameters demonstrates a good approach to this issue:"

I used to believe this too.... but over time I have come to wonder if these 'skin' cases are just rendering bugs in OpenSCAD's OpenCSG and Throwntogether 'quick preview' renderers.... due to OpenGL z-fighting ( http://en.wikipedia.org/wiki/Z-fighting ) ... there is even a line in the docs/TODO.txt file about maybe fixing this in OpenCSG. In these situations the CGAL renderer (f6), which calculates 3d points, doesn't have the skin.

The clearest example I can think of is to do a CGAL (f6) render on something like this

difference() { cube();cube(); }

CGAL gives the correct answer ( 0 ), but OpenCSG gives the answer "big green box".

How this relates to problems of Manifoldness --- i cannot be sure....

-DB



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566



--
Respectfully,
R. Daniel Borkan
727 S. Coronado St. 201
Los Angeles, CA 90057
H: (213) 739-1863
C: (213) 271-6721
Reply | Threaded
Open this post in threaded view
|

Re: openSCAD learning resource

Peter Shenkin
In reply to this post by Eric Matthes
Eric,

Your intro is very nice. I've just posted it to the hackmanhattan.com
mailing list, as we have a few members and visitors who would like to
learn more about OpenSCAD but who may feel a little intimidated before
getting started.

Cheers,
-P.

P.S. For an intermediate-level, fully parametric OpenSCAD design for
something that is actually useful, some of your students might enjoy
looking at the following posting of mine:
http://www.thingiverse.com/thing:40343.

Reply | Threaded
Open this post in threaded view
|

Re: openSCAD learning resource

Eric Matthes
In reply to this post by donbright
When I have done more complicated models, the time savings in working with compiled models vs. renders has made it worthwhile to create an overlap.  If anyone can clarify whether having a zero overlap actually causes an error for printing, I will revise the reasoning for including an overlap.

- Eric


On Mon, Jan 14, 2013 at 4:44 PM, Don Bright <[hidden email]> wrote:


On Mon, Jan 14, 2013 at 9:43 AM, Eric Matthes <[hidden email]> wrote:
Hello Everyone,

I have been a longtime lurker on this list.  I teach high school math and science in southeast Alaska, and I have been introducing students to modeling with openSCAD from time to time.  This is a wonderful piece of software for use in a math class; students get to do something they never thought they could do, and with the use of parameters they use algebraic concepts in a way they never thought of before.

I have written a summary of the openscad basics, which I use to introduce non-technical students to the language.  I love the openscad documentation, but students who have no background in programming are a bit intimidated by it.  I don't expect this  resource to be of much direct use to most people on this list, but it may be a meaningful reference for some who ask you questions about getting started with openSCAD.  If anyone catches any misunderstandings on my part, I will happily revise what I have written.


If this comes across as spammy, I sincerely apologize.

Eric Matthes
Pacific High School
Sitka, AK

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


This is great!!!

One thing though that I have always wondered about is brought up in your article.

"There is a zero overlap between the outer and inner cylinders, which creates a “skin” of thickness 0. This is a bad thing in modeling, and will result in errors when trying to render or upload to a 3d printer. Using parameters demonstrates a good approach to this issue:"

I used to believe this too.... but over time I have come to wonder if these 'skin' cases are just rendering bugs in OpenSCAD's OpenCSG and Throwntogether 'quick preview' renderers.... due to OpenGL z-fighting ( http://en.wikipedia.org/wiki/Z-fighting ) ... there is even a line in the docs/TODO.txt file about maybe fixing this in OpenCSG. In these situations the CGAL renderer (f6), which calculates 3d points, doesn't have the skin.

The clearest example I can think of is to do a CGAL (f6) render on something like this

difference() { cube();cube(); }

CGAL gives the correct answer ( 0 ), but OpenCSG gives the answer "big green box".

How this relates to problems of Manifoldness --- i cannot be sure....

-DB



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566

Reply | Threaded
Open this post in threaded view
|

Re: openSCAD learning resource

Eric Matthes
In reply to this post by Eric Matthes
I was subscribed to the digest version of the list, so I'm not sure this will post properly.  But thank you to Brent and everyone else for the positive feedback.

I got interested in 3d modeling after reading a Wired article a year or two ago.  I printed my first few objects through shapeways.  Last year another school in my district got a 3d printer, so I will start taking students to that school to do some printing.  Students are pretty excited to see the printer in action.  I would love to have students printing prototypes locally, and uploading refined models to shapeways.

- Eric


---------- Forwarded message ----------
From: Brent Burton <[hidden email]>
To: [hidden email]
Cc: 
Date: Mon, 14 Jan 2013 10:19:19 -0600
Subject: Re: [OpenSCAD] openSCAD learning resource
Eric, not spammy at all.

With the interest in and need for STEM educational topics, I think using OpenSCAD in this way is a great idea! You summary is a good introduction to the OpenSCAD system.

You mention 3d printing twice in your summary. Do you have access to a 3d printer, and do you utilize it to solidify (no pun intended) these abstract concepts?

-Brent
Reply | Threaded
Open this post in threaded view
|

Re: openSCAD learning resource

nophead
I have definitely had non-manifold STLs from openscad that were fixed by adding an overlap so I don't think F6 always gets it right. It get more things right than F5 though.

On 15 January 2013 10:24, Eric Matthes <[hidden email]> wrote:
I was subscribed to the digest version of the list, so I'm not sure this will post properly.  But thank you to Brent and everyone else for the positive feedback.

I got interested in 3d modeling after reading a Wired article a year or two ago.  I printed my first few objects through shapeways.  Last year another school in my district got a 3d printer, so I will start taking students to that school to do some printing.  Students are pretty excited to see the printer in action.  I would love to have students printing prototypes locally, and uploading refined models to shapeways.

- Eric



---------- Forwarded message ----------
From: Brent Burton <[hidden email]>
To: [hidden email]
Cc: 
Date: Mon, 14 Jan 2013 10:19:19 -0600
Subject: Re: [OpenSCAD] openSCAD learning resource
Eric, not spammy at all.

With the interest in and need for STEM educational topics, I think using OpenSCAD in this way is a great idea! You summary is a good introduction to the OpenSCAD system.

You mention 3d printing twice in your summary. Do you have access to a 3d printer, and do you utilize it to solidify (no pun intended) these abstract concepts?

-Brent

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566

Reply | Threaded
Open this post in threaded view
|

Re: openSCAD learning resource

Giles Bathgate-2
I remember doing some comparison for this between openscad and RapCAD. I haven't been able to replicate the problem of non manifold STL's being generated with a difference operation when two faces are co-planar, the non-manifold problem only arises when two shapes share an edge. I think the reason might be because I am not using an alignment grid (grid3d in grid.h), or it might be because I use an epec kernel, or both.

Either way, its certainly much slower to calculate differences when faces are co-planar so doing it the way you describe in your tutorial is good idea.

On 15 January 2013 11:24, nop head <[hidden email]> wrote:
I have definitely had non-manifold STLs from openscad that were fixed by adding an overlap so I don't think F6 always gets it right. It get more things right than F5 though.


Do you have an example scad that does this? both before and after fix?

Regards,
Giles
Reply | Threaded
Open this post in threaded view
|

Re: openSCAD learning resource

nophead
This STL is non-manifold: https://github.com/nophead/Mendel90/blob/5dec97a31169550deaea77520bb0697951b93cf4/sturdy/stls/y_belt_anchor.stl

Later versions fixed it. It was caused by the vertex of a nut trap being coincident with a face.

On 15 January 2013 14:24, Giles Bathgate <[hidden email]> wrote:
I remember doing some comparison for this between openscad and RapCAD. I haven't been able to replicate the problem of non manifold STL's being generated with a difference operation when two faces are co-planar, the non-manifold problem only arises when two shapes share an edge. I think the reason might be because I am not using an alignment grid (grid3d in grid.h), or it might be because I use an epec kernel, or both.

Either way, its certainly much slower to calculate differences when faces are co-planar so doing it the way you describe in your tutorial is good idea.

On 15 January 2013 11:24, nop head <[hidden email]> wrote:
I have definitely had non-manifold STLs from openscad that were fixed by adding an overlap so I don't think F6 always gets it right. It get more things right than F5 though.


Do you have an example scad that does this? both before and after fix?

Regards,
Giles

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566

Reply | Threaded
Open this post in threaded view
|

Re: openSCAD learning resource

donbright
In reply to this post by Giles Bathgate-2
Thats very interesting... Have you ever had any situations where you wished you had the alignment grid? Or where OpenSCAD works better because of it's grid than RapCAD?


On Tue, Jan 15, 2013 at 8:24 AM, Giles Bathgate <[hidden email]> wrote:
I remember doing some comparison for this between openscad and RapCAD. I haven't been able to replicate the problem of non manifold STL's being generated with a difference operation when two faces are co-planar, the non-manifold problem only arises when two shapes share an edge. I think the reason might be because I am not using an alignment grid (grid3d in grid.h), or it might be because I use an epec kernel, or both.

Either way, its certainly much slower to calculate differences when faces are co-planar so doing it the way you describe in your tutorial is good idea.

On 15 January 2013 11:24, nop head <[hidden email]> wrote:
I have definitely had non-manifold STLs from openscad that were fixed by adding an overlap so I don't think F6 always gets it right. It get more things right than F5 though.


Do you have an example scad that does this? both before and after fix?

Regards,
Giles

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566

Reply | Threaded
Open this post in threaded view
|

Re: openSCAD learning resource

Giles Bathgate-2


On 16 January 2013 00:04, Don Bright <[hidden email]> wrote:
Thats very interesting... Have you ever had any situations where you wished you had the alignment grid? Or where OpenSCAD works better because of it's grid than RapCAD? 

I have never understood the motivation for the alignment grid in openscad.  One requirement of creating CGAL primitives using a subclass of CGAL::Modifier_base<CGAL::HalfedgeDS> and the CGAL::Polyhedron_incremental_builder_3<CGAL::HalfedgeDS>, is to first add all the vertexes to the builder using add_vertex(p); (where p is a CGAL::Point3) , then once all the points have been added to the builder you use add_vertex_to_facet(index), where index is the index of the vertex. As far as I can tell within openscad the grid3d class implements a kind of 3d hash table using doubles. I think if you google 3d point hash table, you will find that the approach is what you would expect especially if you are using doubles because of inherent rounding errors.  What I do in RapCAD is use a QList<CGAL::Point3> internally this then uses the overridden compare operator on CGAL::Point3, so its doing equality checks using GMPq numbers (arbitrary precision not doubles), I then take the IndexOf() on QList for the add_vertex_to_facet index.


The disadvantage I can think of is that it might require more memory to store two points that were very close together, or it might be slower to look the points up in the list, but I haven't noticed significant performance problems or memory problems related to this.

Regards,
Giles
Reply | Threaded
Open this post in threaded view
|

Re: openSCAD learning resource

Giles Bathgate-2
On 16 January 2013 09:56, Giles Bathgate <[hidden email]> wrote:


Clifford's implementation was somewhat similar to what I do (except he is still using doubles)


The Grid3d/Grid2d API was introduced. My main problem with it is the implementation of the has method in Grid3d.h which also uses Round and resolution.

I think I first came across this whole thing when I was trying to create a nut trap and because I had to define the radius instead of the apothem, I found that when I zoom in on the union of a hexagon and a cube, there was always a small error, even when I corrected my value down to the nearest 0.000001 

For example in the following script.

pi=3.1415926535897932385;

sides=6;

apothem=5;

radius=apothem/cos(pi/sides);

cylinder(r=radius,h=2,$fn=sides);

cube([10,10,1],center=true);


The accuracy can be improved depending on how accurate your definition of PI is and the  result from cos(pi/sides)  In Rapcad the limitation is the accuracy of a double. In Openscad the accuracy is much less because of the rounding to 0.000001. In previous versions I think it was at 0.001 but Marius improved this by adding Grid_Fine, is that right Marius? (which might explain why in previous versions some STL's had problems and now they dont?)

Regards,
Giles