Fix testSTL

On branch cq1_pythonocc
	zmodyfikowany: cadquery/occ_impl/shapes.py
Untracked files:
	cq.testbench.task
no changes added to commit (use "git add" and/or "git commit -a")
This commit is contained in:
Adam Urbanczyk
2017-09-01 23:58:01 +02:00
parent c35472a745
commit db65cef814
2 changed files with 6 additions and 2 deletions

View File

@ -88,6 +88,7 @@ from OCC.ShapeFix import ShapeFix_Wire, ShapeFix_Face
from OCC.STEPControl import STEPControl_Writer, STEPControl_AsIs
from OCC.BRepMesh import BRepMesh_IncrementalMesh
from OCC.StlAPI import StlAPI_Writer
from OCC.TopTools import TopTools_DataMapOfShapeListOfShape, TopTools_ListIteratorOfListOfShape
@ -211,8 +212,11 @@ class Shape(object):
#
def exportStl(self, fileName, precision = 1e-5):
mesh = BRepMesh_IncrementalMesh(self.wrapped,precision,True)
mesh.Perform()
writer = StlAPI_Writer()
writer.SetDeflection(precision)
return writer.Write(self.wrapped,fileName)

View File

@ -22,7 +22,7 @@ class TestExporters(BaseTest):
exporters.exportShape(p,eType,s,0.1)
result = s.getvalue()
#print result
for q in stringsToFind:
self.assertTrue(result.find(q) > -1 )
return result