[Solved] PartDesign: Pad Up to Face with Custom direction

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!
User avatar
flachyjoe
Veteran
Posts: 1869
Joined: Sat Mar 31, 2012 12:00 pm
Location: Limoges, France

[Solved] PartDesign: Pad Up to Face with Custom direction

Post by flachyjoe »

Hi,
This combination of PartDesign_Pad options cause an error:
Capture d’écran_2022-11-21_13-14-08.png
Capture d’écran_2022-11-21_13-14-08.png (44.76 KiB) Viewed 1422 times
BrokenPad.FCStd
(14.73 KiB) Downloaded 27 times
Selected limit is the box up face.

Code: Select all

OS: Ubuntu 22.04.1 LTS (XFCE/xubuntu)
Word size of FreeCAD: 64-bit
Version: 0.21.31068 (Git)
Build type: Unknown
Branch: master
Hash: 186ed6e6198331ec7467844007a1074eb40989b3
Python 3.10.6, Qt 5.15.3, Coin 4.0.0, Vtk 7.1.1, OCC 7.5.2
Locale: French/France (fr_FR)
Last edited by flachyjoe on Mon Dec 12, 2022 12:08 pm, edited 3 times in total.
- Flachy Joe -
Image
User avatar
flachyjoe
Veteran
Posts: 1869
Joined: Sat Mar 31, 2012 12:00 pm
Location: Limoges, France

Re: PartDesign: Pad Up to Face with Custom direction

Post by flachyjoe »

Bump !

Is it a known bug ? Can I open a github issue :?:
- Flachy Joe -
Image
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: PartDesign: Pad Up to Face with Custom direction

Post by adrianinsaval »

flachyjoe wrote: Thu Nov 24, 2022 3:43 pm Can I open a github issue :?:
Go ahead, there's no requirement to post in the forum anymore (that being said please don't unnecessarily pollute the issue tracker either)
chrisb
Veteran
Posts: 53919
Joined: Tue Mar 17, 2015 9:14 am

Re: PartDesign: Pad Up to Face with Custom direction

Post by chrisb »

I guess it is an OCC issue, where the FreeCAD developers cannot do much. A ticket is sensible, so it can be checked when a new OCC version comes out.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
flachyjoe
Veteran
Posts: 1869
Joined: Sat Mar 31, 2012 12:00 pm
Location: Limoges, France

Re: PartDesign: Pad Up to Face with Custom direction

Post by flachyjoe »

@chrisb it doesn't come from OCC, the check didn't take care of the direction of extrusion :
https://github.com/FreeCAD/FreeCAD/blob ... d.cpp#L525

Code: Select all

    // Check that the upToFace does not intersect the sketch face and
    // is not parallel to the extrusion direction (for simplicity, supportface is used instead of sketchshape)
    BRepAdaptor_Surface adapt1(TopoDS::Face(supportface));
    BRepAdaptor_Surface adapt2(TopoDS::Face(upToFace));

    if (adapt2.GetType() == GeomAbs_Plane) {
        if (adapt1.Plane().Axis().IsNormal(adapt2.Plane().Axis(), Precision::Confusion()))
            throw Base::ValueError("SketchBased: Up to face: Must not be parallel to extrusion direction!");
    }
Fixed with https://github.com/FreeCAD/FreeCAD/pull/7879
- Flachy Joe -
Image
chrisb
Veteran
Posts: 53919
Joined: Tue Mar 17, 2015 9:14 am

Re: PartDesign: Pad Up to Face with Custom direction

Post by chrisb »

flachyjoe wrote: Fri Nov 25, 2022 8:54 pm @chrisb it doesn't come from OCC,
Black friday for my guessing rate :evil: .
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
flachyjoe
Veteran
Posts: 1869
Joined: Sat Mar 31, 2012 12:00 pm
Location: Limoges, France

Re: PartDesign: Pad Up to Face with Custom direction

Post by flachyjoe »

chrisb wrote: Fri Nov 25, 2022 9:36 pm Black friday for my guessing rate :evil: .
You're welcome, without your reflection I maybe didn't look the code ;)
- Flachy Joe -
Image
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: PartDesign: Pad Up to Face with Custom direction

Post by uwestoehr »

flachyjoe wrote: Fri Nov 25, 2022 8:54 pm Fixed with https://github.com/FreeCAD/FreeCAD/pull/7879
Thanks. However this PR deletes too much. The check that the distance between the sketch and the face must stay. The error message is however wrong.
Also since the face "adapt1" is no longer necessary, the face "adapt2" must be renamed.

While testing I also found another bug: the Reverse checkbox has no effect on "upToFace" and must therefore be disabled.

I will have a look.
User avatar
flachyjoe
Veteran
Posts: 1869
Joined: Sat Mar 31, 2012 12:00 pm
Location: Limoges, France

Re: PartDesign: Pad Up to Face with Custom direction

Post by flachyjoe »

Hi @uwestoehr ,
uwestoehr wrote: Fri Dec 02, 2022 6:37 pm The check that the distance between the sketch and the face must stay.
I'm not sure: in the case I described the distance is null but the pad can be done.
- Flachy Joe -
Image
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: PartDesign: Pad Up to Face with Custom direction

Post by adrianinsaval »

uwestoehr wrote: Fri Dec 02, 2022 6:37 pm While testing I also found another bug: the Reverse checkbox has no effect on "upToFace" and must therefore be disabled.
No I think we had enabled this on purpose before after we found it was sometimes needed, it's important when the face could be a limit on both sides of the profile, see this example, the pad gos up to the inner cylinder face and can be reversed.
Can you maybe add a comment in the code or even better a test script so that this isn't changed in the future by someone else? I can see how one can easily think this option doesn't make sense there.
Attachments
upToFaceREverseExample.FCStd
(26.07 KiB) Downloaded 22 times
Post Reply