@@ -32,7 +32,7 @@ class IgesHandler(fh.FileHandler):
3232 :cvar list control_point_position: index of the first NURBS control point (or pole)
3333 of each face of the iges file.
3434 :cvar float tolerance: tolerance for the construction of the faces and wires
35- in the write function.
35+ in the write function. Default value is 1e-6.
3636
3737 .. warning::
3838
@@ -129,9 +129,7 @@ def write(self, mesh_points, filename, tolerance=None):
129129
130130 self .outfile = filename
131131
132- if tolerance is None :
133- tolerance = self .tolerance
134- else :
132+ if tolerance is not None :
135133 self .tolerance = tolerance
136134
137135 # init the ouput file writer
@@ -180,7 +178,7 @@ def write(self, mesh_points, filename, tolerance=None):
180178 # construct the deformed wire for the trimmed surfaces
181179 wire_maker = BRepBuilderAPI_MakeWire ()
182180 tol = ShapeFix_ShapeTolerance ()
183- brep = BRepBuilderAPI_MakeFace (occ_face .GetHandle (), tolerance ).Face ()
181+ brep = BRepBuilderAPI_MakeFace (occ_face .GetHandle (), self . tolerance ).Face ()
184182 brep_face = BRep_Tool .Surface (brep )
185183
186184 # cycle on the edges
@@ -192,7 +190,7 @@ def write(self, mesh_points, filename, tolerance=None):
192190 # evaluating the new edge: same (u,v) coordinates, but different (x,y,x) ones
193191 edge_phis_coordinates_aux = BRepBuilderAPI_MakeEdge (edge_uv_coordinates [0 ], brep_face )
194192 edge_phis_coordinates = edge_phis_coordinates_aux .Edge ()
195- tol .SetTolerance (edge_phis_coordinates , tolerance )
193+ tol .SetTolerance (edge_phis_coordinates , self . tolerance )
196194 wire_maker .Add (edge_phis_coordinates )
197195 edge_explorer .Next ()
198196
0 commit comments