OpenSCAD External Editors

145 views
Skip to first unread message

jorwex

unread,
Apr 15, 2014, 10:31:17 PM4/15/14
to Bay Area RepRap
Elliot,

I could have sworn I saw you using OpenSCAD during one of the meetings with a VIM-like editor on the left, and the console on the right in the same window.

Am I dreaming? Were you just switching between a VIM session and the OpenSCAD IDE with the "Hide Editor" option? 

Or perhaps have two windows side by side? 

Thanks,
Jordan W

Elliot

unread,
Apr 15, 2014, 11:50:18 PM4/15/14
to bay-are...@googlegroups.com

You saw two windows side by side: gvim and the render view of openscad, with the editor portion hidden as you guessed.

I use an excellent tiling window manager on Linux called i3:

http://i3wm.org

--
You received this message because you are subscribed to the Google Groups "Bay Area RepRap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bay-area-repr...@googlegroups.com.
To post to this group, send email to bay-are...@googlegroups.com.
Visit this group at http://groups.google.com/group/bay-area-reprap.
For more options, visit https://groups.google.com/d/optout.

Elliot

unread,
Apr 17, 2014, 10:55:04 AM4/17/14
to bay-are...@googlegroups.com
I forgot to mention: the only thing that you need to do is to check
"Automatic reload and compile" under "design" -- that will have
OpenSCAD stat the file(s) and reload on change.

It does have some a "gotcha" or two, mostly around sometimes OpenSCAD
only stats the file it has open, and not its dependents. The quick
solution to that is to `touch` or `write` the file that OpenSCAD is
watching rather than the file you're working on. Usually it's only a
problem when the file being rendered has a syntax error somewhere.

I don't know if that makes any sense, but hopefully it will help.

jorwex

unread,
Apr 17, 2014, 10:58:39 AM4/17/14
to bay-are...@googlegroups.com
That does. Thanks for the tip!

Been reading a lot about OpenSCAD. Haven't tried a whole lot yet. Are there any particularly good online resources that you've found or refer to regularly?


--
Jordan W

Elliot

unread,
Apr 17, 2014, 12:20:29 PM4/17/14
to bay-are...@googlegroups.com
Jordan,

I spent a fair amount of my time in college not going to class and
instead learning how to write code/html and use POVray (
http://www.povray.org/ ) which are rather similar, so it was oddly
familiar to me after all the years.

Other than that, I looked through:

* whosawhatsis' (praised be his name) wallace openscad:
https://github.com/whosawhatsis/RepRap-Wallace
* nophead's (praised be his name) mendel90 openscad:
https://github.com/nophead/Mendel90/tree/master/scad

Advice I can give:

* When you can, use module()s. I think that's the best advice that I
can give to avoid a spaghetti mess. If you've done software
development, much of it is applicable to openscad.
* When you can, separate the positive and negative of parts in a
module: https://github.com/elliotf/reprap-cold-end-bowden-retainer/blob/master/retainer.scad#L22
* When you can, separate the positioning of an object (module) from
the object itself.
* For larger projects, use multiple files.
* When you can, pull out most of attributes of an object (size,
position). This makes it easier to make parametric designs, change
the objects, and reposition elements
* If you're making holes, use the whosawhatsis (praised be his name)
technique of sizing them, which I abstracted out into a module:
https://github.com/elliotf/reprap-cold-end-bowden-retainer/blob/master/retainer.scad#L16
OpenSCAD sizes cylinders to fit *inside* the radius that you specify.
This module sizes the cylinder to fit *around* the diameter that you
specify. You'll still probably need a little bit of extra room,
though.
* If you're making holes that will be printed non-vertically, use
hexagonal or octagonal holes and rotate them so the cylinders are
lying on their flats. This minimizes overhang. Example:
https://github.com/elliotf/reprap-guitar-mount/blob/master/hook.scad#L58
To get the amount that you should rotate it, divide 180 by the number
of sides (180/6 = 30, 180/8 = 22.5)
* Be careful to not re-declare variables in the global scope. This
leads to *very* hard to find bugs.

I didn't plan on writing that much. The parametric graber (
https://github.com/elliotf/parametric-graber ) has some of the
learnings I've come across and it's a lot simpler than nophead's
(praised be his name) mendel90 because he's doing a *lot* more than I
am. Much of what i've learned came from the mendel90 and wallace
openscad source.

You could also probably talk to Jim M, as he has a number of projects
using openscad and seems to be a sharp, experienced guy.

Bill R talked at one point about me doing a class on how to openscad,
so maybe that will happen if/when I get back to the reprap meetings if
there is still interest.

If you figure out how to write tests for openscad, please let me know. :)

Elliot

jorwex

unread,
Apr 17, 2014, 5:33:44 PM4/17/14
to bay-are...@googlegroups.com
Wow thanks for the tips. Will look into your links more tonight. 

There are a few projects that I want to modify that aren't in .scad format, namely this guy:

I want to update the model's X axis smooth bar distance for our printer. The op on that thread has files in STL, but he adapted the model from another poster's project (http://www.printrbottalk.com/forum/viewtopic.php?f=89&t=5080) which has a .scad linked. 

I have installed Sketchup/Wine, Blender, FreeCAD, and OpenSCAD. 

Would anyone be able to suggest what the quickest path to success is?:
1) Edit the STL
2) Make many changes to the original .scad
3) Some combination of a STL/scad format conversion + edits

Jordan 
--
Jordan W

Elliot

unread,
Apr 17, 2014, 8:54:04 PM4/17/14
to bay-are...@googlegroups.com

Modify the scad would be my recommendation, but I haven't seen the scad. If it's written portly it might be hard, but it would still be easier than modifying an stl.

jorwex

unread,
Apr 21, 2014, 3:12:22 AM4/21/14
to bay-are...@googlegroups.com
When you are crafting a SCAD, let's say you have performed a number of transformations, differences, rotations, etc ... and you simply want to confirm the length of a specific portion of your model. 

How do you do that? Would you import it to another program and measure it there? 

I know how to do this with Sketchup -- I'm familiar with it for architectural purposes, but Im trying to not rely on it as its Windows/Mac only and may not be the best solution to these types of problems. 

Thanks,
--
Jordan W

jorwex

unread,
Apr 23, 2014, 4:36:58 PM4/23/14
to bay-are...@googlegroups.com
Sort of round about, but I have been exporting to STL format and then measuring with FreeCAD. 

There is also a scad ruler type model on Thingyverse that you can add to openscad projects for reference. 

Maybe there is a simpler way?
--
Jordan W



--
Jordan W

Elliot

unread,
Apr 23, 2014, 4:44:00 PM4/23/14
to bay-are...@googlegroups.com
I used to complain about not being able to measure things in openscad.
It was one of my only pet peeves about openscad. Now I just don't
worry about it as much. For whatever reason, I'm now better at
positioning and sizing objects based on inputs, so I am able to know
how far/long/wide/tall/etc things are by doing calculations on their
attributes. "How far away are these things? Easy: their position
minus their width."

I don't know if that makes sense, but it's something that I no longer
feel a need for.

If you're importing STLs and trying to modify them in openscad, then
measuring is *definitely* a problem. The time that I did that, I
superimposed the imported STL with the item that I was writing in
openscad, and spent an unpleasantly long amount of time lining them up
and making them the correct size. I don't think I'll do that again.
Reply all
Reply to author
Forward
0 new messages