node editor - pyflow

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
sbal
Posts: 1
Joined: Fri Feb 28, 2020 4:57 pm

Re: node editor - pyflow

Post by sbal »

Hi All,
I have a question on the pythonNode. When I try to click on the edit option in the Python node, no python console opens up. I saw in some videos that an editor (typically the version of python I have on my machine) should open up. Can anyone tell me how to access the editor for the python node?

Best,
Madhu
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: node editor - pyflow

Post by microelly2 »

sbal wrote: Fri Feb 28, 2020 4:59 pm Hi All,
I have a question on the pythonNode.
I have never worked with the python node because it can be used to embed code into a Document.
We want to avoid this for FreeCAD because there is a risk to distribute dangerous code.
The preferred workflow is:
define nodes of common interest ,write your code and add both to a pyflow packages.
Pyflow packages can be installed and used inside the interface.
The code is in the package, the use case logic in the scenegraph of the FreeCAD document.
vara
Posts: 9
Joined: Wed Feb 26, 2020 2:11 am

Re: node editor - pyflow

Post by vara »

I already install opencv-python. But there is an error 'cannot import module named cv2'.
Attachments
freecad err.png
freecad err.png (363.3 KiB) Viewed 1443 times
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: node editor - pyflow

Post by microelly2 »

vara wrote: Tue Mar 03, 2020 8:06 am I already install opencv-python. But there is an error 'cannot import module named cv2'.
this is not needed at the moment.
I have only one node ImageT to work with images and it's very alpha and has low priority.
you can use the node editor without cv2.
vara
Posts: 9
Joined: Wed Feb 26, 2020 2:11 am

Re: node editor - pyflow

Post by vara »

microelly2 wrote: Tue Mar 03, 2020 8:12 am
vara wrote: Tue Mar 03, 2020 8:06 am I already install opencv-python. But there is an error 'cannot import module named cv2'.
this is not needed at the moment.
I have only one node ImageT to work with images and it's very alpha and has low priority.
you can use the node editor without cv2.
But my node cannot work normally.
phpBB [video]

I am following this video. but already failed in the first step
phpBB [video]
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: node editor - pyflow

Post by microelly2 »

vara wrote: Tue Mar 03, 2020 9:27 am I am following this video. but already failed in the first step
To get a surface in 3D Space you have to visualize it
see this:
https://forum.freecadweb.org/viewtopic. ... 90#p368988
vara
Posts: 9
Joined: Wed Feb 26, 2020 2:11 am

Re: node editor - pyflow

Post by vara »

microelly2 wrote: Tue Mar 03, 2020 9:41 am
vara wrote: Tue Mar 03, 2020 9:27 am I am following this video. but already failed in the first step
To get a surface in 3D Space you have to visualize it
see this:
https://forum.freecadweb.org/viewtopic. ... 90#p368988
sorry, still cannot work.
In the video, clicked the purple circle of the "vectorarray" node than click the green circle.
A "PV_FreeCAD_VectorArray" object will create under "Model>Application>Unnamed"
But I have nothing. even I added a view3D node.
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: node editor - pyflow

Post by microelly2 »

vara wrote: Tue Mar 03, 2020 10:30 am But I have nothing. even I added a view3D node.
if there is a view3d node in the tree you may change the viewpoint to "fit all"
the only reason I see at the moment:
what is the value of countC
it must be 1
countA, and count B should be large enough (default values)

what is the outpunt in your report view window?
vara
Posts: 9
Joined: Wed Feb 26, 2020 2:11 am

Re: node editor - pyflow

Post by vara »

microelly2 wrote: Tue Mar 03, 2020 12:50 pm
vara wrote: Tue Mar 03, 2020 10:30 am But I have nothing. even I added a view3D node.
if there is a view3d node in the tree you may change the viewpoint to "fit all"
the only reason I see at the moment:
what is the value of countC
it must be 1
countA, and count B should be large enough (default values)

what is the outpunt in your report view window?
Hope it is clear enough
phpBB [video]
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: node editor - pyflow

Post by microelly2 »

You have to connect the Shape_out pin of the vectorarray with the Shape_in pin of the view3d node.
Next step:
You have to execute the view3d Node
You can connect the exec_out of the vector array with the exec_in of the view3d. In thsi cas an recompute of the source automaticly updates the part representation.
Post Reply