discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

OpenSCAD Instructable

S
sgraves
Fri, Jul 17, 2015 12:02 AM

I have written an OpenSCAD Instructable.  I teach a class at Tampa
Hackerspace called "OpenSCAD Introduction".  I have a different take on the
OpenSCAD syntax.  I have found that my approach is very useful in getting
people to "grok" OpenSCAD.

Heck, it even helps me "grok" OpenSCAD.  With this model in my head I know
what is going to happen in my code.  Particularly with the variables and
control blocks.

I thought I would share it with the OpenSCAD community and see what you
think.

http://www.instructables.com/id/OpenSCAD-The-Instructable/
http://www.instructables.com/id/OpenSCAD-The-Instructable/

Steve

--
View this message in context: http://forum.openscad.org/OpenSCAD-Instructable-tp13202.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

I have written an OpenSCAD Instructable. I teach a class at Tampa Hackerspace called "OpenSCAD Introduction". I have a different take on the OpenSCAD syntax. I have found that my approach is very useful in getting people to "grok" OpenSCAD. Heck, it even helps me "grok" OpenSCAD. With this model in my head I know what is going to happen in my code. Particularly with the variables and control blocks. I thought I would share it with the OpenSCAD community and see what you think. http://www.instructables.com/id/OpenSCAD-The-Instructable/ <http://www.instructables.com/id/OpenSCAD-The-Instructable/> Steve -- View this message in context: http://forum.openscad.org/OpenSCAD-Instructable-tp13202.html Sent from the OpenSCAD mailing list archive at Nabble.com.
M
MichaelAtOz
Fri, Jul 17, 2015 1:07 AM

That's quite a good intro.

I'd suggest it is focused on people who have some coding background as you
are using concepts that the average Joe would not be familiar. You may want
to have a disclaimer at the start saying it is intended for people with some
experience. ??

You may want to include vectors in the very early section, you use them
without explaining them until mid way. Explain that the [x,y,x] is just one
case of a vector.

Also some mention that 2D and 3D and two different contexts and shouldn't be
mixed.

The concept of a tree structure is a good way to explain the if/else and for
loops, showing that they are not loops, but an unwinding into a tree
structure, each node defines the scope and hence is why they can each have
different values of i, for example.

Maybe use trees to indicate why a=a+1; doesn't make sense in OpenSCAD,
hammering that out of procedural programmers is a key to grokking it.

Thanks for sharing the shell() module, that will be handy, I hadn't thought
of doing hollows that way. The text() shim is also a nice idea.


Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”  Fight it! http://www.ourfairdeal.org/

View this message in context: http://forum.openscad.org/OpenSCAD-Instructable-tp13202p13203.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

That's quite a good intro. I'd suggest it is focused on people who have some coding background as you are using concepts that the average Joe would not be familiar. You may want to have a disclaimer at the start saying it is intended for people with some experience. ?? You may want to include vectors in the very early section, you use them without explaining them until mid way. Explain that the [x,y,x] is just one case of a vector. Also some mention that 2D and 3D and two different contexts and shouldn't be mixed. The concept of a tree structure is a good way to explain the if/else and for loops, showing that they are not loops, but an unwinding into a tree structure, each node defines the scope and hence is why they can each have different values of i, for example. Maybe use trees to indicate why a=a+1; doesn't make sense in OpenSCAD, hammering that out of procedural programmers is a key to grokking it. Thanks for sharing the shell() module, that will be handy, I hadn't thought of doing hollows that way. The text() shim is also a nice idea. ----- Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above. The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ -- View this message in context: http://forum.openscad.org/OpenSCAD-Instructable-tp13202p13203.html Sent from the OpenSCAD mailing list archive at Nabble.com.
S
sgraves
Fri, Jul 17, 2015 1:37 AM

@MichaelAtOz,
Thanks for the input.  The shell surrounds a shape with a shell that is
thickness greater.  The outside dimensions increase by thickness.

The attached file hollows out a shape leaving a wall of thickness.  The
outside dimensions remain the same.

hollow.scad http://forum.openscad.org/file/n13205/hollow.scad

BTW, a sphere in the minkowski gives a truer offset but can be v e r y  s l
o w.

Steve

--
View this message in context: http://forum.openscad.org/OpenSCAD-Instructable-tp13202p13205.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

@MichaelAtOz, Thanks for the input. The shell surrounds a shape with a shell that is thickness greater. The outside dimensions increase by thickness. The attached file hollows out a shape leaving a wall of thickness. The outside dimensions remain the same. hollow.scad <http://forum.openscad.org/file/n13205/hollow.scad> BTW, a sphere in the minkowski gives a truer offset but can be v e r y s l o w. Steve -- View this message in context: http://forum.openscad.org/OpenSCAD-Instructable-tp13202p13205.html Sent from the OpenSCAD mailing list archive at Nabble.com.
M
MichaelAtOz
Fri, Jul 17, 2015 1:56 AM

