Could you elaborate why this would be an improvement? I would guess that from the performance side C++ is better than Python, and performance is already critical with having it in C++.
Add new line and annotation to a drawing in Techdraw
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Add new line and annotation to a drawing in Techdraw
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
- wandererfan
- Veteran
- Posts: 6324
- Joined: Tue Nov 06, 2012 5:42 pm
- Contact:
Re: Add new line and annotation to a drawing in Techdraw
It isn't a development issue, it is a release/packaging issue. Making the change is straight forward enough. Distributing it on all the supported platforms is hard work.
- wandererfan
- Veteran
- Posts: 6324
- Joined: Tue Nov 06, 2012 5:42 pm
- Contact:
Re: Add new line and annotation to a drawing in Techdraw
Credit where credit is due. @mrlukeparry is the father of TechDraw.
As to why it is in C++, it was originally envisioned as an update to the Drawing module, which was written in C++. Eventually the two code bases diverged so much that it wasn't practical to continue development as Drawing2.
At the time TechDraw development started, Draft was probably the only core module written in Python.
As for rewriting it in python, sloccount says 1 year, $1M and 7 developers
Code: Select all
Total Physical Source Lines of Code (SLOC) = 34,332
Development Effort Estimate, Person-Years (Person-Months) = 8.19 (98.33)
(Basic COCOMO model, Person-Months = 2.4 * (KSLOC**1.05))
Schedule Estimate, Years (Months) = 1.19 (14.29)
(Basic COCOMO model, Months = 2.5 * (person-months**0.38))
Estimated Average Number of Developers (Effort/Schedule) = 6.88
Total Estimated Cost to Develop = $ 1,106,944
(average salary = $56,286/year, overhead = 2.40).
Re: Add new line and annotation to a drawing in Techdraw
I don't think it's a question of performance, but of flexibility. Python is just better to quickly prototype new functionality; no recompilation necessary. What makes FreeCAD "slow" isn't the use of Python, it's the way the internal document object system works. That's already in C++, but we don't know if the way it was coded originally was the best way it could have been done. Maybe at some point in the future somebody will have to rework that.
Python is only slow if you have to iterate a million times doing some mathematical calculations. But that doesn't really happen in a user program like FreeCAD. The only time it really takes a long time is during loading of a file. In most user applications, 90% of the time the program just sits there waiting for input from the user. This is the same thing with our personal computers. We may have an 8-core processor and a powerful GPU card, and yet we spend most of our time reading stuff online or writing in a word processor. That takes very little processing power. Unless you are constantly playing video games, rendering photorealistic images and animations, or running complex numerical simulations (mining crypto coins), most computing power in the world is "wasted".
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.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
Re: Add new line and annotation to a drawing in Techdraw
I seem to recall Arch, which is also in Python, already existed around FreeCAD 0.14, so that's quite a long time. I'm not sure if TechDraw was already there in the plans.wandererfan wrote: ↑Tue Apr 16, 2019 11:33 pm ...
At the time TechDraw development started, Draft was probably the only core module written in Python.
As for rewriting it in python, sloccount says 1 year, $1M and 7 developersCode: Select all
Total Physical Source Lines of Code (SLOC) = 34,332 Development Effort Estimate, Person-Years (Person-Months) = 8.19 (98.33) (Basic COCOMO model, Person-Months = 2.4 * (KSLOC**1.05)) Schedule Estimate, Years (Months) = 1.19 (14.29) (Basic COCOMO model, Months = 2.5 * (person-months**0.38)) Estimated Average Number of Developers (Effort/Schedule) = 6.88 Total Estimated Cost to Develop = $ 1,106,944 (average salary = $56,286/year, overhead = 2.40).
Only one million?! Huh. Let me check my wallet... eh, you know what, I don't have money at this time, but you get to it, and I'll pay you later. Deal?
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.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
Re: Add new line and annotation to a drawing in Techdraw
Means, you have already made the changes and now us just have to wait for the program to be built?wandererfan wrote: ↑Tue Apr 16, 2019 11:18 pm It isn't a development issue, it is a release/packaging issue. Making the change is straight forward enough. Distributing it on all the supported platforms is hard work.
- wandererfan
- Veteran
- Posts: 6324
- Joined: Tue Nov 06, 2012 5:42 pm
- Contact:
Re: Add new line and annotation to a drawing in Techdraw
More or less. The Balloon feature is available in v0.19. Once the v0.18 deployment is complete, plans for backports and point releases can be developed. Usually backports are for serious flaws and glaring omissions, not so much for additional features.
- wandererfan
- Veteran
- Posts: 6324
- Joined: Tue Nov 06, 2012 5:42 pm
- Contact:
Re: Add new line and annotation to a drawing in Techdraw
That's amazing. It seems that by that time Arch already existed, as mentioned by Parry. So Arch, coded in Python, was there before Drawing2 (TechDraw).NormandC wrote: ↑Wed Apr 17, 2019 4:16 am https://freecadamusements.blogspot.com/ ... e.html?m=1
https://freecadamusements.blogspot.com/ ... 2.html?m=1
LOL. And this is the reason TechDraw is in C++. Basically, the developer decides what language to use. If he knows C++ he'll do it in C++. Imagine if he had converted Arch into C++. Oh, noes.Luke Parry wrote:It would be interesting to look at ArchVRM.py - especially for the clipping / section views. I am still terrible at python but it might be a good exercise to convert it to c++ for you
Last edited by vocx on Wed Apr 17, 2019 4:19 pm, edited 2 times in total.
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.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.