Possible bug with Sketches and Boolean Fragments

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
jtm2020hyo
Posts: 594
Joined: Wed Aug 12, 2020 1:24 am

Possible bug with Sketches and Boolean Fragments

Post by jtm2020hyo »

Boolean fragments tool should split each Sketcher Edge in the intersections, but this just fails with Edge16, no idea why and I think this is very sure a bug.

Image

this happens in 0.19 and 0.20

Code: Select all

OS: Windows 10 (10.0)
Word size of FreeCAD: 64-bit
Version: 0.20.24847 (Git)
Build type: Release
Branch: master
Hash: 20e756306d9aa624fcbf465f0345d721673ce720
Python version: 3.9.2
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.1
Locale: Spanish/Peru (es_PE)
Attachments
SketcherBooleanPossibleBug.FCStd
(12.9 KiB) Downloaded 67 times
chrisb
Veteran
Posts: 54305
Joined: Tue Mar 17, 2015 9:14 am

Re: Possible bug with Sketches and Boolean Fragments

Post by chrisb »

jtm2020hyo wrote: Wed Jun 02, 2021 7:16 amI think this is very sure a bug.
I don't agree. Boolean Fragments works on several shapes, not a single one.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
Roy_043
Veteran
Posts: 8585
Joined: Thu Dec 27, 2018 12:28 pm

Re: Possible bug with Sketches and Boolean Fragments

Post by Roy_043 »

But apparently the edges in the sketch are seen as separate objects by the command. All edges are cut at the intersections, all except one.
chrisb
Veteran
Posts: 54305
Joined: Tue Mar 17, 2015 9:14 am

Re: Possible bug with Sketches and Boolean Fragments

Post by chrisb »

If something undocumented works in many, but not all cases, doesn't make it a bug for the cases where it doesn't work.

Besides: may I ask for the use case of such boolean fragments?
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: Possible bug with Sketches and Boolean Fragments

Post by openBrain »

jtm2020hyo wrote: Wed Jun 02, 2021 7:16 am Boolean fragments tool should split each Sketcher Edge in the intersections, but this just fails with Edge16, no idea why and I think this is very sure a bug.
Actually you're 2 times wrong. :)

1) Not only Edge16 isn't cut, but also Edge27
bf.png
bf.png (5.94 KiB) Viewed 2554 times
2) All this is perfectly normal and absolutely not a bug
According wiki :
Generally, at least two objects are needed, but a single compound containing the shapes to intersect will do as well.
Below a picture where I extracted and colored the subshapes contained in the sketch Compound shape, and you can see that what you get perfectly matches the fragments obtained by intersecting all different subshapes against each other.
bfshapes.jpeg
bfshapes.jpeg (20.02 KiB) Viewed 2554 times
UR_
Veteran
Posts: 1355
Joined: Tue Jan 03, 2017 8:42 pm

Re: Possible bug with Sketches and Boolean Fragments

Post by UR_ »

You can simply explode sketch with DowngradeToEdges using Lattice2 WB and apply BooleanFragments afterwards.

Screenshot 001.png
Screenshot 001.png (4.12 KiB) Viewed 2536 times


Sketch_Lattice2Downgrade_BooleanFragments.FCStd
(18.8 KiB) Downloaded 73 times
jtm2020hyo
Posts: 594
Joined: Wed Aug 12, 2020 1:24 am

Re: Possible bug with Sketches and Boolean Fragments

Post by jtm2020hyo »

openBrain wrote: Thu Jun 03, 2021 8:20 am
1) Not only Edge16 isn't cut, but also Edge27
bf.png
delete some lines fix this for Edge27

Image

... maybe is there any limit? if not, then I still think this is a bug.

_______________________________________________________________________
UR_ wrote: Thu Jun 03, 2021 9:09 am You can simply explode sketch with DowngradeToEdges using Lattice2 WB and apply BooleanFragments afterwards.

Screenshot 001.png

maybe this work but we lost the parametric feature, I found 2 alternatives to this problem

1) Split manually each Intersection

2) Separate Horizontal and Vertical Lines in 2 Sketches then Apply boolean again.

... in both cases we still have parametric features, but is an extra task
chrisb wrote: Thu Jun 03, 2021 7:49 am
Besides: may I ask for the use case of such boolean fragments?

Code: Select all

https://forum.freecadweb.org/viewtopic.php?f=3&t=58731
with nested Faces Edges and Vertex, we can create an entire pre-project just with 3 Sketches, in theory.

Image
UR_
Veteran
Posts: 1355
Joined: Tue Jan 03, 2017 8:42 pm

Re: Possible bug with Sketches and Boolean Fragments

Post by UR_ »

jtm2020hyo wrote: Thu Jun 03, 2021 5:25 pm ...maybe this work but we lost the parametric feature...
With Downgrade from Lattice2 WB, parametric is preserved, in opposite to Downgrade from Draft WB. ;)
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Possible bug with Sketches and Boolean Fragments

Post by openBrain »

jtm2020hyo wrote: Thu Jun 03, 2021 5:25 pm ... maybe is there any limit? if not, then I still think this is a bug.
No limit, no bug. It works strictly as designed and as documented.
Eventually it just doesn't fit your needs.
jtm2020hyo
Posts: 594
Joined: Wed Aug 12, 2020 1:24 am

Re: Possible bug with Sketches and Boolean Fragments

Post by jtm2020hyo »

Code: Select all

https://wiki.freecadweb.org/Part_Slice
according to Part_Slice documentation, Boolean Fragments should splitter intersections

Image

Image

... also @UR_ user showed us that Boolean Fragments works correctly with Lattice2 WB Edges

...then why Boolean Fragments work with Lattice2-WB and not with Sketcher-WB?
Post Reply