Ticket #4460: Draft Upgrade - Incorrect result

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Ticket #4460: Draft Upgrade - Incorrect result

Post by Kunda1 »

Discussion thread for issue #4460: Draft Upgrade - Incorrect result
HardRock wrote: Thu Oct 15, 2020 6:45 pm Already have posted one in bugtracker ;)

https://tracker.freecadweb.org/view.php?id=4460
@HardRock, please open a forum thread to discuss before opening a ticket per our guidelines.
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
marioalexis
Posts: 124
Joined: Wed Jun 19, 2019 7:44 pm

Re: Ticket #4460: Draft Upgrade - Incorrect result

Post by marioalexis »

Hello.
In this case, the Upgrade tool uses the internal joinFaces function, which in turn uses the concatenate function from DraftGeomUtils and there is no chance it will work well with these 3D shapes. The result will be a flat shape generated by one of the border wires resulting from the fusion.
Maybe someone with more experience in Freecad can correct me, but the Draft code seems to have been written to work primarily with flat shapes and, in some cases, preferably in the XY plane.
There is a simpler example where you see a fault: Draw 3 circles, all three overlapping, leaving an interior triangular hole. In this case, the three shapes will be concatenated but filling the inner hole, and depending on the order of selection, the shape created will be the one corresponding to the inner hole, eliminating the three original circles.
chrisb
Veteran
Posts: 54313
Joined: Tue Mar 17, 2015 9:14 am

Re: Ticket #4460: Draft Upgrade - Incorrect result

Post by chrisb »

So should this be changed to a feature request? Does the documentation need to be updated?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Ticket #4460: Draft Upgrade - Incorrect result

Post by openBrain »

Reporter had already open a thread about this ticket.
User avatar
Roy_043
Veteran
Posts: 8585
Joined: Thu Dec 27, 2018 12:28 pm

Re: Ticket #4460: Draft Upgrade - Incorrect result

Post by Roy_043 »

openBrain wrote: Mon Oct 19, 2020 7:38 am Reporter had already open a thread about this ticket.
https://forum.freecadweb.org/viewtopic.php?f=3&t=51225
marioalexis
Posts: 124
Joined: Wed Jun 19, 2019 7:44 pm

Re: Ticket #4460: Draft Upgrade - Incorrect result

Post by marioalexis »

In that thread it is stated that the shapes do not fit perfectly. In this situation, that is not the problem.
The function calling sequence is (in short) the following:
Upgrade -> joinFaces -> {isCoplanar, concatenate -> {getBoundary, Part.Face}}
The first error occurs with isCoplanar since it assumes that the shapes are flat, which enables the algorithm to continue using the concatenate function. In git commit aa88f3d I propose a new function called are_coplanar capable of dealing with this type of shapes and giving the correct return (False).
Now, concatenate calls getBoundary which correctly returns the edges of the fusion, so there is no problem with the fit of the shapes.
Then concatenate builds a face with only one of the borders of the fusion and from there the flat shape exposed in the @HardRock example is obtained.
Post Reply