@@ -165,26 +165,27 @@ def _fast_from_codes_and_verts(cls, verts, codes, internals=None):
165
165
"""
166
166
Creates a Path instance without the expense of calling the constructor
167
167
168
- Use this method at your own risk...
169
-
170
168
Parameters
171
169
----------
172
170
verts : numpy array
173
171
codes : numpy array (may not be None)
174
172
internals : dict or None
175
173
The attributes that the resulting path should have.
174
+ Allowed keys are ``readonly``, ``should_simplify``,
175
+ ``simplify_threshold``, ``has_nonfinite`` and
176
+ ``interpolation_steps``.
176
177
177
178
"""
178
179
internals = internals or {}
179
180
pth = cls .__new__ (cls )
180
181
pth ._vertices = verts
181
182
pth ._codes = codes
182
- pth ._readonly = internals .pop ('_readonly ' , False )
183
- pth ._should_simplify = internals .pop ('_should_simplify ' , True )
184
- pth ._simplify_threshold = internals .pop ('_simplify_threshold ' ,
183
+ pth ._readonly = internals .pop ('readonly ' , False )
184
+ pth .should_simplify = internals .pop ('should_simplify ' , True )
185
+ pth .simplify_threshold = internals .pop ('simplify_threshold ' ,
185
186
rcParams ['path.simplify_threshold' ])
186
- pth ._has_nonfinite = internals .pop ('_has_nonfinite ' , False )
187
- pth ._interpolation_steps = internals .pop ('_interpolation_steps ' , 1 )
187
+ pth ._has_nonfinite = internals .pop ('has_nonfinite ' , False )
188
+ pth ._interpolation_steps = internals .pop ('interpolation_steps ' , 1 )
188
189
if internals :
189
190
raise ValueError ('Unexpected internals provided to '
190
191
'_fast_from_codes_and_verts: '
@@ -436,7 +437,11 @@ def cleaned(self, transform=None, remove_nans=False, clip=None,
436
437
remove_nans , clip ,
437
438
snap , stroke_width ,
438
439
simplify , curves , sketch )
439
- return Path ._fast_from_codes_and_verts (vertices , codes )
440
+ internals = {'should_simplify' : self .should_simplify and not simplify ,
441
+ 'has_nonfinite' : self .has_nonfinite and not remove_nans ,
442
+ 'simplify_threshold' : self .simplify_threshold ,
443
+ 'interpolation_steps' : self ._interpolation_steps }
444
+ return Path ._fast_from_codes_and_verts (vertices , codes , internals )
440
445
441
446
def transformed (self , transform ):
442
447
"""
0 commit comments