;ò GÒ Fc@sdklZdkZydklZlZWn%ej od„Zd„ZnXdkZdkZdkZdk Z dk Z ye gƒWne j od„Z nXyegƒWne j od„ZnXeZdfd„ƒYZd efd „ƒYZd fd „ƒYZeƒZd ad aeed„Zdfd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZ dfd„ƒYZ!dfd „ƒYZ"d!„Z#d"fd#„ƒYZ$dS($(s nested_scopesN(sradianssdegreescCs|tidSdS(Ni´(sxsmathspi(sx((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pysradiansscCs|dtiSdS(Ni´(sxsmathspi(sx((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pysdegrees scCstd„|dƒSdS(NcCs||S(N(sxsy(sxsy((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pys*si(sreduceslist(slist((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pyssum)scCsttt|ƒƒ|ƒSdS(N(szipsxrangeslenslist(slist((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pys enumerate0ss_markercBstZRS(N(s__name__s __module__(((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pys_marker6ssNormpathExceptioncBstZRS(N(s__name__s __module__(((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pysNormpathException;ss_invalidcBsXtZdZd„ZeZZZd„ZeZZ Z Z Z Z ZZZZRS(såinvalid result marker class The following norm(sub)path(item) methods: - trafo - rotation - tangent_pt - tangent - curvature_pt - curvradius_pt return list of result values, which might contain the invalid instance defined below to signal points, where the result is undefined due to properties of the norm(sub)path(item). Accessing invalid leads to an NormpathException, but you can test the result values by "is invalid". cCstdƒ‚dS(NsHinvalid result (the requested value is undefined due to path properties)(sNormpathException(sself((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pysinvalid1OscCs|iƒdS(N(sselfsinvalid1(sselfsother((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pysinvalid2Ss(s__name__s __module__s__doc__sinvalid1s__str__s__repr__s__neg__sinvalid2s__cmp__s__add__s__iadd__s__sub__s__isub__s__mul__s__imul__s__div__s __truediv__s__idiv__(((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pys_invalid>s   f1.0000000000000001e-05cCs2|tj o |an|tj o |andS(N(sepsilonsNones_epsilons minrelspeeds _minrelspeed(sepsilons minrelspeed((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pysset`s    snormsubpathitemcBsÔtZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z d „Z d „Z d „Zd „Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(scelement of a normalized sub path Various operations on normsubpathitems might be subject of approximitions. Those methods get the finite precision epsilon, which is the accuracy needed expressed as a length in pts. normsubpathitems should never be modified inplace, since references might be shared between several normsubpaths. cCsdS(sreturn arc length in ptsN((sselfsepsilon((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pys arclen_ptyscCsdS(s?return a tuple of params and the total length arc length in ptsN((sselfs lengths_ptsepsilon((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pys_arclentoparam_pt}scCsdS(sreturn a tuple of paramsN((sselfs lengths_ptsepsilon((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pysarclentoparam_ptscCsdS(s#return coordinates at params in ptsN((sselfsparams((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pysat_pt…scCsdS(s(return coordinates of first point in ptsN((sself((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pys atbegin_pt‰scCsdS(s'return coordinates of last point in ptsN((sself((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pysatend_ptscCsdS(s&return bounding box of normsubpathitemN((sself((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pysbbox‘scCsdS(søreturn control box of normsubpathitem The control box also fully encloses the normsubpathitem but in the case of a Bezier curve it is not the minimal box doing so. On the other hand, it is much faster to calculate. N((sself((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pyscbox•scCsdS(s‘return the curvature at params in 1/pts The result contains the invalid instance at positions, where the curvature is undefined.N((sselfsparams((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pys curvature_ptžscCsdS(s"return the curvature radius at params in pts The curvature radius is the inverse of the curvature. Where the curvature is undefined, the invalid instance is returned. Note that this radius can be negative or positive, depending on the sign of the curvature.N((sselfsparams((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pyscurveradius_pt¥scCsdS(s)intersect self with other normsubpathitemN((sselfsothersepsilon((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pys intersect®scCsdS(s8return a normsubpathitem with a modified beginning pointN((sselfsx_ptsy_pt((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pysmodifiedbegin_pt²scCsdS(s2return a normsubpathitem with a modified end pointN((sselfsx_ptsy_pt((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pysmodifiedend_pt¶scCsdS(s=return a tuple of arc lengths and the total arc length in ptsN((sselfsparamsepsilon((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pys_paramtoarclen_ptºscCsdS(s0return pathitem corresponding to normsubpathitemN((sself((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pyspathitem¾scCsdS(sreturn reversed normsubpathitemN((sself((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pysreversedÁscCsdS(sCreturn rotation trafos (i.e. trafos without translations) at paramsN((sselfsparams((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pysrotationÅscCsdS(s¸return segments of the normsubpathitem The returned list of normsubpathitems for the segments between the params. params needs to contain at least two values. N((sselfsparams((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pyssegmentsÉscCsdS(s return transformations at paramsN((sselfsparams((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pystrafoÑscCsdS(s5return transformed normsubpathitem according to trafoN((sselfstrafo((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pys transformedÔscCsdS(s6write PS code corresponding to normsubpathitem to fileN((sselfsfileswriter((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pysoutputPSØscCsdS(s7write PDF code corresponding to normsubpathitem to fileN((sselfsfileswriter((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pys outputPDFÜs(s__name__s __module__s__doc__s arclen_pts_arclentoparam_ptsarclentoparam_ptsat_pts atbegin_ptsatend_ptsbboxscboxs curvature_ptscurveradius_pts intersectsmodifiedbegin_ptsmodifiedend_pts_paramtoarclen_ptspathitemsreversedsrotationssegmentsstrafos transformedsoutputPSs outputPDF(((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pysnormsubpathitemms.                    s normline_ptcBsõtZdZddddfZd„Zd„Zd„Zd„Zd „Zd „Z d „Z d „Z d „Z e Z d„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(sHStraight line from (x0_pt, y0_pt) to (x1_pt, y1_pt) (coordinates in pts)sx0_ptsy0_ptsx1_ptsy1_ptcCs(||_||_||_||_dS(N(sx0_ptsselfsy0_ptsx1_ptsy1_pt(sselfsx0_ptsy0_ptsx1_ptsy1_pt((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pys__init__çs   cCs$d|i|i|i|ifSdS(Nsnormline_pt(%g, %g, %g, %g)(sselfsx0_ptsy0_ptsx1_ptsy1_pt(sself((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pys__str__íscCsYti|i|i|i|iƒ}gi}|D]}|||ƒq4~|fSdS(N( smathshypotsselfsx0_ptsx1_ptsy0_ptsy1_ptsl_ptsappends_[1]s lengths_pts length_pt(sselfs lengths_ptsepsilons_[1]sl_pts length_pt((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pys_arclentoparam_ptðs&cCs|i||ƒdSdS(sreturn a tuple of paramsiN(sselfs_arclentoparam_pts lengths_ptsepsilon(sselfs lengths_ptsepsilon((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pysarclentoparam_ptõscCs(ti|i|i|i|iƒSdS(N(smathshypotsselfsx0_ptsx1_ptsy0_ptsy1_pt(sselfsepsilon((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pys arclen_ptùscCsYgi}|D]@}||i|i|i||i|i|i|fƒq~SdS(N( sappends_[1]sparamsstsselfsx0_ptsx1_ptsy0_ptsy1_pt(sselfsparamss_[1]st((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pysat_ptüscCs|i|ifSdS(N(sselfsx0_ptsy0_pt(sself((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pys atbegin_ptscCs|i|ifSdS(N(sselfsx1_ptsy1_pt(sself((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pysatend_ptscCsVtit|i|iƒt|i|iƒt|i|iƒt|i|iƒƒSdS(N( s bboxmodulesbbox_ptsminsselfsx0_ptsx1_ptsy0_ptsy1_ptsmax(sself((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pysbboxs*cCsdgt|ƒSdS(Ni(slensparams(sselfsparams((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pys curvature_pt scCstgt|ƒSdS(N(sinvalidslensparams(sselfsparams((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pyscurveradius_ptscCsgt|tƒo|i|i}|i|i}|i|i} |i|i}yd| |||}Wnt j o gSnX|i|i} |i|i} | | || |}|| || |} d|jo djnod| jo djn ogSn|| fgSn>gi} |i||ƒD]\}}| ||fƒq@~ SdS(Nf1.0ii(s isinstancesothers normline_ptsselfsx1_ptsx0_pts a_deltax_ptsy1_ptsy0_pts a_deltay_pts b_deltax_pts b_deltay_ptsdetsArithmeticErrors ba_deltax0_pts ba_deltay0_ptsa_tsb_tsappends_[1]s intersectsepsilonso_tss_t(sselfsothersepsilons a_deltay_ptsa_tss_ts a_deltax_ptso_tsdets ba_deltay0_pts_[1]s ba_deltax0_ptsb_ts b_deltax_pts b_deltay_pt((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pys intersects" =cCst|||i|iƒSdS(N(s normline_ptsx_ptsy_ptsselfsx1_ptsy1_pt(sselfsx_ptsy_pt((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pysmodifiedbegin_pt.scCst|i|i||ƒSdS(N(s normline_ptsselfsx0_ptsy0_ptsx_ptsy_pt(sselfsx_ptsy_pt((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pysmodifiedend_pt1scCsW|i|ƒ}gi}|dgD]}|||ƒq$~}|d |dfSdS(Niiÿÿÿÿ( sselfs arclen_ptsepsilonstotalarclen_ptsappends_[1]sparamssparams arclens_pt(sselfsparamssepsilonstotalarclen_pts arclens_ptsparams_[1]((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pys_paramtoarclen_pt4s2cCsti|i|iƒSdS(N(spaths lineto_ptsselfsx1_ptsy1_pt(sself((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pyspathitem9scCs#t|i|i|i|iƒSdS(N(s normline_ptsselfsx1_ptsy1_ptsx0_ptsy0_pt(sself((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pysreversed<scCsDtitti|i|i|i|i ƒƒƒgt |ƒSdS(N( strafosrotatesdegreessmathsatan2sselfsy1_ptsy0_ptsx1_ptsx0_ptslensparams(sselfsparams((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pysrotation?scCs»t|ƒdjotdƒ‚ng}t}}x}|D]u}|i |i |i |}|i |i |i |}|tj o |it||||ƒƒn|}|}q:W|SdS(Nis*at least two parameters needed in segments(slensparamss ValueErrorsresultsNonesxl_ptsyl_ptstsselfsx0_ptsx1_ptsxr_ptsy0_ptsy1_ptsyr_ptsappends normline_pt(sselfsparamssyr_ptsxl_ptsresultsxr_ptsyl_ptst((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pyssegmentsBs    cCsƒtitti|i|i|i|i ƒƒƒ}gi }t ||i|ƒƒD]#\}}|ti|Œ|ƒqU~SdS(N(strafosrotatesdegreessmathsatan2sselfsy1_ptsy0_ptsx1_ptsx0_ptsappends_[1]szipsparamssat_ptsparams translate_pt(sselfsparamssrotatesat_ptsparams_[1]((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pystrafoPs5cCs6t|i|i|iƒ|i|i|iƒŒSdS(N(s normline_ptstrafosapply_ptsselfsx0_ptsy0_ptsx1_ptsy1_pt(sselfstrafo((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pys transformedUscCs!|id|i|ifƒdS(Ns %g %g lineto (sfileswritesselfsx1_ptsy1_pt(sselfsfileswriter((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pysoutputPSXscCs!|id|i|ifƒdS(Ns%f %f l (sfileswritesselfsx1_ptsy1_pt(sselfsfileswriter((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pys outputPDF[s(s__name__s __module__s__doc__s __slots__s__init__s__str__s_arclentoparam_ptsarclentoparam_pts arclen_ptsat_pts atbegin_ptsatend_ptsbboxscboxs curvature_ptscurveradius_pts intersectsmodifiedbegin_ptsmodifiedend_pts_paramtoarclen_ptspathitemsreversedsrotationssegmentsstrafos transformedsoutputPSs outputPDF(((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pys normline_ptás4                       s normcurve_ptcBsUtZdZddddddddfZd „Zd „Zd „Zd „Zd „Zd„Z d„Z d„Z d„Z d„Z d„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd „Zd!„Zd"„Zd#„Zd$„Zd%„Z d&„Z!d'„Z"d(„Z#d)„Z$RS(*slBezier curve with control points x0_pt, y0_pt, x1_pt, y1_pt, x2_pt, y2_pt, x3_pt, y3_pt (coordinates in pts)sx0_ptsy0_ptsx1_ptsy1_ptsx2_ptsy2_ptsx3_ptsy3_ptc CsL||_||_||_||_||_||_||_||_dS(N( sx0_ptsselfsy0_ptsx1_ptsy1_ptsx2_ptsy2_ptsx3_ptsy3_pt( sselfsx0_ptsy0_ptsx1_ptsy1_ptsx2_ptsy2_ptsx3_ptsy3_pt((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pys__init__es       c Cs<d|i|i|i|i|i|i|i|ifSdS(Ns,normcurve_pt(%g, %g, %g, %g, %g, %g, %g, %g)( sselfsx0_ptsy0_ptsx1_ptsy1_ptsx2_ptsy2_ptsx3_ptsy3_pt(sself((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pys__str__osc Cs’d|i|i}d|i|i}d|i|i}d|i|i }d|i|i }d|i |i } d||}d||} d||}d|| } d||}d| | }ti||i||iƒ}ti||i||iƒ} ti||| |ƒ}ti|||| ƒ}| ||||jo(t|i|i||| ||ƒ} n(t|i|i|||| ||ƒ} ti|i ||i |ƒ}ti||| |ƒ} ti||| | ƒ}ti|i ||i | ƒ}| ||||jo(t|||i |i | ||ƒ}n(t!|||| || |i |i ƒ}| |fSdS(s³split curve into two parts Helper method to reduce the complexity of a problem by turning a normcurve_pt into several normline_pt segments. This method returns normcurve_pt instances only, when they are not yet straight enough to be replaceable by normcurve_pt instances. Thus a recursive midpointsplitting will turn a curve into line segments with the given precision epsilon. f0.5N("sselfsx0_ptsx1_ptsx01_ptsy0_ptsy1_ptsy01_ptsx2_ptsx12_ptsy2_ptsy12_ptsx3_ptsx23_ptsy3_ptsy23_pts x01_12_pts y01_12_pts x12_23_pts y12_23_pts xmidpoint_pts ymidpoint_ptsmathshypotsl0_ptsl1_ptsl2_ptsl3_ptsepsilons_leftnormline_ptsas_leftnormcurve_pts_rightnormline_ptsbs_rightnormcurve_pt(sselfsepsilons ymidpoint_ptsy01_ptsl0_ptsy12_ptsl2_ptsl3_ptsx01_pts y12_23_pts y01_12_ptsy23_ptsasl1_ptsbsx23_pts x01_12_ptsx12_pts x12_23_pts xmidpoint_pt((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pys_midpointsplitssD   (   ( cCså|i|ƒ\}}|i||ƒ\}} |igi }|D]}||| ƒqA~|ƒ\}} g} x`t|||ƒD]L\} } }|| jo| i |i| ƒƒqƒ| i |i| ƒƒqƒW| | | fSdS(N(sselfs_midpointsplitsepsilonsasbs_arclentoparam_pts lengths_ptsparams_as arclen_a_ptsappends_[1]s length_ptsparams_bs arclen_b_ptsparamsszipsparam_asparam_bssubparamtoparam(sselfs lengths_ptsepsilonsasbs length_pts_[1]sparams_bsparams_asparamss arclen_b_pts arclen_a_ptsparam_asparam_b((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pys_arclentoparam_pt´s= cCs|i||ƒdSdS(sreturn a tuple of paramsiN(sselfs_arclentoparam_pts lengths_ptsepsilon(sselfs lengths_ptsepsilon((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pysarclentoparam_ptÀscCs3|i|ƒ\}}|i|ƒ|i|ƒSdS(N(sselfs_midpointsplitsepsilonsasbs arclen_pt(sselfsepsilonsasb((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pys arclen_ptÄscCsgi}|D]}||i d|id|i|i|||d|id|id|i||d|id|i||i|i d|i d|i |i |||d|i d|i d|i ||d|i d|i ||i fƒq~SdS(Niiiýÿÿÿ( sappends_[1]sparamsstsselfsx0_ptsx1_ptsx2_ptsx3_ptsy0_ptsy1_ptsy2_ptsy3_pt(sselfsparamss_[1]st((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pysat_ptÈscCs|i|ifSdS(N(sselfsx0_ptsy0_pt(sself((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pys atbegin_ptÓscCs|i|ifSdS(N(sselfsx3_ptsy3_pt(sself((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pysatend_ptÖscCsnti|i|i|i|iƒ\}}ti|i |i |i |i ƒ\}}ti||||ƒSdS(N(spaths_bezierpolyrangesselfsx0_ptsx1_ptsx2_ptsx3_ptsxmin_ptsxmax_ptsy0_ptsy1_ptsy2_ptsy3_ptsymin_ptsymax_pts bboxmodulesbbox_pt(sselfsxmin_ptsymin_ptsxmax_ptsymax_pt((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pysbboxÙs**c Cs†tit|i|i|i|iƒt|i|i |i |i ƒt |i|i|i|iƒt |i|i |i |i ƒƒSdS(N( s bboxmodulesbbox_ptsminsselfsx0_ptsx1_ptsx2_ptsx3_ptsy0_ptsy1_ptsy2_ptsy3_ptsmax(sself((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pyscboxÞs$c Cs0g}ti|i|i|i|iƒti|i|i|i |iƒti|i |i|i |i ƒ}x±|D]©}dd|d||i |idd|||i |id|||i |i }dd|d||i |idd|||i |i d|||i |i }dd||id|i|id||id|i|i } dd||id|i|i d||id|i |i }ti||ƒ}||tjo%|i|||| |dƒq{|itƒq{W|SdS(Niiii(sresultsmathshypotsselfsx1_ptsx0_ptsy1_ptsy0_ptsx2_ptsy2_ptsx3_ptsy3_pts approxarclensparamssparamsxdotsydotsxddotsyddots _minrelspeedsappendsinvalid( sselfsparamss approxarclensyddotsparamsxdotshypotsresultsydotsxddot((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pys curvature_ptäsn__HH%c Cs0g}ti|i|i|i|iƒti|i|i|i |iƒti|i |i|i |i ƒ}x±|D]©}dd|d||i |idd|||i |id|||i |i }dd|d||i |idd|||i |i d|||i |i }dd||id|i|id||id|i|i } dd||id|i|i d||id|i |i }ti||ƒ}||tjo%|i|d|||| ƒq{|itƒq{W|SdS(Niiii(sresultsmathshypotsselfsx1_ptsx0_ptsy1_ptsy0_ptsx2_ptsy2_ptsx3_ptsy3_pts approxarclensparamssparamsxdotsydotsxddotsyddots _minrelspeedsappendsinvalid( sselfsparamss approxarclensyddotsparamsxdotshypotsresultsydotsxddot((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pyscurveradius_ptýsn__HH%c CsÊ|iƒi|iƒƒ ogSn|i|ƒ\}}gi}|i ||ƒD]%\}}||i |ƒ|fƒqT~gi}|i ||ƒD]%\}}||i |ƒ|fƒq™~SdS(N(sselfscboxs intersectssothers_midpointsplitsepsilonsasbsappends_[1]s intersectso_tsa_tssubparamtoparamsb_t( sselfsothersepsilonsaso_tsbs_[1]sa_tsb_t((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pys intersectsc Cs5t|||i|i|i|i|i|i ƒSdS(N( s normcurve_ptsx_ptsy_ptsselfsx1_ptsy1_ptsx2_ptsy2_ptsx3_ptsy3_pt(sselfsx_ptsy_pt((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pysmodifiedbegin_pt#s   c Cs5t|i|i|i|i|i|i||ƒSdS(N( s normcurve_ptsselfsx0_ptsy0_ptsx1_ptsy1_ptsx2_ptsy2_ptsx_ptsy_pt(sselfsx_ptsy_pt((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pysmodifiedend_pt)s  cCs›gi}|idgt|ƒdgƒD]}||i|ƒƒq+~}x5t dt |ƒƒD]}||c||d7Ýsf0.5( sparams mathutilss realpolyrootssselfsl1_ptsl2_ptsl3_ptsparamsssort(sselfsparamsparams((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pyssubparamtoparamÓs (s__name__s __module__s __slots__s__init__ssubparamtoparam(((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pys_leftnormline_ptÉs s_rightnormline_ptcBs,tZdddddddfZd„ZRS( Nsx0_ptsy0_ptsx1_ptsy1_ptsl1_ptsl2_ptsl3_ptcCsdti||ƒSdS(Nf0.5(s_leftnormline_ptssubparamtoparamsselfsparam(sselfsparam((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pyssubparamtoparamês(s__name__s __module__s __slots__ssubparamtoparam(((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pys_rightnormline_ptæss_leftnormcurve_ptcBs/tZddddddddfZd „ZRS( Nsx0_ptsy0_ptsx1_ptsy1_ptsx2_ptsy2_ptsx3_ptsy3_ptcCs d|SdS(Nf0.5(sparam(sselfsparam((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pyssubparamtoparamòs(s__name__s __module__s __slots__ssubparamtoparam(((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pys_leftnormcurve_ptîss_rightnormcurve_ptcBs/tZddddddddfZd „ZRS( Nsx0_ptsy0_ptsx1_ptsy1_ptsx2_ptsy2_ptsx3_ptsy3_ptcCsdd|SdS(Nf0.5(sparam(sselfsparam((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pyssubparamtoparamús(s__name__s __module__s __slots__ssubparamtoparam(((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pys_rightnormcurve_ptöss normsubpathcBs@tZdZddddfZgded„Zd„Zd„Zd „Zd „Z d „Z d „Z d „Z d„Z d„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd „Zd!„Z d"„Z!d#„Z"d$„Z#RS(%sƒsub path of a normalized path A subpath consists of a list of normsubpathitems, i.e., normlines_pt and normcurves_pt and can either be closed or not. Some invariants, which have to be obeyed: - All normsubpathitems have to be longer than epsilon pts. - At the end there may be a normline (stored in self.skippedline) whose length is shorter than epsilon -- it has to be taken into account when adding further normsubpathitems - The last point of a normsubpathitem and the first point of the next element have to be equal. - When the path is closed, the last point of last normsubpathitem has to be equal to the first point of the first normsubpathitem. - epsilon might be none, disallowing any numerics, but allowing for arbitrary short paths. This is used in pdf output, where all paths need to be transformed to normpaths. snormsubpathitemssclosedsepsilons skippedlineicCsŒ|tjo t}n||_t|_g|_d|_x(|D] }t |t ƒp t d‚qBW|i |ƒ|o|i ƒndS(sconstruct a normsubpathis.only list of normsubpathitem instances allowedN(sepsilons_markers_epsilonsselfsNones skippedlinesnormsubpathitemssclosedsanormsubpathitems isinstancesnormsubpathitemsAssertionErrorsextendsclose(sselfsnormsubpathitemssclosedsepsilonsanormsubpathitem((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pys__init__s       cCs|i|SdS(sreturn normsubpathitem iN(sselfsnormsubpathitemssi(sselfsi((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pys __getitem__0scCst|iƒSdS(s!return number of normsubpathitemsN(slensselfsnormsubpathitems(sself((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pys__len__4scCs=ditt|iƒƒ}|io d|Sn d|SdS(Ns, snormsubpath([%s], closed=1)snormsubpath([%s])(sjoinsmapsstrsselfsnormsubpathitemsslsclosed(sselfsl((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pys__str__8s  cCsÃh}x²t|ƒD]¤\}}|djoAt|ƒ}|t|i ƒdjot|i ƒd}qsnd}|i |ggfƒ||di |ƒ||di ||ƒqW|SdS(szreturn a dictionary mapping normsubpathitemindices to a tuple of a paramindices and normsubpathitemparams. normsubpathitemindex specifies a normsubpathitem containing one or several positions. paramindex specify the index of the param in the original list and normsubpathitemparam is the parameter value in the normsubpathitem. iiN( sresults enumeratesparamssisparamsintsindexslensselfsnormsubpathitemss setdefaultsappend(sselfsparamssindexsisparamsresult((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pys_distributeparams?s   c Cs$|itjo|ii|ƒnýt|tƒp td‚|i ojt i gi}t |i iƒ|iƒƒD]\}}|||ƒqt~Œ|ijp td‚ny|iont i gi}t |idiƒ|iƒƒD]\}}|||ƒqì~Œ|ijp td‚n|iotdƒ‚n|i o|i iƒ\}}n|iƒ\}}|iƒ\}}t i ||||ƒ|ijp|i|iƒ|ijo=|i o|i||ƒ}n|ii|ƒt|_ nt||||ƒ|_ dS(sEappend normsubpathitem Fails on closed normsubpath. s&only normsubpathitem instances allowedsnormsubpathitems do not matchiÿÿÿÿs#Cannot append to closed normsubpathN(sselfsepsilonsNonesnormsubpathitemssappendsanormsubpathitems isinstancesnormsubpathitemsAssertionErrors skippedlinesmathshypots_[1]szipsatend_pts atbegin_ptsxsysclosedsNormpathExceptionsxs_ptsys_ptsxe_ptsye_pts arclen_ptsmodifiedbegin_pts normline_pt( sselfsanormsubpathitemsys_pts_[1]sxe_ptsysxsye_ptsxs_pt((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pysappendVs( j n  @  cCs>tgi}|iD]}||i|iƒƒq~ƒSdS(sreturn arc length in ptsN(ssumsappends_[1]sselfsnormsubpathitemssnpitems arclen_ptsepsilon(sselfs_[1]snpitem((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pys arclen_ptwsc Csö|}tgt|ƒ}d}xÅt|iƒD]´\}}|i ||i ƒ\}}x€tt|ƒƒD]l}||tjoU||c|8<||djp|t|iƒdjo|||||g}x$|iD]}|i|iƒƒqWti|ŒSdS(s%return path corresponding to normpathN(s pathitemssselfs normsubpathss normsubpathsextendspath(sselfs normsubpaths pathitems((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pyspathòs  cCsStƒ}x?tt|iƒƒD](}|ii|i|d iƒƒqW|SdS(sreturn reversed pathiN( snormpaths nnormpathsrangeslensselfs normsubpathssisappendsreversed(sselfsis nnormpath((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pysreversedùs  &cCstgt|ƒ}xc|i|ƒiƒD]L\}\}}x7t ||i |i |ƒƒD]\}}|||s  cCsIyx|D]}Pq WWn|g}nX|i|i||iƒƒSdS(sDsplit path at param(s) or arc length(s) and return list of normpathsN(sparamssparamsselfs _split_pts_convertparamss arclentoparam(sselfsparamssparam((s@/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/normpath.pyssplitGs  c CsÃtgt|ƒ}tidd|dƒiƒ}x‡|i |ƒi ƒD]p\}\}}x[t||i|i|ƒƒD]:\}}|tjot||