Sketcher: oversecting shapes break the resulting Pad depending on shape position

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
tml
Posts: 15
Joined: Sun Feb 07, 2016 3:10 pm

Sketcher: oversecting shapes break the resulting Pad depending on shape position

Post by tml »

I have an interesting case and I cannot find the reason why sometimes the resulting Pad'ded sketch is correct (produces a solid) while when move some shapes a bit it produces just a frame of the pad. File attached.

There is a base shape (crescent shaped) and a rectangle (4th quarter) and a circle (1st quarter). When I move the rectangle inside the base shape or outside of it it produces a solid shape. If it intersects the basic shape in the 4th quarter then it produces just a frame of the solid but when moved to the 2nd quarter and still intersecting, the solid shape is produced again. Is there any reason or is it a bug?

OS: "openSUSE Leap 42.2"
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.10236 (Git) (Packman)
Build type: Release
Branch: master
Hash: dd20ba3d068c4a0903417d93144f8ac7fed068e9
Python version: 2.7.12
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.9.1.oce-0.18-dev
Attachments
pads_intersects.fcstd
(9.21 KiB) Downloaded 30 times
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Sketcher: oversecting shapes break the resulting Pad depending on shape position

Post by DeepSOIC »

Hi!
The reason for it is the way Part Extrude tries to figure out, which wire is an outline of a face and which is an outline of a hole. This is how it does it:
1. Sort wires using length of bounding box diagonal as sorting field.
This ensures that outer wires come in before hole wires, for the next step.
2. Take wire one by one. Test it if the first vertex of the wire lies on any of the faces made so far. If it does, it is a hole wire, so a hole is added to the face. If the wire is not on a face, a new face is created.

This produces expected results as long as wires are not intersecting each other. In your case they do, hence the behavior.
You can change that behavior by changing property of extrude "Face Maker", which defaults to "Part::FaceMakerBullseye". If you set "Part::FaceMakerSimple", it will create face from every wire, not testing anything at all. You will get a compound of intersecting solids. (solids are valid, but compound itself is not very valid). Then, you can fuse the compound into a valid solid by selecting it and invokig Part Union.
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Sketcher: oversecting shapes break the resulting Pad depending on shape position

Post by NormandC »

tml wrote:Is there any reason or is it a bug?
What's the purpose of making profiles intersect themselves in the first place?

IMO this is not a proper way to model.
tml
Posts: 15
Joined: Sun Feb 07, 2016 3:10 pm

Re: Sketcher: oversecting shapes break the resulting Pad depending on shape position

Post by tml »

I ended up moving the intersecting objects to a separate Sketch and then perform boolean operations on padded Sketches.

The reason why I made them intersecting was that I wanted to have an arc's ends adjacent to circle's circumference so that I could trim the internal line and I could not find a way to have it done correctly, like this:
circles_1.png
circles_1.png (10.4 KiB) Viewed 1363 times
Every time I tried the ends looked to be misplaced and the internal line could not be trimmed (I must have done it wrongly).
I tried to do it now in 0.16 on an empty projects, seems to work, need to check 0.17pre once again when I'm back home.

EDIT: OK, just reproduced the issue I had (now on 0.16): if the circle/arc was already trimmed it cannot be trimed anymore.
As an example I added another arc on top and now I cannot trim the line indicated by yellow arrow as it produces random effects. The constraints look to be in place.
circles_5.png
circles_5.png (9.56 KiB) Viewed 1357 times
Attached the FreeCAD project for that.
Attachments
trims.FCStd
(3.45 KiB) Downloaded 26 times
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Sketcher: oversecting shapes break the resulting Pad depending on shape position

Post by NormandC »

I see your issue, yeah the trimming tool has always been iffy with trimming circles... Sometimes I'll add a straight line and trim the circle to it, then reconnect the arc end points and delete the line. When I know I want an arc I'll sketch an arc directly rather than a circle.
Post Reply