[PR #3888] extend pad direction feature
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
[PR #3888] extend pad direction feature
During the development of the feature to specify the pad direction, there were 2 wishes that I implement with this PR: https://github.com/FreeCAD/FreeCAD/pull/3888
1. have an option to measure the pad length not always along the sketch normal
Solution:
2. a possibility to select an edge from the model and use its direction as pad direction
Solution: As you can see one can select an edge also from another part than the pad (in the example the box is in another part).
I implemented a third feature:
3. button to quickly reverse the direction
In the screencast for 2. you see after the selection of "Box:Edge12" that the pad direction is towards the inner of the hexagon and the pad is therefore inside it. Therefor a button is helpful to reverse the direction since when selecting an edge you cannot know in advance what of its two endpoints is its start point. The button helps in my opinion also if no edge is selected.
1. have an option to measure the pad length not always along the sketch normal
Solution:
2. a possibility to select an edge from the model and use its direction as pad direction
Solution: As you can see one can select an edge also from another part than the pad (in the example the box is in another part).
I implemented a third feature:
3. button to quickly reverse the direction
In the screencast for 2. you see after the selection of "Box:Edge12" that the pad direction is towards the inner of the hexagon and the pad is therefore inside it. Therefor a button is helpful to reverse the direction since when selecting an edge you cannot know in advance what of its two endpoints is its start point. The button helps in my opinion also if no edge is selected.
Last edited by uwestoehr on Wed Sep 23, 2020 12:46 am, edited 1 time in total.
Re: [PR #3888] extend pad direction feature
Is "Reverse Direction" different from the Reversed checkbox?
Edit: And another question: Is the direction following an edge parametric?
Edit: And another question: Is the direction following an edge parametric?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: [PR #3888] extend pad direction feature
Yes, it updates the direction vector and is always visible, also for 2 dimensions. Moreover it does not change the "Reversed" property.
At first I thought I should extend the existing Reverse checkbox but I think the dialog shoudl always show the correct direction the pad is extruded at, not the opposite direction, in case one used the Reverse property.
I cannot get rid of the Reverse property because this would break existing documents but I could get rid of the Reverse checkbox in the dialog. Personally, I would do this.
Opinions?
No, it is for now exactly the same as when you select a face for the up to face feature. It could maybe made parametric in future, but not for this PR because I already changed a lot and prefer several steps to keep the overview.Is the direction following an edge parametric?
Re: [PR #3888] extend pad direction feature
This is now done. This fixes also the issue mentioned by users: when there are two dimensions, reversal should be allowed. This is now the case:
I only see one thing so far that could be improved: When it is up to face and the direction is orthogonal to the face's normal vector, maybe I should make the background color of the field name edit red and change its tooltip writing that the face is orthogonal to the direction.
Re: [PR #3888] extend pad direction feature
Thanks so far for the pad extension!
Up to face is parametric. So if following the direction is similar, maybe it's not too hard to implement.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: [PR #3888] extend pad direction feature
Change in the attached file the 50mm constraint in Sketch to 100mm and see how the length of Pad001 is adapted.
- Attachments
-
- upToFaceParametric.FCStd
- (12.99 KiB) Downloaded 63 times
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: [PR #3888] extend pad direction feature
Thanks. Now I understand what you mean.
So the answer is yes, the edge you select for the direction is as parametric as every other shape (like the face in your example).
The toponaming issue can of course affect the selection, but this applied for the existing face selection too.
Re: [PR #3888] extend pad direction feature
First of all this PR causes all travis builds to fail because it breaks the unit tests for pad.
And each time I toggle the "Use custom direction" box it automatically sets the check mark of "Along sketch normal".
I played with the pad dialog a bit and by selecting an edge I got it working only once. After pressing several buttons it stopped working after re-selecting an edge. The pad direction is always normal to the sketch plane. I think by adding two more properties it easily happens that the pad is in an consistent state.
I don't understand its purpose (and the property AlongCustomVector) and its tooltip doesn't enlighten me. We already have UseCustomVector so why is another property needed?1. have an option to measure the pad length not always along the sketch normal
And each time I toggle the "Use custom direction" box it automatically sets the check mark of "Along sketch normal".
Is having an additional link property to an edge to control the pad direction really what we want to have? Or wouldn't it be sufficient to get the direction of the edge and fill the custom direction fields by using an expression? With the current development version it's already possible to do exactly this but it's a bit difficult to do it manually. In the property editor you select the Direction property and set e.g. this expression:2. a possibility to select an edge from the model and use its direction as pad direction
Code: Select all
Sketch001.Shape.Edge1.Vertex1.Point - Sketch001.Shape.Edge1.Vertex2.Point
It must not even be allowed to select an edge of the pad, or otherwise you will break the model with a dependency to itself.As you can see one can select an edge also from another part than the pad (in the example the box is in another part).
In the current PR the "Reverse direction" button has replaced the "Reversed" check box. This makes no sense to me because it's effectively not possible any more to toggle the Reversed property of the pad feature. And if an expression for Direction is set the "Reverse direction" button does not even work.3. button to quickly reverse the direction
In the screencast for 2. you see after the selection of "Box:Edge12" that the pad direction is towards the inner of the hexagon and the pad is therefore inside it. Therefor a button is helpful to reverse the direction since when selecting an edge you cannot know in advance what of its two endpoints is its start point. The button helps in my opinion also if no edge is selected.
I played with the pad dialog a bit and by selecting an edge I got it working only once. After pressing several buttons it stopped working after re-selecting an edge. The pad direction is always normal to the sketch plane. I think by adding two more properties it easily happens that the pad is in an consistent state.
The Reverse property is now even more useful since the Direction property has been added if e.g. an expression is set to the latter.I cannot get rid of the Reverse property because this would break existing documents but I could get rid of the Reverse checkbox in the dialog.
By using an expression it is parametric.Up to face is parametric. So if following the direction is similar, maybe it's not too hard to implement.
- DeepSOIC
- Veteran
- Posts: 7896
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Re: [PR #3888] extend pad direction feature
In anticipation of proper topological naming, i think yes, we need a link.
Link property is going to be properly supported, while the expression might not be.