Find OpenSCAD code from image


I have an OpenSCAD model which I am looking at in the application, code to the left and the rendering to the right.

Am trying to modify a certain piece, and have commented out all the commands that I believed were related to that piece, but there is still one subtracted cube left, i.e. somewhere in the code there is a difference block with this cube command somewhere in the 2nd part (I believe, as I cannot see any other possibility).

It would be very nice if I could just click on the image and get the software to display the corresponding commands in the code.

Is anything like that available in any tool?

Tomas By

Posted 2019-06-23T10:44:49.803

Reputation: 509



To my knowledge, OpenSCAD does not have any such feature. However, a related feature might help you: the debugging aid modifier characters. By inserting %, #, !, or * before an object (including aggregate objects), you can control how it renders in relation to the whole file; this makes it possible to do "binary search" type operations to figure out where the object you're seeing is.


Posted 2019-06-23T10:44:49.803

Reputation: 5 311

I know. The problem is that I have apparently spread this out over the file, so would be tedious. – Tomas By – 2019-06-23T11:38:33.717

1It can be tedious, but those characters are the tools. I agree that a "point to it and the code opens" feature would be great, but as yet it does not exist. – cmm – 2019-06-27T17:47:43.567