PartDesign Hole feature

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!
User avatar
fosselius
Posts: 381
Joined: Sat Apr 23, 2016 10:03 am
Contact:

Re: PartDesign Hole feature

Post by fosselius »

Cant you add a check and see if the shape changed after the hole was applied? Otherwise automaticly change direction, if that fails as well throw an error message?
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: PartDesign Hole feature

Post by sgrogan »

fosselius wrote: Thu Jul 27, 2017 9:20 pm Cant you add a check and see if the shape changed after the hole was applied? Otherwise automaticly change direction, if that fails as well throw an error message?
eivindkvedalen wrote: Thu Jul 27, 2017 7:53 pm No, currently there's no reverse option. I've only tested this with sketches attached to a face, and there it works as expected. But with sketches as you have tested, it doesn't work as expected. The pocket feature behaves the same way, btw. Not sure what the correct solution is; adding a reverse option doesn't feel like the right thing to do (although pocket also has it)...
Doesn't this hint at a deeper flaw? It seems like a work around not a fix?
"fight the good fight"
chrisb
Veteran
Posts: 54306
Joined: Tue Mar 17, 2015 9:14 am

Re: PartDesign Hole feature

Post by chrisb »

fosselius wrote: Thu Jul 27, 2017 9:20 pm Cant you add a check and see if the shape changed after the hole was applied? Otherwise automaticly change direction, if that fails as well throw an error message?
I don't like too much automatism.
Since sketches can be attached to datum planes which dont't even have to touch any solid I would like to see a possibility to control the direction. Think of a U-shaped solid with a datum plane in the middle.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
peterl94
Veteran
Posts: 1001
Joined: Thu May 23, 2013 7:31 pm
Location: United States

Re: PartDesign Hole feature

Post by peterl94 »

eivindkvedalen wrote: Thu Jul 27, 2017 7:53 pm adding a reverse option doesn't feel like the right thing to do
I don't see anything wrong with such an option. The hole feature in NX has a direction option that either can be set to "normal to face" or "along vector." When it is set to "along vector," you can pick a vector by various methods and reverse it if needed.
User avatar
fosselius
Posts: 381
Joined: Sat Apr 23, 2016 10:03 am
Contact:

Re: PartDesign Hole feature

Post by fosselius »

chrisb wrote: Thu Jul 27, 2017 10:48 pm Think of a U-shaped solid with a datum plane in the middle.
Then we should have 10 direction configurations? I am thinking:
←|→ , →|← , →|→ , ←|← , <-|- , -|->, |→ , |← , ←| , →|

Should there be an distance offset field as well?

How about not parallell sketch/shape relations? Where the shape is in an angle relative to the hole sketch? Will the hole for the screw head start at first contact or when the 2D cut shape have full contact?

This could be solved with an offset and two length dimensions, cut head to the left and hole to the right.

But the offset will be different if several holes is in the sketch.

I guess there are no upper limit to the complexity of a hole feature...
Last edited by fosselius on Fri Jul 28, 2017 4:50 am, edited 1 time in total.
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: PartDesign Hole feature

Post by NormandC »

kkremitzki wrote: Thu Jul 27, 2017 10:40 am Is there a way to reverse the direction of the hole? I did some experimentation by attaching sketches to the XY, YZ, and XZ planes, making a big circle and padding it, and then making a small circle to base the hole on. In all cases, the hole only appears if the pad is reversed; with a normal pad, I just end up with a circular face with the diameter the hole should've had.
The workaround is simple: set the "Map Reversed" property of your sketch to true.

Nevermind the angled hole, I was having fun. :D

Eivind, I just have a very tiny critic about the wording "None" for the Hole cut type. May I suggest replacing it with "Straight"?
Attachments
FC017_angled_PD_Hole_normandc1.fcstd
(67.8 KiB) Downloaded 65 times
eivindkvedalen
Posts: 602
Joined: Tue Jan 29, 2013 10:35 pm

Re: PartDesign Hole feature

Post by eivindkvedalen »

sgrogan wrote: Thu Jul 27, 2017 9:43 pm
eivindkvedalen wrote: Thu Jul 27, 2017 7:53 pm No, currently there's no reverse option. I've only tested this with sketches attached to a face, and there it works as expected. But with sketches as you have tested, it doesn't work as expected. The pocket feature behaves the same way, btw. Not sure what the correct solution is; adding a reverse option doesn't feel like the right thing to do (although pocket also has it)...
Doesn't this hint at a deeper flaw? It seems like a work around not a fix?
This is why I don't want to add a reverse option. However, it isn't a deeper flaw: when padding, you add material in the positive z direction, and when you attach a sketch to a face, its z direction is "away" from the face, so a new pad will add more material in positive z direction. A hole thus works in the negative z direction. When a sketch is not attached to a face, the z direction then becomes somewhat arbitrary. Specifically, because material is padded in positive direction, if the sketch used for padding and hole is at Z = 0, they will go in opposite directions, and only intersect in the plane (thus causing the circle).

Eivind
eivindkvedalen
Posts: 602
Joined: Tue Jan 29, 2013 10:35 pm

Re: PartDesign Hole feature

Post by eivindkvedalen »

fosselius wrote: Thu Jul 27, 2017 9:20 pm Cant you add a check and see if the shape changed after the hole was applied? Otherwise automaticly change direction, if that fails as well throw an error message?
This may lead to some surprising behaviour, as pointed out by chrisb.

Eivind
eivindkvedalen
Posts: 602
Joined: Tue Jan 29, 2013 10:35 pm

Re: PartDesign Hole feature

Post by eivindkvedalen »

fosselius wrote: Thu Jul 27, 2017 11:25 am Support for Hex head / Nut would be awesome. Its one of the most common screw holes i make. But i guess the orientation might become an issue?
This is something I will add to my todo.

Eivind
eivindkvedalen
Posts: 602
Joined: Tue Jan 29, 2013 10:35 pm

Re: PartDesign Hole feature

Post by eivindkvedalen »

NormandC wrote: Fri Jul 28, 2017 2:54 am The workaround is simple: set the "Map Reversed" property of your sketch to true.

Nevermind the angled hole, I was having fun. :D

Eivind, I just have a very tiny critic about the wording "None" for the Hole cut type. May I suggest replacing it with "Straight"?
Thank you for providing a workaround (I actually think this is the propery solution, though...), and an example.

Regarding the naming, I think I will rename it, but maybe not to Straight. This profile is meant for completely custom holes (I plan to add the hex inset for this one), so maybe "Custom" is better...? When I have time to add threading, this will also be part of this profile.

Eivind
Post Reply