FreeCAD Day 2023 - Report and Continued Discussion

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!
Post Reply
Hologram
Posts: 201
Joined: Thu Nov 03, 2022 3:05 pm

Re: FreeCAD Day 2023 - Report and Continued Discussion

Post by Hologram »

onekk wrote: Tue Feb 07, 2023 8:55 am But all these are long term projects and involve changing probably too much of FreeCAD and breaking the compatibility with old files that probably will be similar to a rewrite of FreeCAD.
How bad is it to break compatibility? If done once every decade or so and the old version keeps available for download, then it may not be as bad, right. Give a prompt message for models created in version X.X and below. Or, write conversion code (which sounds easier said than done).

Blender has also recently started depreciating code, not sure about compatibility issues there in particular. But if it helps to move forward, I think it's worth investigating.

How would SQlite databases deal with deleted edges and undos? Won't it be populated with entries that no longer exist? At some point the database also needs to be cleaned (e.g. when closing FreeCAD do a check for unused geometries).
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: FreeCAD Day 2023 - Report and Continued Discussion

Post by Zolko »

chennes wrote: Mon Feb 06, 2023 8:49 pm
Zolko wrote: Mon Feb 06, 2023 2:40 pm
  • Have 2 FreeCAD branches, and only 2 : Master and Development. Master is always clean and compiles fully, while Development can be partially broken.
In this scheme, and using the Debian nomenclature, tagged releases (20.1 ...) are the equivalent of Debian Stable, Master is the equivalent of the Debian Testing, and Development is the equivalent of Debian Sid.
In this scheme, do we generate our "dailies"/"weeklies" from Development? And then when we merge to master we (manually or automatically on merge) build something we call "Testing"? Then "Stable" is done the way we normally do releases?
Well, I didn't think that far, but yes, in this proposed scheme, we could proceed as you say
try the Assembly4 workbench for FreCAD — tutorials here and here
User avatar
onekk
Veteran
Posts: 6146
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: FreeCAD Day 2023 - Report and Continued Discussion

Post by onekk »

Hologram wrote: Tue Feb 07, 2023 9:14 am How bad is it to break compatibility? If done once every decade or so and the old version keeps available for download, then it may not be as bad, right. Give a prompt message for models created in version X.X and below. Or, write conversion code (which sounds easier said than done).
"Persistence of data" and "data ownership", I have to be a control over file formats, if not all my past work is simply a "bunch of digital bits".

It is another aspect of "programmed obsolescence" and similar aspect.

Not too far in time there were an Indian user (from India as there is even some ambiguity) that has all his works vanished by a modification in FreeCAD that has made his past work unusable with new versions, luckily developers have reverted the behaviour and made a some changes to permit old file works as expected, very "responsible move" not so common in OpenSource.

IMHO "format stability" is probably one of the main goal if you want to make a functional program, that will not interfere with evolution, but "format changes" has to be considered very carefully, so prior to make a "format change" better to think even "future expansions" as you could incorporate more flexible mechanism other than "version check" in a format.

Take as example in some "complicated software" you can reuse old code simply stating a "compatibility level" as example if you have made a complex figure using Tikz in Latex you could specify that you will use "version 1.6" instead of "version 1.8" that is what you have installed, but the context is "document creation" in scientific environment where "long term stability" is a "requisite" if not every research paper will be "vanished" and past research will be "unaccessible" to future researcher.
Hologram wrote: Tue Feb 07, 2023 9:14 am How would SQlite databases deal with deleted edges and undos? Won't it be populated with entries that no longer exist? At some point the database also needs to be cleaned (e.g. when closing FreeCAD do a check for unused geometries).

You could have two level, using transaction, undo tree is transient, so you decide to "start transaction" and the model is saved in the "model history" as example when starting modifying a solid, then modify the solid and this is saved in the volatile undo tree, when finished you "stop transaction" and the new solid is saved in the file. It your responsibility what to keep and what you loose.

It is a flexible way that will permit also if the database is external and distributed like in a working environment to "block a part" and release after the modifications, if you base the "topology manager" using "SQL queries" you could have a reasonable way to use an "internal Database" or an external distributed one.

This will solve even some request about concurrent modifications, done by different people on the same "complex design", but as said this is a "big change of perspective", and probably much more discussions and brainstorming has to be done.

I'm not a database expert, I have only played with them sometimes and made some works to keep some "customer archive" and "repair story" in automotive sector in a precedent life.

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: FreeCAD Day 2023 - Report and Continued Discussion

Post by adrianinsaval »

