[solved] Face.Orientation bug?
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
[solved] Face.Orientation bug?
Hi, I am not sure if this is what I think. The Face.Orientation should return info about the sink in object? For Cube is works correctly for each face but for Pad the opposite faces return the same value? is it bug or the Face.Orientation means something different?
Last edited by dprojects on Thu Aug 04, 2022 7:51 am, edited 1 time in total.
Thanks
Darek
github.com/dprojects
workbench for woodworking is available at: github.com/dprojects/Woodworking
Re: Face.Orientation bug?
Usually orientation mean normals so Normal and Reverse are referring to the outside and inside of the solid, or this I've been told some time ago, if you make a fusion if faces are "reversed" they became "holes".
What is the explanation of:
Code: Select all
help(Part.Face.Orientation)
Sorry I could not check now as I'm on mobile.
Regards
Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
Re: Face.Orientation bug?
It is related to the parameterization.
Code: Select all
if shape.Orientation == "Reversed":
self.u, self.v = self.v, self.u
- wandererfan
- Veteran
- Posts: 6309
- Joined: Tue Nov 06, 2012 5:42 pm
- Contact:
Re: Face.Orientation bug?
Explanation of Face orientation is about half way down this: https://opencascade.blogspot.com/2009/02/continued.htmldprojects wrote: ↑Wed Aug 03, 2022 7:52 pm Hi, I am not sure if this is what I think. The Face.Orientation should return info about the sink in object? For Cube is works correctly for each face but for Pad the opposite faces return the same value? is it bug or the Face.Orientation means something different?
Re: Face.Orientation bug?
Thanks for the link, it contains many other interesting informations about the kernel.wandererfan wrote: ↑Thu Aug 04, 2022 12:54 am Explanation of Face orientation is about half way down this: https://opencascade.blogspot.com/2009/02/continued.html
Regards
Carlo D
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
Re: Face.Orientation bug?
Maybe this works correctly only at the Cube because it is Part feature not PartDesign? For Cube the opposite face has always opposite orientation. But for Pads there is only one face with Reversed orientation. Looks like it is only supported for Part Cube objects.
However, I make my own sink function. I needed the information for new drilling holes feature. I needed to know to which direction I should drill the hole. However, this new function allow me to improve the magicDowels tool and now all the dowels by default can be re-positioned correctly, without manually rotation and offset from the edge adjustment, and with no matter which face is chosen. And also the dowels will be working for Pads now.
This is great because if I will be able to determine to which direction is the element, this push the woodworking tools to the another level, I guess.
Thanks
Darek
github.com/dprojects
workbench for woodworking is available at: github.com/dprojects/Woodworking
Re: Face.Orientation bug?
Sorry, I've checked the help and in effect is not helping much.
In the link @wandererfan posted, you could read this.
Face orientation shows how face normal is aligned with its surface normal. If orientation is TopAbs_FORWARD then normals match, if TopAbs_REVERSED then they are opposite to each other.
Face normal shows where body material is – it lies ‘behind' the face. In a correct solid body all face normals go ‘outward' (see below):
So if the orientation is "reverse", probably Part Design is not following the rule:
It is worth reporting it to the developers?In a correct solid body all face normals go ‘outward'
Regards
Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
Re: Face.Orientation bug?
This might be the reason. Pad has different edges, faces and vertices order than Cubes. To get this dowels working with Pads I have also recalculate (switch) the vertices because they normally starts from other point. Also edges stored at faces are in different order. Normally for Cubes the are something like short, long, short, long but for Pads they are short, short, long, long.
I am not sure. This is probably not bug. Maybe they use this for something. I was thinking this option will be useful to solve the sink problem but it is probably used for something different. I think the __doc__ there could be improved because there is no info what it is and how it works. So this may confuse other developers if they will be thinking like me. They make some tests with Cubes and this will be working, but for Pads this fail.
Thanks
Darek
github.com/dprojects
workbench for woodworking is available at: github.com/dprojects/Woodworking
Re: Face.Orientation bug?
I'm also confused and I've tried to obtain some more descriptive documentation, but it is a difficult task, as some code is old, dervied from OCCT that have his own solution, probably the best thing that we could obtain is some explanation and maybe some hints, on "how to ass proper doc code" to sources.
But I see that it is difficult to obtain "writing permssions" to the source code only to make some "documentation efforts" as you could risk to damage developers works.
And I see no other solutions, other than having a mean to "add documentation strings" as a separate sources, maybe with some "formatted files" that could be retrieved and output when you perform a:
Code: Select all
help(something)
Hoping to have expressed in a intelligible way.
Regards
Carlo D:
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
Re: Face.Orientation bug?
But you can't call the command from macro? the __doc__ command works from macro so you can get all info at scanObjects just by browsing.
Thanks
Darek
github.com/dprojects
workbench for woodworking is available at: github.com/dprojects/Woodworking