feature request: "deconstruct - reconstruct" macro

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!
chrisb
Veteran
Posts: 54288
Joined: Tue Mar 17, 2015 9:14 am

Re: feature request: "deconstruct - reconstruct" macro

Post by chrisb »

HoWil wrote:Subsequently, not only the OCC-number of this face (#11) is saved, but also all its points, its edges, the direction of this edges, its location, its size, its normal-vector and for instance its center.

After some changes were made to the model all the elements (in the above example the Face #11) were again gone through and were compared with the saved information. This should allow to calculate a probability if the face in question (for assigning the sketch) is still the same. Maybe one side of the face was cut away.

For instance, if the newly found face has still two originally edges left (as #11) and the face has the same normal vector as #11 it is highly likely that this is the original #11.

Is it somehow to understand what I suggest?
That's exactly what I have in mind. It is a completely different approach from things we usually do in 3D modelling. If we cannot rely on the mathematics we try to simulate what an intelligent human being would do: use heuristics to identify a face or edge as "the same" - even if it isn't any more in a mathematical sense e.g. because it has moved in space.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
HoWil
Veteran
Posts: 1279
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: feature request: "deconstruct - reconstruct" macro

Post by HoWil »

@chrisb @DeepSOIC
I tried to implement the above described approach some time ago but could not find a function which gives all elements like points or edges at a specific point or volume (see https://forum.freecadweb.org/viewtopic.php?f=22&t=21361).
Do you have any idea in this regard?
Br,
Howil
chrisb
Veteran
Posts: 54288
Joined: Tue Mar 17, 2015 9:14 am

Re: feature request: "deconstruct - reconstruct" macro

Post by chrisb »

HoWil wrote:@chrisb @DeepSOIC
I tried to implement the above described approach some time ago but could not find a function which gives all elements like points or edges at a specific point or volume (see https://forum.freecadweb.org/viewtopic.php?f=22&t=21361).
Do you have any idea in this regard?
Br,
Howil
I don't think you need so much information. The most common use case I can see is this:

- You have a Part Design model with a linear dependency tree.
- You want to change a sketch inside this tree, i.e. something different from the last element. Let's call it step n.
- Step n+1 is a pad or pocket operation (which usually is no problem after changing the sketch)
- Step n+2 is a sketch placed on one of the faces of Step n+1. This I would call the critical face (and critical phase :lol: ). It can use external geometry.

The procedure I have in mind does the following:
- When entering sketcher in step n the critical face can be identified.
- You have to collect informations about this face including external geometry information for step n+2.
- After closing the sketch you try to identify the critical face and reattach the sketch from step n+2.
- This procedure has to be performed recursively down the dependency tree.
- The Topo Workbench could provide tools to support this process if the face cannot be identified automatically.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: feature request: "deconstruct - reconstruct" macro

Post by NormandC »

You guys may be interested in this:

Macro to fix broken models https://forum.freecadweb.org/viewtopic.php?f=22&t=6288

It dates back from 2014 and its author has not been on the forum since 2015. The macros may very well not work anymore, but someone proficient in python could fix them.
chrisb
Veteran
Posts: 54288
Joined: Tue Mar 17, 2015 9:14 am

Re: feature request: "deconstruct - reconstruct" macro

Post by chrisb »

Thank you very much for this link. I don't have the time to check it now, there are other things on the list (Path WB, help texts).

Normand, you convince not only by your huge knowledge of FreeCAD and how to use it, but also you seem to know every post in the past.
And you are always willing to share your knowledge - thank you!

(From time to time this has to be said)
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: feature request: "deconstruct - reconstruct" macro

Post by NormandC »

chrisb wrote:Normand, you convince not only by your huge knowledge of FreeCAD and how to use it, but also you seem to know every post in the past.
LOL. I don't know all of them, obviously. But I've been around here a long time (the year next after the forum creation), I read a lot of the topics posted here, and I have a good memory (not what it used to be though :( ), particularly about things that matter to me (such as the topological naming issue), and I remembered this topic that got my attention back then.

After spending time with searches of the forum and the wiki, I found the link in my bookmarked topics. :D

I never managed to test these macros. They may not have a sufficient scope, but maybe they can be useful as a start for something better.
chrisb wrote:(From time to time this has to be said)
Thanks for your kind words!
herrdeh
Posts: 436
Joined: Wed Sep 03, 2014 12:15 pm

Re: feature request: "deconstruct - reconstruct" macro

Post by herrdeh »

I'm a little proud having initiated such a high-flying discussion... (-;

Now another my2cts:
In the case of the uncertainty discussed above (item with No.xy may have changed or not - may still in place or not) - wouldn't it be easiest to prompt the user? - "Tell me to which item I should apply this operation - I suggest to take this one" -- Instead of complex heuristics to guess "which item is which":

Meaning:
Before the process of deconstruction, FC saves all relevant attributes of all items temporarily - and while reconstruction, it compares which items are changed. On these, the programme prompts to the user.

This may result in a small number of "hit o.k." requests, but nevertheless a really great easement,

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

Re: feature request: "deconstruct - reconstruct" macro

Post by microelly2 »

herrdeh wrote: Before the process of deconstruction, FC saves all relevant attributes of all items temporarily - and while reconstruction, it compares which items are changed. On these, the programme prompts to the user.
This may result in a small number of "hit o.k." requests, but nevertheless a really great easement,
The proof of the concept is a prototype where you start with 2 parts and the system creates a mapping between the simuilarities of them.

example: two cubes differ in one dimension - then there are 4 mappings possible.

how good is a mapping between two parts?
what is the messure of the quality of such a mapping

this is what we are doing when we hold two parts in our hands. we rotate them until we say the correspond by placement.
but what are the values to look at? bound box moments of inertia, face/edge counts,
Post Reply