Thanks for that too. It doesn't preview very well tho.


Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”  Fight it! http://www.ourfairdeal.org/

View this message in context: http://forum.openscad.org/OpenSCAD-Instructable-tp13202p13206.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Thanks for that too. It doesn't preview very well tho. ----- Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above. The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ -- View this message in context: http://forum.openscad.org/OpenSCAD-Instructable-tp13202p13206.html Sent from the OpenSCAD mailing list archive at Nabble.com.
TH
Tim Hawkins
Fri, Jul 17, 2015 11:13 AM

As a matter of styling, all of the text of the instrutable's examples is
only shown as screen shots, it makes it hard to read and impossible to cut
and paste into openscad to play with the example.

It would be better to show the text as quoted text in the html.

On Fri, Jul 17, 2015, 08:02 sgraves sgraves@gte.net wrote:

I have written an OpenSCAD Instructable.  I teach a class at Tampa
Hackerspace called "OpenSCAD Introduction".  I have a different take on the
OpenSCAD syntax.  I have found that my approach is very useful in getting
people to "grok" OpenSCAD.

Heck, it even helps me "grok" OpenSCAD.  With this model in my head I know
what is going to happen in my code.  Particularly with the variables and
control blocks.

I thought I would share it with the OpenSCAD community and see what you
think.

http://www.instructables.com/id/OpenSCAD-The-Instructable/
http://www.instructables.com/id/OpenSCAD-The-Instructable/

Steve

--
View this message in context:
http://forum.openscad.org/OpenSCAD-Instructable-tp13202.html
Sent from the OpenSCAD mailing list archive at Nabble.com.


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

As a matter of styling, all of the text of the instrutable's examples is only shown as screen shots, it makes it hard to read and impossible to cut and paste into openscad to play with the example. It would be better to show the text as quoted text in the html. On Fri, Jul 17, 2015, 08:02 sgraves <sgraves@gte.net> wrote: > I have written an OpenSCAD Instructable. I teach a class at Tampa > Hackerspace called "OpenSCAD Introduction". I have a different take on the > OpenSCAD syntax. I have found that my approach is very useful in getting > people to "grok" OpenSCAD. > > Heck, it even helps me "grok" OpenSCAD. With this model in my head I know > what is going to happen in my code. Particularly with the variables and > control blocks. > > I thought I would share it with the OpenSCAD community and see what you > think. > > http://www.instructables.com/id/OpenSCAD-The-Instructable/ > <http://www.instructables.com/id/OpenSCAD-The-Instructable/> > > Steve > > > > -- > View this message in context: > http://forum.openscad.org/OpenSCAD-Instructable-tp13202.html > Sent from the OpenSCAD mailing list archive at Nabble.com. > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
S
sgraves
Fri, Jul 17, 2015 4:12 PM

Tim,
There should be links to the code itself.  One can download it and follow
along in OpenSCAD itself.

Is there a link I have missed? I have links to

Transformations.scad
CSG_Tree.scad
Hull.scad
Minkowski.scad
shell.scad
minkowski_text.scad
scope.scad

I don't think a show a picture of code that is not in one of those files.

I want the reader to understand the power of the "!" modifier.  It is not
only useful for understanding how solids move through the tree. It is very
useful for understanding other people's code.  I feel compelled here to give
a shout out to one of my heroes, Nophead.  I have analyzed a lot of his code
using the "!" modifier.

Steve

--
View this message in context: http://forum.openscad.org/OpenSCAD-Instructable-tp13202p13209.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Tim, There should be links to the code itself. One can download it and follow along in OpenSCAD itself. Is there a link I have missed? I have links to Transformations.scad CSG_Tree.scad Hull.scad Minkowski.scad shell.scad minkowski_text.scad scope.scad I don't think a show a picture of code that is not in one of those files. I want the reader to understand the power of the "!" modifier. It is not only useful for understanding how solids move through the tree. It is very useful for understanding other people's code. I feel compelled here to give a shout out to one of my heroes, Nophead. I have analyzed a lot of his code using the "!" modifier. Steve -- View this message in context: http://forum.openscad.org/OpenSCAD-Instructable-tp13202p13209.html Sent from the OpenSCAD mailing list archive at Nabble.com.
DM
doug moen
Fri, Jul 17, 2015 6:31 PM

That's cool, I learned some new techniques for using Minkowski sum. Thanks.

On 16 July 2015 at 20:02, sgraves sgraves@gte.net wrote:

I have written an OpenSCAD Instructable.  I teach a class at Tampa
Hackerspace called "OpenSCAD Introduction".  I have a different take on the
OpenSCAD syntax.  I have found that my approach is very useful in getting
people to "grok" OpenSCAD.

