View Issue Details

IDProjectCategoryView StatusLast Update
0001269FreeCADFeaturepublic2013-10-11 10:35
Reporterimyrek Assigned Towmayer  
PrioritynormalSeverityminorReproducibilityrandom
Status closedResolutionfixed 
Product Version0.13 
Fixed in Version0.14 
Summary0001269: Parametr "tolerance" in "Create Mesh from geometry" work strange.
DescriptionParameter "tolerance" in python scripting Part.Shape.tessellate(tolerance)
and in GUI menu "Mesh Design" -> "Meshes" -> "Create Mesh from geometry" work strange.

Sometime it work correct, and sometime FreeCAD use previous value of this parametr(or return previous Mesh?).

Tested on:
OS: "Fedora release 18 (Spherical Cow)"
Platform: 64-bit
Version: 0.13.$WCREV$
Python version: 2.7.3
Qt version: 4.8.4
Coin version: 2.5.0
SoQt version: 1.5.0
OCC version: 6.5.4

OS: Ubuntu 10.04.4 LTS
Platform: 32-bit
Version: 0.14.2509 (Git)
Branch: master
Hash: 7cecafefaa67298486f6538ab34389dd825e38ae
Python version: 2.6.5
Qt version: 4.6.2
Coin version: 3.1.2
SoQt version: 1.4.2a
OCC version: 6.3.0
Additional InformationPython 2.7.3 (default, Aug 9 2012, 17:23:57)
[GCC 4.7.1 20120720 (Red Hat 4.7.1-5)] on linux2
(...)
>>> testPart = FreeCAD.ActiveDocument.addObject("Part::Feature","TestPart")
>>> testPart.Shape=Part.makeSphere(66)
>>> testPart.Shape.tessellate(6)[1].__len__()
2406
>>> testPart.Shape.tessellate(5)[1].__len__()
2406
>>> testPart.Shape.tessellate(4)[1].__len__()
2406
>>> testPart.Shape.tessellate(1)[1].__len__()
2406
>>> testPart.Shape.tessellate(0.6)[1].__len__()
2556
>>> testPart.Shape.tessellate(0.4)[1].__len__()
3830
>>> testPart.Shape.tessellate(0.2)[1].__len__()
6896
>>> testPart.Shape.tessellate(0.1)[1].__len__()
12962
>>> testPart.Shape.tessellate(0.06)[1].__len__()
20178
>>> testPart.Shape.tessellate(0.1)[1].__len__()
12962
>>> testPart.Shape.tessellate(0.2)[1].__len__()
12962
>>> testPart.Shape.tessellate(0.4)[1].__len__()
12962
>>> testPart.Shape.tessellate(0.6)[1].__len__()
12962
>>> testPart.Shape.tessellate(1)[1].__len__()
12962
>>> testPart.Shape.tessellate(0.66)[1].__len__()
12962
>>> testPart.Shape=Part.makeSphere(66)
>>> testPart.Shape.tessellate(0.66)[1].__len__()
2406
>>> testPart.Shape.tessellate(1)[1].__len__()
2406
>>> testPart.Shape.tessellate(0.01)[1].__len__()
98036
>>>
>>> testPart.Shape.tessellate(0.1)[1].__len__()
98036
>>> testPart.Shape.tessellate(1)[1].__len__()
98036
>>>
TagsNo tags attached.
FreeCAD Information

Activities

wmayer

2013-10-11 10:15

administrator   ~0003728

When tessellating a shape the mesh is kept internally because this is used for many algorithms like bounding box checks, boolean operations, ...
If you tessellate a mesh with a certain tolerance then it overwrites the current mesh if it's finer (i.e. has more triangles). This means that if you again try to create a coarser mesh this will be rejected.

So, this is totally comprehensible behaviour.

wmayer

2013-10-11 10:34

administrator   ~0003729

There is now second but optional argument in tessellate(). False (default) means to keep the old triangulation amd True means to clear it.

So, this snippet will show the behaviour you have expected:

testPart = FreeCAD.ActiveDocument.addObject("Part::Feature","TestPart")
testPart.Shape=Part.makeSphere(66)
testPart.Shape.tessellate(6,True)[1].__len__()
testPart.Shape.tessellate(5,True)[1].__len__()
testPart.Shape.tessellate(4,True)[1].__len__()
testPart.Shape.tessellate(1,True)[1].__len__()
testPart.Shape.tessellate(0.6,True)[1].__len__()
testPart.Shape.tessellate(0.4,True)[1].__len__()
testPart.Shape.tessellate(0.2,True)[1].__len__()
testPart.Shape.tessellate(0.1,True)[1].__len__()
testPart.Shape.tessellate(0.06,True)[1].__len__()
testPart.Shape.tessellate(0.1,True)[1].__len__()
testPart.Shape.tessellate(0.2,True)[1].__len__()
testPart.Shape.tessellate(0.4,True)[1].__len__()
testPart.Shape.tessellate(0.6,True)[1].__len__()
testPart.Shape.tessellate(1,True)[1].__len__()
testPart.Shape.tessellate(0.66,True)[1].__len__()
testPart.Shape=Part.makeSphere(66)
testPart.Shape.tessellate(0.66,True)[1].__len__()
testPart.Shape.tessellate(1,True)[1].__len__()
testPart.Shape.tessellate(0.01,True)[1].__len__()
testPart.Shape.tessellate(0.1,True)[1].__len__()
testPart.Shape.tessellate(1,True)[1].__len__()

wmayer

2013-10-11 10:35

administrator   ~0003730

git show e631be1

Issue History

Date Modified Username Field Change
2013-10-10 21:18 imyrek New Issue
2013-10-11 10:15 wmayer Note Added: 0003728
2013-10-11 10:32 wmayer Assigned To => wmayer
2013-10-11 10:32 wmayer Status new => assigned
2013-10-11 10:32 wmayer Category Bug => Feature
2013-10-11 10:34 wmayer Note Added: 0003729
2013-10-11 10:35 wmayer Note Added: 0003730
2013-10-11 10:35 wmayer Status assigned => closed
2013-10-11 10:35 wmayer Resolution open => fixed
2013-10-11 10:35 wmayer Fixed in Version => 0.14