Port Request: OpenSCAD ($40/$80 starting bounty)


I suggest you send <the bounty> to EvilDragon as a PreOrder fund donation, and maybe EvilDragon could then transform 50% of the bounty to a voucher for me, to be added to my DragonBox coding compo voucher which I didn't use yet
That is mighty good of you; thanks and appreciation from the community.
 
@_wb_:

I wasn't expecting it to be so soon! Thank you. I'll give the PND a try tonight. All being well I shall, of course, follow your wishes & donate the $40 to ED's fund. If it ends up getting used for BBT work then I'll get back in contact as I would prefer to pay you directly. I'm not sure if donating to help people get consoles is strictly within the remit of our constitution*, but paying for your time to get the tools is.

* Social Enterprises have to operate for the benefit of a particular (in our case, blind & visually impaired) community, according to English law.
 
I've downloaded & tested the PND now. Here's my feedback so far;

* You're right about the layout being pretty good for the Pandora already. I think perhaps the default editor font could do with being 10pt by standard though. You can't really fit a full line in otherwise.

* I tried testing the example in the original post. If you set the fn variable to 12 it renders (F6) in a few minutes, which is equivalent to a Thinkpad x200s running Linux Mint 13 with fn set to 48. I know, I know, that's not exactly a great benchmark. Just 'drawing' it (F5) is much quicker. I would recommend anyone using this PND to set their curving vectors to $fn=18 or below to make mouse manipulation of the viewport smoothish.

* Rendering the the example at fn 48 took 15 mins to get to 65/100, then it crashed. I don't know if there's anyway around this as I imagine its a lack of memory causing it. Would be great if it could pause & warn you, telling you it needs swap or something (if that's the problem). If not then its probably safe to say that the PND is best used in conjunction with a desktop version of OpenSCAD to render models on later.

Thanks again _wb_.
 
Wow, _wb_ was busy...wasn't expecting anything so quickly.  I'll test this pnd tonight after work and give some feedback (on what I tried), probably tomorrow.  Super busy at the moment...thanks for your efforts, _wb_ ...and I'd be happy to pay the bounty in whatever form/breakdown that you'd prefer.
 
Interesting. Once it crashes it won't reload. Not even after a restart.
 
Hiho,that Information comes little late from me,but we have on

Slackware 14 the Cad Software Qcad running.

It was a side Information ^_^
 
I noticed that it isn't properly drawing stuff with OpenCSG because it needs OpenGL 2 which is not offered in lunixbochs' libGL. Also rendered stuff looks black and wrong.

So I'm going to make an update that draws in software (Mesa) - this is slower but at least it's correct. I can set it up so you can choose between the current fast but incomplete hardware rendering and slower but correct software rendering, there will be two entries in the menu.

I'll also check what is causing the crash - probably memory, but it could also be problem with CGAL.

I'll change the editor font size default.
 
This is a really nice tool!


I experienced a computational error visible in the first example with the default values for $fX. My English isn't good enough to describe it, but it is some kind of appendix caused by the second cylinder that is subtracted (the other 2 can be commented out). It is visible with default values, but also (faster computation) with $fn=0;$fs=2;$fa=20 (18 fragments if I understand the formula correctly) and disappears with $fa=22; (17 fragments).


I don't have another system handy to check whether this is normal (but I'd be surprised if the first example with the default configuration should look wrong:)


NB: on the Pandora it is probably a good idea to increase the default value of $fa to 24 or an even larger value (though it is officially documented to be 12, so a prominent hint on first start - like the GL capability warning - may be neccessary).
 
Some other stuff I'm changing for the next update:

- The way to rotate along the vertical axis in OpenSCAD is by holding shift and left-click dragging. However, this is also the mechanism used by default on the OpenPandora to move windows, so it won't work. I'm changing OpenSCAD to use ctrl + left-click drag instead.

- You can choose whatever font you want already in OpenSCAD, and it remembers that, so that's good enough - I tried to change the default size but I can't find out where it is getting the default from. However, the main problem is lack of horizontal space in the editor, which is mostly caused by indentation. Tab stops are 4 spaces by default, and this is not customizable. I'm going to change that to 2 spaces. If you want, I could also make it customizable but that will be more work.

- I'll try to add a "full screen" mode. You can already get pretty close to that by using OpenBox and toggling the panel away.

I tried your example with fn=48 and it is a memory problem indeed, it rendered on my Pandora but needed about 350MB of swap (I made a 1GB swap partition and I have 512MB RAM). With enough swap space my guess is that anything will render, but if it's going to need swap, it will be damn slow so you may not want to bother with that unless you really have no other computer nearby. I can try to find out if I can somehow reduce the memory footprint, but probably not really. I guess that if you run it from MiniMenu you'll have the largest amount of memory left for OpenSCAD.

I have no idea how hard it would be to add a warning about lack of memory. I guess it's hard to tell in advance how much memory things will use.

It is very strange that after the crash it will not reload. Could you send me your appdata/openscad dir (in a zipfile or .tar.gz) to find out what is happening?

I suggest you send <the bounty> to EvilDragon as a PreOrder fund donation, and maybe EvilDragon could then transform 50% of the bounty to a voucher for me, to be added to my DragonBox coding compo voucher which I didn't use yet
That is mighty good of you; thanks and appreciation from the community.
Actually I feel kind of greedy for claiming 50% of the bounty for myself: after all, all I did was compile and package other peoples' work. I didn't write OpenSCAD or any of the libraries it uses. I'm using lunixbochs' libGL and the Mesa GL from p'titSeb's code::blocks PND. This is all very much a "standing on the shoulder of giants" thing, my own contribution being quite minimal and trivial.
 
This is a really nice tool!