Heck, it even helps me "grok" OpenSCAD.  With this model in my head I know
what is going to happen in my code.  Particularly with the variables and
control blocks.

I thought I would share it with the OpenSCAD community and see what you
think.

http://www.instructables.com/id/OpenSCAD-The-Instructable/
http://www.instructables.com/id/OpenSCAD-The-Instructable/

Steve

--
View this message in context:
http://forum.openscad.org/OpenSCAD-Instructable-tp13202.html
Sent from the OpenSCAD mailing list archive at Nabble.com.


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

That's cool, I learned some new techniques for using Minkowski sum. Thanks. On 16 July 2015 at 20:02, sgraves <sgraves@gte.net> wrote: > I have written an OpenSCAD Instructable. I teach a class at Tampa > Hackerspace called "OpenSCAD Introduction". I have a different take on the > OpenSCAD syntax. I have found that my approach is very useful in getting > people to "grok" OpenSCAD. > > Heck, it even helps me "grok" OpenSCAD. With this model in my head I know > what is going to happen in my code. Particularly with the variables and > control blocks. > > I thought I would share it with the OpenSCAD community and see what you > think. > > http://www.instructables.com/id/OpenSCAD-The-Instructable/ > <http://www.instructables.com/id/OpenSCAD-The-Instructable/> > > Steve > > > > -- > View this message in context: > http://forum.openscad.org/OpenSCAD-Instructable-tp13202.html > Sent from the OpenSCAD mailing list archive at Nabble.com. > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > >
S
sgraves
Fri, Jul 17, 2015 9:46 PM

Doug,
Thanks!  Did you get the hollow.scad I posted for Michael above?  If you do
a minkowski on the shell, it adds to the inner surface.  If you then do an
intersection with the original shape you get a hollow object the same size
as the original.  As Michael pointed out it doesn't preview very well.  The
two minkowskis seem to get the preview confused.

Steve

doug.moen wrote

That's cool, I learned some new techniques for using Minkowski sum.
Thanks.

On 16 July 2015 at 20:02, sgraves <

sgraves@

> wrote:

I have written an OpenSCAD Instructable.  I teach a class at Tampa
Hackerspace called "OpenSCAD Introduction".  I have a different take on
the
OpenSCAD syntax.  I have found that my approach is very useful in getting
people to "grok" OpenSCAD.

Heck, it even helps me "grok" OpenSCAD.  With this model in my head I
know
what is going to happen in my code.  Particularly with the variables and
control blocks.

I thought I would share it with the OpenSCAD community and see what you
think.

http://www.instructables.com/id/OpenSCAD-The-Instructable/
<http://www.instructables.com/id/OpenSCAD-The-Instructable/>

Steve

--
View this message in context:
http://forum.openscad.org/OpenSCAD-Instructable-tp13202.html
Sent from the OpenSCAD mailing list archive at Nabble.com.


OpenSCAD mailing list

Discuss@.openscad

Discuss@.openscad

--
View this message in context: http://forum.openscad.org/OpenSCAD-Instructable-tp13202p13215.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Doug, Thanks! Did you get the hollow.scad I posted for Michael above? If you do a minkowski on the shell, it adds to the inner surface. If you then do an intersection with the original shape you get a hollow object the same size as the original. As Michael pointed out it doesn't preview very well. The two minkowskis seem to get the preview confused. Steve doug.moen wrote > That's cool, I learned some new techniques for using Minkowski sum. > Thanks. > > On 16 July 2015 at 20:02, sgraves &lt; > sgraves@ > &gt; wrote: > >> I have written an OpenSCAD Instructable. I teach a class at Tampa >> Hackerspace called "OpenSCAD Introduction". I have a different take on >> the >> OpenSCAD syntax. I have found that my approach is very useful in getting >> people to "grok" OpenSCAD. >> >> Heck, it even helps me "grok" OpenSCAD. With this model in my head I >> know >> what is going to happen in my code. Particularly with the variables and >> control blocks. >> >> I thought I would share it with the OpenSCAD community and see what you >> think. >> >> http://www.instructables.com/id/OpenSCAD-The-Instructable/ >> &lt;http://www.instructables.com/id/OpenSCAD-The-Instructable/&gt; >> >> Steve >> >> >> >> -- >> View this message in context: >> http://forum.openscad.org/OpenSCAD-Instructable-tp13202.html >> Sent from the OpenSCAD mailing list archive at Nabble.com. >> >> _______________________________________________ >> OpenSCAD mailing list >> > Discuss@.openscad >> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >> >> > > _______________________________________________ > OpenSCAD mailing list > Discuss@.openscad > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org -- View this message in context: http://forum.openscad.org/OpenSCAD-Instructable-tp13202p13215.html Sent from the OpenSCAD mailing list archive at Nabble.com.