I have been hacking around with OpenSCAD. First I added an exponent operator to the language because I felt that writing pow(x,2) was a bit more cumbersome than x^2 . Then I added a few more operators like a component-wise multiply and component-wise divide I wanted these to make it easier to translate points so I could use them as datums. I even implemented an experimental rotation operator. Then I decided to get a little bit more adventureous. What I wanted to do was make the OpenSCAD editor have syntax highlighting. Investigating doing this using qcodeedit is on the OpenSCAD todo list, so I thought I would give it a try
I was quite pleased with the results and it wasn’t to complex to implement, QCodeEdit’s QEditor is almost a drop in replacement for QTextEdit. I created a wrapper which allows somone compiling the source to choose which editor they want to use with compile time flags. In fact, to disable QCodeEdit support all one has to do is uncomment out the line with
CONFIG += qcodeedit
in openscad.pro
EDIT: All the changes have been merged into the main github repository which can be checked out using
git clone https://github.com/openscad/openscad.git
Hi,
I found some late-night motivation and looked through your patches.
I’ve applied all your qcodeedit-based patched to svn, including two small fixes I added.
Also, I disabled qcodeedit by default for now.
I didn’t include your operator additions as I wasn’t in the mood for thinking about that.
This is mostly Clifford’s domain. He’s pretty busy with other stuff these days but if we’re lucky he might read this and look at your patches 😉
Somehow, my ‘git dcommit’ didn’t keep your name anywhere in the patches. Not sure why, but anyway, for those reading commit emails: All the qcodeedit stuff was written by Giles.
~/= Marius
Thats cool. I do like the idea that openscad can use an external editor, but it also seems nice to have a fully integrated syntax highlighted, editor as part of openscad itself. It would be nice to make use of the other features of qcodeedit such as line numbering, code completion, code folding etc.
Thanks! Syntax highlighting is really useful. I found that I make much less mistakes and it’s requires less thinking to read code.