Cool End

91 views
Skip to first unread message

Brian Baker

unread,
Oct 3, 2012, 1:01:13 AM10/3/12
to sect...@googlegroups.com
Here's the development URL for Cool End, the web-based OpenSCAD / JSCAD editor I talked about tonight:


It's pretty buggy right now, and hasn't been tested to work in anything the but the latest version of Chrome. But if you'd like to give it a shot, go for it, and let me know what issues you run into and what features you'd like!

Thanks,
-Brian

Chris Meyer

unread,
Oct 3, 2012, 11:30:57 AM10/3/12
to sect...@googlegroups.com
I put in:

function main()
{
  var resolution = 24; // increase to get smoother corners (will get slow!)
  
  var cube1 = CSG.Cube({center: [0,0,0], radius: [10,10,10], roundradius: 2, resolution: resolution});
  
  var result = cube1;
  return result;
}


Coming from the OpenJSCAD site (http://joostn.github.com/OpenJsCad/) and it just says "Error: Must have function main() which returns a CSG solid"

Any ideas what I'm doing incorrectly?


Chris


--
You received this message because you are subscribed to the Google Groups "Sector67 Public" group.
To post to this group, send email to sect...@googlegroups.com.
To unsubscribe from this group, send email to sector67+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sector67?hl=en.

Brian Baker

unread,
Oct 3, 2012, 11:12:22 PM10/3/12
to sect...@googlegroups.com
Was there no syntax highlighting? You may not actually have a tab open. I've been having issues with it not opening an actual tab when it starts. Hit the plus button above the code editor, select the new tab, and try pasting in again...

Issac Gerges

unread,
Oct 3, 2012, 11:46:17 PM10/3/12
to sect...@googlegroups.com
Chris, looks like your code isn't working in the OpenJSCAD site because of the incorrect casing of the method. It's "cube" not "Cube". With that fixed, I also wasn't able to get it to work on your dev site Brian (with syntax highlighting working correctly).

-- 
Issac Gerges

Issac Gerges

unread,
Oct 3, 2012, 11:59:54 PM10/3/12
to sect...@googlegroups.com
Yo Brian,

main.js:630
if(selectedTab) {
file = selectedTab.file;
filename = file.name;
} else {
filename = "coolend";
}

I think you might want to check if(selectedTab.file) instead. Looks like when the file is unsaved, selectedTab isn't undefined, but the file prop is. It's blowing up on filename = file.name with "cannot read property of undefined".

Chris, 
   If you link with dropbox and save a file it should work. Does for me at least.

-- 
Issac Gerges

Brian Baker

unread,
Oct 4, 2012, 12:56:32 AM10/4/12
to sect...@googlegroups.com
Thanks Isaac and Chris!. Just pushed a fix for that and the issue with not opening a default tab, so it should be easier to get up and running.

Joe Kerman

unread,
Oct 4, 2012, 12:56:29 PM10/4/12
to sect...@googlegroups.com
This is awesome! Ill play around and have some feedback for you. Im a
huge SCAD junkie, and this would be crazy convenient!

Nick Daly

unread,
Oct 4, 2012, 2:08:09 PM10/4/12
to sect...@googlegroups.com
Brian, it would be great if you included a working example in the
default tab. The following example has amused me for nearly 15
minutes now:

: function main() {
: var demo = 3;
:
: var resolution = 24; // increase to get smoother corners (will get slow!)
: var data;
:
: if (demo == 1) {
: data = CSG.cube({center: [0,0,0], radius: [10,10,10]});
: } else if (demo == 2) {
: data = CSG.sphere({center: [0,0,0], radius: 10});
: } else {
: var a = CSG.cube({radius: [10, 10, 10]});
: var b = CSG.sphere({ radius: 13.5, stacks: 12 });
: var c = CSG.cylinder({ radius: 7, start: [-10, 0, 0], end:
[10, 0, 0] });
: var d = CSG.cylinder({ radius: 7, start: [0, -10, 0], end:
[0, 10, 0] });
: var e = CSG.cylinder({ radius: 7, start: [0, 0, -10], end:
[0, 0, 10] });
: data = a.intersect(b).subtract(c.union(d).union(e));
: }
: return data;
: }

Tim Bertram

unread,
Oct 4, 2012, 3:25:14 PM10/4/12
to sect...@googlegroups.com
I have to say that this is awesome!

The dropbox integration is very handy too.

Brian Baker

unread,
Oct 4, 2012, 9:29:29 PM10/4/12
to sect...@googlegroups.com
Thanks everyone! I just made a quick google group (cool...@googlegroups.com I think? I'm new to this) for Cool End stuff for those who are interested; I invited everyone's who's responded to this thread so far, and anyone else should be able to sign up if interested. There isn't going to be a lot of movement on it this weekend, but I'm going to try and get some feedback built into things soon. The current roadmap is probably something like this:

-Get feedback into the site
-Get folders working in filesystem so include & use can work in OpenSCAD
-Refactor the crap out of things and get it on github with proper attribution for all the libraries I'm using

Nick, thanks for the awesome demo code! I'm pushing that now as the default. Also, is the stack parameter supposed to do anything? I don't recall seeing that in CSG.js.
Also, one thing I added that's NOT in JSCAD: you can do .debug() on any solid to see a pulsating semitransparent version of whatever you call it on. Useful for quickly viewing intermediate objects. .debug(false) will disable it but make it easy to reenable. And, one of the buttons above the viewer shows/hides solids marked for debug in thsi way.

Tim, glad you're liking the dropbox integration - that's been one of the handiest parts during development :)  Any feedback you have on that is definitely appreciated, as right now it's only the dev version of dropbox API, and I need some testing I think before applying for production status (with dev, only 5 users can use the application)
Reply all
Reply to author
Forward
0 new messages