Interactivity in 3D view

7 views
Skip to first unread message

William Adams

unread,
Jun 15, 2025, 7:58:23 PMJun 15
to PythonSCAD
I am hoping to make use of this at some point in the future, but for now, I'm just trying to wrap my mind around what features there are and how they are accessed/used.

One possible difficulty is I usually use Windows (I have a MacBook, but don't use it much, and although I have a Linux box it is awkward to use since for some reason my nice monitor at my desk does _not_ like any cables other than the one which was bundled with it (and for what I spent buying HDMI and DisplayPort cables before I gave up, I could have bought a second before it was discontinued...) --- first world problems --- I'm hopeful that a Raspberry Pi 5 will work out as a nice option once a tablet case I've ordered arrives.... Also, I usually use a trackpad, or a touchscreen, or a stylus --- I have to move to a desk in the basement for using a mouse....

So, there is a command for "marking" a face for interactivity: marked

cube([5,5,marked(5)]).show()

which 

> makes z coordinate of the cube draggable

when one:

* has rendered the 3D model (Press F6)
* press and hold Ctrl
* drag any of the 4 upper points of the cube and try to move it

This works:

Screenshot 2025-06-15 193221.png

Screenshot 2025-06-15 193221.png

in that one could presumably export the modified model as an STL:

Screenshot 2025-06-15 193221.png

but that and getting an idea of change/proportion seems to be the only use one can make of it?

Unfortunately, as far as I can tell, there is no indication of what the new Z-axis position/coordinate is, nor does there seem to be a way to have the new value for it instantiated in the code --- unless there is an aspect to this feature which I missed?

I would also find it very helpful if there would be some on-screen mouse-over indication of when one has the cursor correctly positioned to enable the drag.

An interesting parallel here is documented at:


"Interactive modification of the numerical value"

> Placing the cursor after a digit and pressing Alt+ up arrow or Alt + down arrow will increment or decrement the chosen digit.

(and one can use alt right and left arrow to increase/decrease the decimal position of the change)

There is a bit more written about the View Area at that link --- some things I noticed (when running Windows --- if this is better on other platforms, please let me know --- it might be the incentive I need to rearrange my life to use Linux)

 - once one begins using the Measure tool there doesn't seem to be an easy way to get out of it --- one would expect that clicking on the button again would return to the normal/non-measure usage --- it would also be nice if there was some sort of on-screen indication that one is in this mode (maybe the tool icon could have an activated/pressed appearance? Highlight in colour as the "Show Edges" button does?)
 - the angle measure tool sometimes doesn't get the angle measurement one would presumably want (or maybe I don't understand it?) --- this measurement:

Screenshot 2025-06-15 193221.png

was reported as 90 degrees.... perhaps there could be a way to display all the angles of the triangle in addition to a report of the vertical plane it is along? (which is where I'm guessing the 90 degrees came from).

Curious what other nifty features folks are using.

William



Guenther Sohler

unread,
Jun 16, 2025, 2:05:15 AMJun 16
to William Adams, PythonSCAD
Hi William,

Thank you for testing and sharing your experience about interactive point dragging in PythonSCAD
In your second picture the value is not updated in the code whereas in the last picture with the measurement it is.
That's strange. The Value should be updated once you release the mouse button.
Once this is working, this could satisfy your need for an indication ?

BTW: you can also mark values enabled for dragging with quotes, like
cube([5,5,"5"]) - however I am not sure if we will stay with that.

Not many function parameters are able to be modified for dragging, but I could improve here when I see more demand and get a priority list.

I like to use Alt+ up/down for interactive modifying the design, (but I think my intent is more interactive).
The Alt up/down feature has one flaw. if your number is 50 , your cursor sits between 5 and 0 and you do downward counting, you experience 50, 40, 30,20,
10,  0 ...
And here the cursor jumps to the right of the 0 as you loose one digit. So at this point you cannot easily change direction to count up again in the same manner(by 10)

Your last angle measurement can very well be 90 degrees. In the Picture I only see one edge and 2 points.
The 2nd edge and 3rd point is not visible. It could sit at  0/5/0 to make up a 90 degree angle.

cheers Guenther





--
You received this message because you are subscribed to the Google Groups "PythonSCAD" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pythonscad+...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/pythonscad/c1336035-a217-49e5-b904-86a11fd942d0n%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages