GSoC 2020: A better IPython and Jupyter Notebook Integration for FreeCAD

Contributions from the participants, questions and answers to their projects.
Discussions of proposals for upcoming events.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
kryptokommunist
Posts: 70
Joined: Fri Mar 27, 2020 6:29 pm
Location: Berlin
Contact:

Re: GSoC 2020: A better IPython and Jupyter Notebook Integration for FreeCAD

Post by kryptokommunist »

vocx wrote: Sat May 16, 2020 3:02 am I'm not sure how this is related to your project (IPython), but there's plenty of things to tackle.
My assumption is, that for issue #2526. I would have to understand and make changes to the 3D-scene graph as the feature request there is to disable a seam line from being shown. This might help me later when I'll port the 3D view from FreeCAD to IPython.

For example, you could extend the task panel of the Draft PolarArray and Draft CircularArray tools to use the new AxisReference property.
Sounds good, I'll do that!

Or create a single tool for Draft PathArray and Draft PathLinkArray, similar to the other tools.
If there won't be another 3D related suggestion here I'll see how far I'll get with the hide the seam edges for the 3D view issue. This single tool feature seems a little more complex, so I will only tackle this if I feel I can still manage to get all my to-dos for the next two weeks done. Btw. if anyone thinks there is something missing in the proposed timeline or something seems unclear or plain wrong don't hesitate to let me know.
Last edited by Kunda1 on Mon May 18, 2020 12:56 pm, edited 2 times in total.
Reason: replaced link with bug 2526
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: GSoC 2020: A better IPython and Jupyter Notebook Integration for FreeCAD

Post by vocx »

kryptokommunist wrote: Mon May 18, 2020 3:35 am ...
This might help me later when I'll port the 3D view from FreeCAD to IPython.
...
I'm not entirely sure what you want to accomplish but I just saw this post How to use Jupyter Notebook with FreeCad [Guide]. Maybe it's helpful.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: GSoC 2020: A better IPython and Jupyter Notebook Integration for FreeCAD

Post by Kunda1 »

kryptokommunist wrote: Mon May 18, 2020 3:35 am My assumption is, that for issue #2526. I would have to understand and make changes to the 3D-scene graph as the feature request there is to disable a seam line from being shown. This might help me later when I'll port the 3D view from FreeCAD to IPython.
This would be a welcome fix. This issue has been a round for a while and there is a workaround for it.

Edit: recent example where a fix would be nice
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: GSoC 2020: A better IPython and Jupyter Notebook Integration for FreeCAD

Post by yorik »

#2526 might not be simple. It will require quite deep understanding of the coin3D particularities and several parts of FreeCAD, that you won't really need all in your GSOC project. It is certainly a very valid exercise to get a big dose of FreeCAD code ;) but you might prefer something simpler if you see you're going too deep... As vocx says there are many smaller issues in Draft, I think
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: GSoC 2020: A better IPython and Jupyter Notebook Integration for FreeCAD

Post by sgrogan »

kryptokommunist wrote: Mon May 18, 2020 3:35 am If there won't be another 3D related suggestion here
I would not stray so far from your proposal.
The main idea behind fixing a bug in this phase is to get acquainted with FreeCAD.
How to make pull requests, working with the code base, working with the community etc.

I would suggest spending your time making sure you can compile/use FreeCAD. You may not need this strictly for your project, but you will likely introduce some new dependencies. Search some threads about Addons-manager to see some of the problems, even for pure python code to add dependencies on the different platforms.

I agree with @kkremitzki, the most important thing is to become engaged in the FreeCAD community. For us its the forum. Post frequently. Talk about your plans and challenges, we don't need code snippets, just tell us what you've been considering. There is a lot of interest in your project, so I think using this period to recruit a group of testers is a good use of this time.
"fight the good fight"
User avatar
kryptokommunist
Posts: 70
Joined: Fri Mar 27, 2020 6:29 pm
Location: Berlin
Contact:

Re: GSoC 2020: A better IPython and Jupyter Notebook Integration for FreeCAD

Post by kryptokommunist »

vocx wrote: Sat May 16, 2020 3:02 am For example, you could extend the task panel of the Draft PolarArray and Draft CircularArray tools to use the new AxisReference property.
Here's the idea I'm currently working on:

Current state of PolarArray panel:
taskpanel_old.png
taskpanel_old.png (21.22 KiB) Viewed 2096 times

Proposed panel (modifications for the CircularArray panel would be analogous):
taskpanel_new.png
taskpanel_new.png (26.07 KiB) Viewed 2096 times

How would this work? In this conservative change I would simply add the AxisReference by clicking the select button and then selecting the axis with the mouse. After a successful selection the text label next to the button would display the name of the axis I selected (e.g. $SelectedAxis). When I successfully selected an AxisReference the "Center of Rotation" grid would be greyed out or disappear. Also the button would change to read deselect and a push would undo the selection and enable the "Center of rotation" grid again.

vocx wrote: Mon May 18, 2020 6:14 am I'm not entirely sure what you want to accomplish but I just saw this post How to use Jupyter Notebook with FreeCad [Guide]. Maybe it's helpful.
Yes that's basically the starting point on which I'll build. Currently you have to rely on firing up the GUI along the notebook for the 3D view and my goal is to integrate this directly into the notebook.

yorik wrote: Wed May 20, 2020 8:24 am [...] but you might prefer something simpler if you see you're going too deep... As vocx says there are many smaller issues in Draft, I think
I'll take this into account, I haven't looked deeply into the referenced issue yet. But yes it shouldn't be a second project, just something light.

sgrogan wrote: Wed May 20, 2020 8:43 pm I would suggest spending your time making sure you can compile/use FreeCAD. You may not need this strictly for your project, but you will likely introduce some new dependencies. Search some threads about Addons-manager to see some of the problems, even for pure python code to add dependencies on the different platforms.
That is a good tip. I will need to update my setup, probably some time next week. Currently I'm working with the docker container to compile FreeCAD, which might be problematic because I would need to run the Jupyter notebook from withing the container as well. On the other hand I could create a docker container specific for this project derived from the standard one, so everyone who follows the development could easily compile and test on their system. On the other hand all the different platforms and setups would be an early testing ground to find platform and similar issues.

kryptokommunist wrote: Fri May 15, 2020 8:36 pm For the next step I thought about documenting the development process. Do you think this might be useful? I started a rough sketch.
On this front I also expanded the document, I put the PlantUML file in a dedicated Github repository with an SVG file with clickable hyperlinks. While I learned that there are already visualizations of the development process in the Wiki this one is a bit more high level and depicts more of the ecosystem:

development_documentation.png
development_documentation.png (116.14 KiB) Viewed 2096 times
Last edited by kryptokommunist on Sat May 23, 2020 9:33 am, edited 1 time in total.
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: GSoC 2020: A better IPython and Jupyter Notebook Integration for FreeCAD

Post by vocx »

kryptokommunist wrote: Fri May 22, 2020 7:27 am ...
After a successful selection the text label next to the button would display the name of the axis I selected (e.g. $SelectedAxis). When I successfully selected an AxisReference the "Center of Rotation" grid would be greyed out or disappear. Also the button would change to read deselect and a push would undo the selection and enable the "Center of rotation" grid again.
...
I think this is a good workflow.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: GSoC 2020: A better IPython and Jupyter Notebook Integration for FreeCAD

Post by looo »

Just in case you want to do something more pivy/coin related, there is one thing on our list for the next pivy release. This is porting the configuration to cmake [1]. Testing and optimizing this for other platforms (eg your linux distro) would be a nice task and shouldn't be too complicated. Anyway whatever you want to work on, but it would be a waste if you get lost in the polar array topic... ;)

[1] https://github.com/coin3d/pivy/pull/69
User avatar
kryptokommunist
Posts: 70
Joined: Fri Mar 27, 2020 6:29 pm
Location: Berlin
Contact:

Re: GSoC 2020: A better IPython and Jupyter Notebook Integration for FreeCAD

Post by kryptokommunist »

vocx wrote: Sat May 16, 2020 3:02 am For example, you could extend the task panel of the Draft PolarArray and Draft CircularArray tools to use the new AxisReference property.
Here's an update on the current status of the implementation of the Draft axis selection (code on Github). Does this look right to you?:

phpBB [video]

Some things I need to work on there:

  • check that the selected object is valid, if not display an error message (should this be a pop up or just raise an Error to be displayed in the Report View at the bottom?)
  • make sure that aborting the selection at any step works without side effects
  • style checking with flake8
  • generalizing this to work the same way in the Circular Array
looo wrote: Fri May 22, 2020 7:32 pm Just in case you want to do something more pivy/coin related, there is one thing on our list for the next pivy release. This is porting the configuration to cmake [...]. Anyway whatever you want to work on, but it would be a waste if you get lost in the polar array topic... ;)
I'm afraid I got lost :lol: But it was an unfair choice because the Array is a continuation of my first commit.
Last edited by kryptokommunist on Thu May 28, 2020 5:29 am, edited 1 time in total.
User avatar
kryptokommunist
Posts: 70
Joined: Fri Mar 27, 2020 6:29 pm
Location: Berlin
Contact:

Re: GSoC 2020: A better IPython and Jupyter Notebook Integration for FreeCAD

Post by kryptokommunist »

I'd like to ask you all interested in this topic, if you have a use case in mind on how you would use IPython and/or Jupyter Notebook with the ability to display the 3D view without having to start the FreeCAD-Desktop app. In the end the result will be the ability to render the OpenInventor scene graph in a web browser (regardless of the IPython/Jupyter integration). What would you like to do with that possiblity? I mean there alreay is a WebGL export but it has some issues right now as far as I can tell.
Post Reply