View Issue Details

IDProjectCategoryView StatusLast Update
0001465FreeCADBugpublic2014-03-11 02:10
Reporterbeamer146 Assigned Towmayer  
Status closedResolutionfixed 
PlatformAllOSAllOS VersionAll
Product Versiontrunk 
Fixed in Version0.14 
Summary0001465: scale() operation makes face invalid
DescriptionApplying the scale operation on eg a copy of a face of a box makes the face invalid. Doing further operations on the face (eg extruding) then leads to incorrect shapes.
(it is also strange that the wire of a face is not closed, however this does not seem to be a problem)

Sample program:

from __future__ import division # allows floating point division from integers
# first of all you need the Part nd ( the Drawing module:
import FreeCAD, Part, Drawing, Draft
from FreeCAD import Base
# For printing varnames
import inspect, re
import math
def clearDoc( a_doc ):
    l_aoAllObjs = a_doc.Objects
    for l_objCur in l_aoAllObjs:
        a_doc.removeObject( l_objCur.Name )
if (m_doc== None):
    m_doc = FreeCAD.newDocument()
clearDoc( m_doc )
l_vobBox= m_doc.addObject("Part::Feature", "vobBox")
l_vobBox.Shape = l_mdlBox
l_faceCur = l_mdlBox.Faces[ 3 ]
FreeCAD.Console.PrintMessage( "Face index 3 : Nb Wires: " + str(len(l_faceCur.Wires ))+", Wire 0 closed ? " + str(l_faceCur.Wires[0].isClosed()) + "\n")
l_vctNormal = l_faceCur.normalAt( 0.5, 0.5 )
l_faceCopy = l_faceCur.copy()
# Note that if I do not add this scale operation, the wire is still not closed but faceCopy2 is valid.
FreeCAD.Console.PrintMessage( "faceCopy valid before scale? " + str(l_faceCopy.isValid()) + "\n")
l_faceCopy.scale( 2.0, Base.Vector(2,3,4) )
FreeCAD.Console.PrintMessage( "faceCopy valid after scale ? " + str(l_faceCopy.isValid()) + "\n")

Sample Program output (most recent version I tried was 0.14 3167 2014/0218 22:05:48 on Linux, but eg the 0.13 release for windows has it as well):
Face index 3 : Nb Wires: 1, Wire 0 closed ? False
faceCopy valid before scale? True
faceCopy valid after scale ? False

Steps To ReproduceSee description
Additional Information
TagsNo tags attached.
FreeCAD Information


related to 0001463 closedwmayer setting Vertex.Tolerance modifies bound and shared shapes 



2014-03-08 09:37

administrator   ~0004391

Last edited: 2014-03-08 11:42

> it is also strange that the wire of a face is not closed, however this does not seem to be a problem
When querying the wire whether it's closed then only a flag of the TopoDS_Shape class is checked, it doesn't do a geometric check at this time. I don't know if OCC simply forgot to set this flag or if it is intentional.

> scale() operation makes face invalid
Apparently you haven't tested this with the latest trunk. There was a fix on the copy() method which fixes this issue as well.

Issue History

Date Modified Username Field Change
2014-03-07 19:57 beamer146 New Issue
2014-03-08 09:37 wmayer Note Added: 0004391
2014-03-08 09:38 wmayer Relationship added related to 0001463
2014-03-08 11:42 wmayer Note Edited: 0004391
2014-03-10 10:02 wmayer Status new => resolved
2014-03-10 10:02 wmayer Fixed in Version => 0.14
2014-03-10 10:02 wmayer Resolution open => fixed
2014-03-10 10:02 wmayer Assigned To => wmayer
2014-03-11 02:10 yorik Status resolved => closed