"Refine shape" flips normals

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!
User avatar
angow
Posts: 72
Joined: Sun Dec 11, 2011 2:29 pm

"Refine shape" flips normals

Post by angow »

Refining shape causes some transparent faces on special parts.
Is there a way to make them two-sided?

Version 0.13
Rev. 0681
Windows Vista (32-bit)
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: "Refine shape" flips normals

Post by wmayer »

Refining shape causes some transparent faces on special parts.
Can you upload this example? And what do you mean with transparent in context with refining?
Is there a way to make them two-sided?
In the property editor you can set Lighting to Two-sided.
User avatar
angow
Posts: 72
Joined: Sun Dec 11, 2011 2:29 pm

Re: "Refine shape" flips normals

Post by angow »

wmayer wrote: Can you upload this example? And what do you mean with transparent in context with refining?
After I run "Refine shape" on part WB some faces seems transparent so you can look through them.
This is typical when normals of faces flip to the other side. One way is to select this faces and flip the normal to the other side or to make them two-sided so they are opaque from both side.
wmayer wrote:In the property editor you can set Lighting to Two-sided.
Sorry, but I can't find the property editor.

In this example you can see it on the right mount.
Attachments
Y_Rod_Mount_ refined.FCStd
(90.28 KiB) Downloaded 96 times
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: "Refine shape" flips normals

Post by wmayer »

After I run "Refine shape" on part WB some faces seems transparent so you can look through them.
The face is not transparent, it is lost! This is very likely a bug in the refinement algorithm.
This is typical when normals of faces flip to the other side. One way is to select this faces and flip the normal to the other side or to make them two-sided so they are opaque from both side.
In FreeCAD reverted faces appear in black if lighting is set to One side.
Sorry, but I can't find the property editor.
View > Views > Combo view. Select the object and on the View tab you'll find Lighting. But as said above the face is missing, not transparent.

Edit: I must partially revert what I said. The face _is_ there and its orientation is indeed reversed. But it's really missing in the visualization of the B-REP model probably because of its bad orientation. If I make a mesh from the B-REP model the face is in the mesh but with reversed normal. But the question still is: does the refinement create this invalid face?

Edit2: The answer is yes. When I disable the cylinder refinement everything is OK
User avatar
tanderson69
Veteran
Posts: 1626
Joined: Thu Feb 18, 2010 1:07 am

Re: "Refine shape" flips normals

Post by tanderson69 »

wmayer wrote:Edit2: The answer is yes. When I disable the cylinder refinement everything is OK
I agree. I will have a look at it.
emills
Posts: 36
Joined: Fri Jan 06, 2012 3:17 am

Re: "Refine shape" flips normals

Post by emills »

could this "reversed in brep/ absent in model" problem be related to fillets having perfectly calculated filleted contours but ending with whole faces missing?
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: "Refine shape" flips normals

Post by wmayer »

No, this was a little bug in the cylinder refinement algorithm which is already fixed.
emills
Posts: 36
Joined: Fri Jan 06, 2012 3:17 am

Re: "Refine shape" flips normals

Post by emills »

[if this is still completely off the mark, please just ignore :)]
i was talking about the very next thread on this subforum. (i had been time travellling, and got confused where to post)
" you can select only one edge in a chain and the fillet/chamfer will propagate to all tangent edges? Cool!


That's the default behaviour of the filleting algorithm. We have no control over this.

" Any idea why that would happen?


No, but the shape has an error: StandardError: Bad orientation of sub-shape
i was wondering, because it just looks similar, in general terms, to the particular outcome of that refinement bug. not saying one causes the others. but if the missing surfaces on bad fillets were to be present and normal flipped at the brep level, could all these bad fillets not be fixed by a fairly straightforward routine? like have the user identify a surface with good normals, then propagate the orientation to tangent/adjoining surfaces?

not talking about the cases where the whole object disappears, which it the true limit of the fillet algo, but the ones where it clearly worked, and then changed its mind and messed up the object.
User avatar
tanderson69
Veteran
Posts: 1626
Joined: Thu Feb 18, 2010 1:07 am

Re: "Refine shape" flips normals

Post by tanderson69 »

emills wrote:...like have the user identify a surface with good normals, then propagate the orientation to tangent/adjoining surfaces?
I supposed this is possible, but I would consider it a hack to make the user fix modelling data after a modelling operation. Developer time is better used preventing these corruptions than trying to build an interface to fix them. At least for the refine problem, the orientation of the bounding wire was the problem and not the surface normal. So there is more to it than just flipping surface normals.
User avatar
shoogen
Veteran
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: "Refine shape" flips normals

Post by shoogen »

I'm trying to import OpenSCAD example016 to FreeCAD. To do boolean operations with other Parts i use makeShapeFromMesh(). The resulting Part is valid but the boolean operations fails (maybe because of coplanar faces). Therefore I wanted to do a refine shape on this Part.
unfortunatly this changes the orientation of the hole Part as the Volume becomes negative. Does anyone see a solution for this problem?
Spliting the independent components first and then applying make Shape from mesh on each and do the refine Shape on each didn't solve the problem?
Post Reply