@HardRock, please open a forum thread to discuss before opening a ticket per our guidelines.HardRock wrote: ↑Thu Oct 15, 2020 6:45 pm Already have posted one in bugtracker
https://tracker.freecadweb.org/view.php?id=4460
Ticket #4460: Draft Upgrade - Incorrect result
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Ticket #4460: Draft Upgrade - Incorrect result
Discussion thread for issue #4460: Draft Upgrade - Incorrect result
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
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
-
- Posts: 124
- Joined: Wed Jun 19, 2019 7:44 pm
Re: Ticket #4460: Draft Upgrade - Incorrect result
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.
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.
Re: Ticket #4460: Draft Upgrade - Incorrect result
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.
Re: Ticket #4460: Draft Upgrade - Incorrect result
Reporter had already open a thread about this ticket.
-
- Posts: 124
- Joined: Wed Jun 19, 2019 7:44 pm
Re: Ticket #4460: Draft Upgrade - Incorrect result
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.
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.