I experienced a computational error visible in the first example with the default values for $fX. My English isn't good enough to describe it, but it is some kind of appendix caused by the second cylinder that is subtracted (the other 2 can be commented out). It is visible with default values, but also (faster computation) with $fn=0;$fs=2;$fa=20 (18 fragments if I understand the formula correctly) and disappears with $fa=22; (17 fragments).


I don't have another system handy to check whether this is normal (but I'd be surprised if the first example with the default configuration should look wrong:)


NB: on the Pandora it is probably a good idea to increase the default value of $fa to 24 or an even larger value (though it is officially documented to be 12, so a prominent hint on first start - like the GL capability warning - may be neccessary).
I also noticed this problem. At first I thought it was a computational error, but it looks like it is actually some kind of drawing error. With software drawing (mesa), it disappears. Only with lunixbochs' libGL the glitches appear.

I don't think I'm going to mess with the defaults for $fa etc. People may depend on these variables having their default setting.
 
Hiho,that Information comes little late from me,but we have on

Slackware 14 the Cad Software Qcad running.

It was a side Information ^_^
Thanks for letting us know Ingoreis. I've tried QCad on my laptop once or twice. It seems like a pretty solid package. The problem I have with the more conventional CAD programs though it that I just can't seem to get along with them. Not sure why, but I find I prefer either real drawing board style (like Sketchup) or strictly programmatical (like OpenSCAD).

@_w_:

Thoe improvements sound sensible.

I've asked ED how to go about paying the bounty.
 
 I also noticed this problem. At first I thought it was a computational error, but it looks like it is actually some kind of drawing error. With software drawing (mesa), it disappears. Only with lunixbochs' libGL the glitches appear.

I don't think I'm going to mess with the defaults for $fa etc. People may depend on these variables having their default setting.
Ok, that's fine. (And it is probably deliberate that there is no configuration option for the $fX defaults.)

One other (non-trivial) thing: the builtin editor seems to be missing search and replace.
 
I set the default tab stop to 2 spaces (instead of 4) - you can always indent twice if you really want to create more distance.

I added a "full screen" toggle option, with the shortcut CTRL-SHIFT-F. This is especially useful if you're using the default window manager to get more vertical space. It gets rid of the title bar, so all is left is the menu bar and the status bar - should I add toggles to hide those as well?

I'm now doing some performance profiling to see what the main bottlenecks are, maybe I can tweak some compile options here and there to make some stuff a bit faster. Of course the Pandora is never going to be a great number cruncher - for applications like this, it really helps to have a 64 bit architecture with fast floating point arithmetic.

One other (non-trivial) thing: the builtin editor seems to be missing search and replace.
Is this something that is normally available in OpenSCAD and somehow missing here, or a feature request for OpenSCAD?

I could try to add this, but you can keep adding features to an editor. My approach would be to use any existing full-featured text editor if you want to do nontrivial modifications, and only use the built-in editor for small tweaks.
 
I'm now doing some performance profiling to see what the main bottlenecks are, maybe I can tweak some compile options here and there to make some stuff a bit faster. Of course the Pandora is never going to be a great number cruncher - for applications like this, it really helps to have a 64 bit architecture with fast floating point arithmetic.
Is that fast floating point as in non-IEEE compliant?  
 
No, I just mean that floating point instructions are not very fast on the Pandora cpu. But I don't really know if that matters much in this case.

Anyway, it looks like the biggest bottleneck is in the libgmp arbitrary-precision arithmetic, which was kind of to be expected. There is still ongoing work for libgmp to optimize better for ARM, so perhaps it will further improve in the future, see e.g. http://gmplib.org/devel/arm.html

I just compiled a bleeding-edge version of libgmp (today's snapshot instead of the older stable release), to try to get better performance. The difference is not really big: using monty's example (with fn=12) as a benchmark (converting it to .stl with a command-line command), it goes from 2m22s using the old libgmp to 2m18s with the new one :)

I'll also try a bleeding-edge version of OpenSCAD itself from the github repository (version 2013.06, which will probably be released soon).
 
No, I just mean that floating point instructions are not very fast on the Pandora cpu. But I don't really know if that matters much in this case.
Running disassembler on openscad binary and lib/libgmp.so.10.0.5 shows that you compiled them with soft-float (not softfp that actually uses VFP instructions) and no armv7 instructions.
 
Last edited by a moderator:
Yeah I'm going to fix that in the next update - forgot to set the usual CFLAGS. Not that it matters much: it's mostly using libgmp's rational numbers, which are implemented with arbitrary precision integers.
 
One other (non-trivial) thing: the builtin editor seems to be missing search and replace.
 Is this something that is normally available in OpenSCAD and somehow missing here, or a feature request for OpenSCAD?

I could try to add this, but you can keep adding features to an editor. My approach would be to use any existing full-featured text editor if you want to do nontrivial modifications, and only use the built-in editor for small tweaks.
It was just something I missed while playing around with the samples. Especially because the integration with an external editor isn't obvious (no start editor on current file thingy), but the reason is probably that the usual workflow is the other way around: edit file and start OpenSCAD from editor. A basic search still would be nice:)
 
I know, search/replace would be useful, but I think you better ask the OpenSCAD devs to add this, instead of me. I don't want this to become a fork of OpenSCAD. I'll make minor modifications to make it more usable on the Pandora, but I don't intend to really add new features.

The updated version is on the repo by the way. Besides the things mentioned above, I also added menu items and shortcuts for zoom in/out (on the object view), CTRL+PageUp/Down, because the other ways to zoom are a bit tricky on the Pandora: we don't have a mouse wheel, shift-right-click-drag works but is not that practical in my opinion, and we don't have the keypad +/- which I presume is the normal shortcut to zoom.
 
Back
Top