There’s also a perception that memory-safe languages, namely Rust, are harder to learn and will be difficult to use with hardware, which may dissuade people from learning it in the first place. (However, most other memory-safe languages, like Python, Go, and JavaScript, achieve temporal memory safety through garbage collection, which substantially simplifies many aspects of programming, making the languages famously easier to learn.
I don't think the difficulties of dealing with hardware in a memory safe language is a concern for freecad, we do not write drivers.
So... Why don't we rewrite FreeCAD in Rust? The answer is easy. It is because FreeCAD is a volunteer project and there is no law that requires you to write your code in a memory safe language. But when the time is there that such a law does exist, then I am seriously suggesting to use Nim instead of Rust. Why? Again, because Nim is much easier to read and write which will result in an increase of productivity.
I don't fundamentally disagree, but something to take into account for a FOSS project is also the community, rust has a strong community with a lot of supporters, we see stuff written about rust everywhere now. I don't see nearly as much fuss about Nim (I don't remember hearing about it before you mentioned it), even if it is an overall better language if there is 1 nim dev for every 20 rust devs...
keithsloan52
Veteran
Posts: 2756
Joined: Mon Feb 27, 2012 5:31 pm

Re: FreeCAD Day 2023 - Report and Continued Discussion

Post by keithsloan52 »

onekk wrote: Tue Feb 07, 2023 8:55 am
Similarly to solve the TNP problem it could be implemented a real database that store model Topology instead of using the XML scheme actually used base

Kind Regards

Carlo D.
Out of interest, as far as I am aware all OCC objects such as Faces, Edges etc have function called hashCode(), does this not return a unique id?
or does it change after recomputes etc. i.e why could it not be used? Speed?
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: FreeCAD Day 2023 - Report and Continued Discussion

Post by adrianinsaval »

kkremitzki wrote: Mon Feb 06, 2023 10:50 pm PyKDE
IMO the most interesting thing to use from KDE in FreeCAD is their command search bar, very powerful and useful, can be a gamechanger given the vast ammount of commands available in FreeCAD.
Also there was a project to use Ktexteditor as the macro editor, that could be very good too.
drmacro
Veteran
Posts: 8868
Joined: Sun Mar 02, 2014 4:35 pm

Re: FreeCAD Day 2023 - Report and Continued Discussion

Post by drmacro »

keithsloan52 wrote: Tue Feb 07, 2023 1:11 pm
onekk wrote: Tue Feb 07, 2023 8:55 am
Similarly to solve the TNP problem it could be implemented a real database that store model Topology instead of using the XML scheme actually used base

Kind Regards

Carlo D.
Out of interest, as far as I am aware all OCC objects such as Faces, Edges etc have function called hashCode(), does this not return a unique id?
or does it change after recomputes etc. i.e why could it not be used? Speed?
I have long wondered why FC was not implemented with some sort of GUID.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
User avatar
onekk
Veteran
Posts: 6146
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: FreeCAD Day 2023 - Report and Continued Discussion

Post by onekk »

keithsloan52 wrote: Tue Feb 07, 2023 1:11 pm ...

Out of interest, as far as I am aware all OCC objects such as Faces, Edges etc have function called hashCode(), does this not return a unique id?
or does it change after recomputes etc. i.e why could it not be used? Speed?
I have seen an use of hashCode() recently on deprecated Draft.SortEdge methods, used to avoid to reuse same edge in sorting.

I wonder why it is not used morecaround in the code, but now I can't do a search on GitHub FreeCAD site, maybe this will give a more detailed use case.

The point is that changing the way the T for Topology in TNP is derived by the Fact that Edges and Faces snv Vertex number are derived from the returned OCCT topology, and these index are changing and not derived from a stable source that map what you have created as Edge2 as example is everytime Edge2 if not deleted in the solid.

But this probably will imposing to use OCCT only to assemble Faces in Shell and Solids.

every other topology element should be stored elsewhere and managed as example when you add a chamfer or a fillet that face1 is always face1 but has new limits and is small and not share anymore edge2 as example with edge5 but with new created edge21 that is the edge of the face that has been created by chamfer operation.

Hoping to have explained things in understandable way.

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: FreeCAD Day 2023 - Report and Continued Discussion

Post by wmayer »

keithsloan52 wrote: Tue Feb 07, 2023 1:11 pm Out of interest, as far as I am aware all OCC objects such as Faces, Edges etc have function called hashCode(), does this not return a unique id?
or does it change after recomputes etc. i.e why could it not be used? Speed?
The hash code of a sub-shape is unique within the shape it belongs to but a recompute basically creates a new shape object and thus the hash codes change, too.

Code: Select all

doc = App.newDocument()
obj = doc.addObject("Part::Box", "Box")
doc.recompute()

obj.Shape.hashCode()
obj.Shape.Edge1.hashCode()

obj.Width=9
doc.recompute()

# Compare the values with previous ones. They should be different now
obj.Shape.hashCode()
obj.Shape.Edge1.hashCode()
C_h_o_p_i_n
Posts: 225
Joined: Fri Apr 26, 2019 3:14 pm

Re: FreeCAD Day 2023 - Report and Continued Discussion

Post by C_h_o_p_i_n »

Hi All,

as far as I read the scientistic papers RT pointed in his docs to - the tricky part is to "name" (describe) toplogical objects in a way that other objects relaiing on them , can identify their (most likely) predecessor after thease predecessors were changed.

Its something like driving through a town to reach a certain place you were a couple of years ago and some folks rearanged some parks and streets while you were'nt to this town ... a human might still find his way by remembering some "other" topolocical information like a mountain, a church, a railwaystation - all together pointing to the certain place.

So the job is not just done by using a GIUID and a linked list - but by describing the obejct in question in a manner that it's relations to other topological objects can be recoverd after a change. ( ... the church stays at its place even if nearby a new motorway was built )

Not shure if any database will in this case give any benefit over XML.

Regards, Stefan
Post Reply