def __init__(self,**kwargs):
        """Constructor
        """
        self.__class__.__bases__[0].__init__(self,**kwargs)

        p1 = self._parent._dicoConstruction['BustLine_middleBackPoint']
        delta = (self._parent._dicoMesures['Poitrine'+self._stature] + 80) / 4.0
        if (self._parent._dicoMesures['Poitrine'+self._stature] > 1250):
            delta = delta - 30
        elif (self._parent._dicoMesures['Poitrine'+self._stature] > 110): 
            delta = delta - 25
        elif (self._parent._dicoMesures['Poitrine'+self._stature] > 95): 
            delta = delta - 20
        else:
            delta = delta - 15
        self._mark = byA_Point(x=p1._x+delta, y=p1._y) 
        p2 = self._parent._dicoConstruction['HipLine_middleBackPoint'] 
        self._markDownToHipLine = byA_Point(x=p1._x+delta, y=p2._y)
        self._verticalToHipLine = byA_Line(P1=self._mark, P2=self._markDownToHipLine)

        self._constructionPoint.append(('_mark',self._mark, 'BB'))
        self._constructionPoint.append(('_markDownToHipLine',self._markDownToHipLine, 'Bbh'))
        self._constructionLine.append(('_verticalToHipLine',self._verticalToHipLine, ''))

        self.fillDicoPoints(self.__class__.__name__.replace("byA_",""), self._parent)
        self._freeze(self.__class__.__name__)
Exemple #2
0
    def __init__(self, **kwargs):
        """Constructor
        """
        self.__class__.__bases__[0].__init__(self, **kwargs)

        bMark = self._parent._dicoConstruction['BackBustLineMark_mark']
        waistMark = self._parent._dicoConstruction['BackDartWaistLine_dart1']
        hipMark = self._parent._dicoConstruction['BackHipLineMark_mark']

        self._bustToWaist = byA_Line(P1=bMark, P2=waistMark)
        self._waistToHip = byA_Line(P1=waistMark, P2=hipMark)
        waistToHipLenght = self._waistToHip.lenght()
        waistToHipX = abs(self._waistToHip._to._x - self._waistToHip._from._x)
        waistToHipY = abs(self._waistToHip._to._y - self._waistToHip._from._y)

        # 8 cm as specifed in the book give strange curves for high stature so try to
        # modulate it
        val8cm = 80 * waistToHipX / 48.75
        # 48.75 is the waistToHipX for size 38

        self._8cm = byA_Point(
            x=waistMark._x + (waistToHipX * val8cm / waistToHipLenght),
            y=waistMark._y + (waistToHipY * val8cm / waistToHipLenght))
        self._1cm = byA_Point(x=self._8cm._x + 10, y=self._8cm._y)

        self._constructionPoint.append(('_8cm', self._8cm, 'd8'))
        self._constructionPoint.append(('_1cm', self._1cm, 'v1'))
        self._finalLine.append(('_bustToWaist', self._bustToWaist, ''))
        self._constructionLine.append(('_waistToHip', self._waistToHip, ''))

        self.fillDicoPoints(self.__class__.__name__.replace("byA_", ""),
                            self._parent)
        self._freeze(self.__class__.__name__)
Exemple #3
0
    def __init__(self, **kwargs):
        """Constructor
        """
        self.__class__.__bases__[0].__init__(self, **kwargs)

        taille = (self._parent._dicoMesures['Ceinture' + self._stature] +
                  30) / 2.0
        # a comparer avec ce qui a deja ete calcule dans byA_FrontDartBustLine + byA_BackDartBustLine
        bustP1 = self._parent._dicoConstruction['BustLine_middleFrontPoint']
        bustP2 = self._parent._dicoConstruction['FrontBustLineMark_mark']
        bustCompare = byA_Line(P1=bustP1, P2=bustP2).lenght()
        bustP3 = self._parent._dicoConstruction['BustLine_middleBackPoint']
        bustP4 = self._parent._dicoConstruction['BackBustLineMark_mark']
        bustCompare += byA_Line(P1=bustP3, P2=bustP4).lenght()
        ppMark = self._parent._dicoConstruction['BackDartBustLine_mark']
        bMark = self._parent._dicoConstruction['BackBustLineMark_mark']
        waistMark = self._parent._dicoConstruction['WaistLine_middleBackPoint']
        self._dart1 = byA_Point(x=bMark._x +
                                ((taille - bustCompare) / 4.0 - 5),
                                y=waistMark._y)
        self._dart2 = byA_Point(x=ppMark._x - 0.5 *
                                ((taille - bustCompare) / 4.0 + 5),
                                y=waistMark._y)
        self._dart3 = byA_Point(x=ppMark._x + 0.5 *
                                ((taille - bustCompare) / 4.0 + 5),
                                y=waistMark._y)

        self._constructionPoint.append(('_dart1', self._dart1, 'd1'))
        self._constructionPoint.append(('_dart2', self._dart2, 'd2'))
        self._constructionPoint.append(('_dart3', self._dart3, 'd3'))

        self.fillDicoPoints(self.__class__.__name__.replace("byA_", ""),
                            self._parent)
        self._freeze(self.__class__.__name__)
Exemple #4
0
     def __init__(self,**kwargs):
        """Constructor
        """
        self.__class__.__bases__[0].__init__(self,**kwargs)

        p1 = self._parent._dicoConstruction['WaistLine_middleFrontPoint']
        self._middlePoint = byA_Point(x=p1._x, y=p1._y-self._parent._dicoMesures['Longueurcorsagedevant'+self._stature]) 
        p2 = byA_Point(x=self._middlePoint._x-200, y=self._middlePoint._y)
        self._horizontalLine = byA_Line(P1=self._middlePoint, P2=p2)
        self._constructionPoint.append(('_middlePoint',self._middlePoint, 'G'))
        self._constructionLine.append(('_horizontalLine',self._horizontalLine, 'coucou'))

        self.fillDicoPoints(self.__class__.__name__.replace("byA_",""), self._parent)
        self._freeze(self.__class__.__name__)
    def __init__(self, **kwargs):
        """Constructor
        """
        self.__class__.__bases__[0].__init__(self, **kwargs)

        p1 = self._parent._dicoConstruction['BackDartBustLine_mark']
        p2 = self._parent._dicoConstruction['BackDartWaistLine_dart2']
        p3 = self._parent._dicoConstruction['BackDartWaistLine_dart3']
        p4 = self._parent._dicoConstruction[
            'BackDartBustLine_markDownToHipLine']
        p4bis = byA_Point(c=p4 + complex(0, -25))

        self._upMiddleLine = byA_Line(P1=p1, P2=p2)
        self._upSideLine = byA_Line(P1=p1, P2=p3)
        self._downMiddleLine = byA_Line(P1=p4bis, P2=p2)
        self._downSideLine = byA_Line(P1=p4bis, P2=p3)

        self._finalLine.append(('_upMiddleLine', self._upMiddleLine, ''))
        self._finalLine.append(('_upSideLine', self._upSideLine, ''))
        self._finalLine.append(('_downMiddleLine', self._downMiddleLine, ''))
        self._finalLine.append(('_downSideLine', self._downSideLine, ''))

        self.fillDicoPoints(self.__class__.__name__.replace("byA_", ""),
                            self._parent)
        self._freeze(self.__class__.__name__)
    def __init__(self, **kwargs):
        """Constructor
        """
        self.__class__.__bases__[0].__init__(self, **kwargs)

        self._hipsPoint = byA_Point(x=HORIZONTAL_MARGIN_MM,
                                    y=VERTICAL_MARGIN_MM)
        self._topPoint = byA_Point(x=HORIZONTAL_MARGIN_MM,
                                   y=self._sheetSize[1] - VERTICAL_MARGIN_MM)
        self._verticalLine = byA_Line(P1=self._hipsPoint, P2=self._topPoint)

        self._constructionPoint.append(('_hipsPoint', self._hipsPoint, 'O'))
        self._constructionPoint.append(('_topPoint', self._topPoint, ''))
        self._finalLine.append(
            ('_verticalLine', self._verticalLine, 'Milieu dos'))

        self.fillDicoPoints(self.__class__.__name__.replace("byA_", ""),
                            self._parent)
        self._freeze(self.__class__.__name__)
    def __init__(self, **kwargs):
        """Constructor
        """
        self.__class__.__bases__[0].__init__(self, **kwargs)

        waistMark = self._parent._dicoConstruction['BackDartWaistLine_dart1']
        hipMark = self._parent._dicoConstruction['BackHipLineMark_mark']

        waistToHip = byA_Line(P1=waistMark, P2=hipMark)
        pFromBefore = self._parent._dicoConstruction['BackDartWaistLine_dart1']
        pThroughBefore = self._parent._dicoConstruction['BackSideLine_1cm']
        pTo = self._parent._dicoConstruction['BackHipLineMark_mark']
        assert isinstance(pFromBefore, byA_Point)
        assert isinstance(pTo, byA_Point)
        assert isinstance(pThroughBefore, byA_Point)
        pFromRot = byA_Point(c=pFromBefore)
        pFromRot.rotate(90, complex(pTo._x, pTo._y))
        pThroughRot = byA_Point(c=pThroughBefore)
        pThroughRot.rotate(90, complex(pTo._x, pTo._y))
        pToCoeffA, pToCoeffB = byA_Line(P1=pTo, P2=pThroughRot).equationLine()
        print "y1 = ", pToCoeffA, "*x + ", pToCoeffB, "P1", pTo.toRI(
        ), "P2", pThroughRot.toRI()
        t = 1.0 - (80.0 / waistToHip.lenght())
        p1Py = pTo._y
        p2Py = (pThroughRot._y - pTo._y * (1 - t)**3 - 3 * p1Py * t *
                (1 - t)**2 - pFromRot._y * t**3) / (3 * t**2 * (1 - t))
        p2Px = (p2Py - pToCoeffB) / pToCoeffA
        p1Px = (pThroughRot._x - pTo._x * (1 - t)**3 - 3 * p2Px * t**2 *
                (1 - t) - pFromRot._x * t**3) / (3 * t * (1 - t)**2)
        bezierRot = byA_CubicBezier(P1=pTo,
                                    C1=byA_Point(x=p1Px, y=p1Py),
                                    C2=byA_Point(x=p2Px, y=p2Py),
                                    P2=pFromRot)
        self._waistToHipCurve = bezierRot.rotated(-90, complex(pTo._x, pTo._y))

        self._finalCurve.append(
            ('_waistToHipCurve', self._waistToHipCurve, ''))

        self.fillDicoPoints(self.__class__.__name__.replace("byA_", ""),
                            self._parent)
        self._freeze(self.__class__.__name__)
Exemple #8
0
    def __init__(self, **kwargs):
        """Constructor
        """
        byA_PatternStep.__init__(self, **kwargs)

        tableVal = self._parent._dicoMesures['Hauteurdubassin' + self._stature]
        p1 = self._parent._dicoConstruction['HipLine_middleBackPoint']
        p2 = self._parent._dicoConstruction['HipLine_middleFrontPoint']
        self._middleBackPoint = byA_Point(x=p1._x, y=p1._y - tableVal)
        self._middleFrontPoint = byA_Point(x=p2._x, y=p2._y - tableVal)
        self._horizontalLine = byA_Line(P1=self._middleBackPoint,
                                        P2=self._middleFrontPoint)

        self._constructionPoint.append(
            ('_middleBackPoint', self._middleBackPoint, 'Lw'))
        self._constructionPoint.append(
            ('_middleFrontPoint', self._middleFrontPoint, 'Rw'))
        self._constructionLine.append(
            ('_horizontalLine', self._horizontalLine, 'Ligne de taille'))

        self.fillDicoPoints(self.__class__.__name__.replace("byA_", ""),
                            self._parent)
        self._freeze(self.__class__.__name__)
Exemple #9
0
    def __init__(self, **kwargs):
        """Constructor
        """
        self.__class__.__bases__[0].__init__(self, **kwargs)

        p1 = self._parent._dicoConstruction['BustLine_middleBackPoint']
        delta = (self._parent._dicoMesures['Ecartementdessaillantsdepoitrine' +
                                           self._stature]) / 2.0 - 5
        self._mark = byA_Point(x=p1._x + delta, y=p1._y)
        p2 = self._parent._dicoConstruction['HipLine_middleBackPoint']
        self._markDownToHipLine = byA_Point(x=p1._x + delta, y=p2._y)
        self._verticalToHipLine = byA_Line(P1=self._mark,
                                           P2=self._markDownToHipLine)

        self._constructionPoint.append(('_mark', self._mark, 'PP'))
        self._constructionPoint.append(
            ('_markDownToHipLine', self._markDownToHipLine, 'PPh'))
        self._constructionLine.append(
            ('_verticalToHipLine', self._verticalToHipLine, ''))

        self.fillDicoPoints(self.__class__.__name__.replace("byA_", ""),
                            self._parent)
        self._freeze(self.__class__.__name__)
Exemple #10
0
    def __init__(self, **kwargs):
        """Constructor
        """
        byA_PatternStep.__init__(self, **kwargs)

        self._middleBackPoint = byA_Point(x=HORIZONTAL_MARGIN_MM,
                                          y=self._sheetSize[1] -
                                          VERTICAL_MARGIN_MM)
        self._middleFrontPoint = byA_Point(
            x=self._sheetSize[0] - HORIZONTAL_MARGIN_MM,
            y=self._sheetSize[1] - VERTICAL_MARGIN_MM)
        self._horizontalLine = byA_Line(P1=self._middleBackPoint,
                                        P2=self._middleFrontPoint)

        self._constructionPoint.append(
            ('_middleBackPoint', self._middleBackPoint, 'Lh'))
        self._constructionPoint.append(
            ('_middleFrontPoint', self._middleFrontPoint, 'Rh'))
        self._constructionLine.append(
            ('_horizontalLine', self._horizontalLine, 'Ligne de hanches'))

        self.fillDicoPoints(self.__class__.__name__.replace("byA_", ""),
                            self._parent)
        self._freeze(self.__class__.__name__)
    def __init__(self, **kwargs):
        """Constructor
        """
        self.__class__.__bases__[0].__init__(self, **kwargs)

        bassin = (self._parent._dicoMesures['Bassin' + self._stature] +
                  40) / 2.0
        # a comparer avec ce qui a deja ete calcule dans byA_FrontBustLineMark + byA_BackBustLineMark
        bustP1 = self._parent._dicoConstruction['BustLine_middleFrontPoint']
        bustP2 = self._parent._dicoConstruction['FrontBustLineMark_mark']
        bustCompare = byA_Line(P1=bustP1, P2=bustP2).lenght()
        bustP3 = self._parent._dicoConstruction['BustLine_middleBackPoint']
        bustP4 = self._parent._dicoConstruction['BackBustLineMark_mark']
        bustCompare += byA_Line(P1=bustP3, P2=bustP4).lenght()
        tmpMark = self._parent._dicoConstruction[
            'BackBustLineMark_markDownToHipLine']
        self._mark = byA_Point(x=tmpMark._x + (bassin - bustCompare) / 2.0,
                               y=tmpMark._y)

        self._constructionPoint.append(('_mark', self._mark, 'Mb'))

        self.fillDicoPoints(self.__class__.__name__.replace("byA_", ""),
                            self._parent)
        self._freeze(self.__class__.__name__)
    def __init__(self, **kwargs):
        """Constructor
        """
        self.__class__.__bases__[0].__init__(self, **kwargs)

        p1 = self._parent._dicoConstruction['FrontDartBustLine_mark']
        p2 = self._parent._dicoConstruction['FrontDartWaistLine_dart2']
        p3 = self._parent._dicoConstruction['FrontDartWaistLine_dart3']
        p4 = self._parent._dicoConstruction[
            'FrontDartBustLine_markDownToHipLine']

        self._upMiddleLine = byA_Line(P1=p1, P2=p2)
        p1CoeffA, p1CoeffB = self._upMiddleLine.equationLine()
        val15mm = 15  # A ajuster (+ pour les plus grandes tailles) : plus un soutien gorge est pointu, moins cette valeur est importante
        self._down15mm = byA_Point(c=(p1.toRI() +
                                      val15mm * complex(1, p1CoeffA) /
                                      (sqrt(1 + p1CoeffA**2))))

        self._upSideLine = byA_Line(P1=self._down15mm, P2=p3)
        self._downMiddleLine = byA_Line(P1=p4, P2=p3)
        self._downSideLine = byA_Line(P1=p4, P2=p2)

        downMiddleLineLenght = self._downMiddleLine.lenght()
        downMiddleLineX = abs(self._downMiddleLine._to._x -
                              self._downMiddleLine._from._x)
        downMiddleLineY = abs(self._downMiddleLine._to._y -
                              self._downMiddleLine._from._y)

        print "downMiddleLineX ", downMiddleLineX
        val8cm = 80 * downMiddleLineX / 14.375
        #  14.375 is the downMiddleLineX for size 38

        self._8cmMiddle = byA_Point(
            x=p3._x + (downMiddleLineX * val8cm / downMiddleLineLenght),
            y=p3._y + (downMiddleLineY * val8cm / downMiddleLineLenght))
        self._6mmMiddle = byA_Point(x=self._8cmMiddle._x + 6,
                                    y=self._8cmMiddle._y)

        pFromBefore = p3
        pThroughBefore = self._6mmMiddle
        pTo = p4
        assert isinstance(pFromBefore, byA_Point)
        assert isinstance(pTo, byA_Point)
        assert isinstance(pThroughBefore, byA_Point)
        pFromRot = byA_Point(c=pFromBefore)
        pFromRot.rotate(90, complex(pTo._x, pTo._y))
        pThroughRot = byA_Point(c=pThroughBefore)
        pThroughRot.rotate(90, complex(pTo._x, pTo._y))
        pToCoeffA, pToCoeffB = byA_Line(P1=pTo, P2=pThroughRot).equationLine()
        t = 1.0 - (80.0 / downMiddleLineLenght)
        for x in range(1, 10):
            t = x / 10.0
            p1Py = pTo._y
            p2Py = (pThroughRot._y - pTo._y * (1 - t)**3 - 3 * p1Py * t *
                    (1 - t)**2 - pFromRot._y * t**3) / (3 * t**2 * (1 - t))
            p2Px = (p2Py - pToCoeffB) / pToCoeffA
            p1Px = (pThroughRot._x - pTo._x * (1 - t)**3 - 3 * p2Px * t**2 *
                    (1 - t) - pFromRot._x * t**3) / (3 * t * (1 - t)**2)
            bezierRot = byA_CubicBezier(P1=pTo,
                                        C1=byA_Point(x=p1Px, y=p1Py),
                                        C2=byA_Point(x=p2Px, y=p2Py),
                                        P2=pFromRot)
            self._downSideCurve = bezierRot  #.rotated(-90, complex(pTo._x, pTo._y))
            self._constructionPoint.append(
                ('C1', byA_Point(x=p1Px, y=p1Py), 'C1' + str(x)))
            self._constructionPoint.append(
                ('C2', byA_Point(x=p2Px, y=p2Py), 'C2' + str(x)))
            self._finalCurve.append(
                ('_downSideCurve', self._downSideCurve, ''))
        self._finalCurve.append(('_downSideCurve', self._downSideCurve, ''))

        self._downMiddleCurve = byA_CubicBezier(P1=p1, C1=p1, C2=p1, P2=p1)

        self._finalLine.append(('_upMiddleLine', self._upMiddleLine, ''))
        self._constructionPoint.append(('_down15mm', self._down15mm, 'F'))
        self._finalLine.append(('_upSideLine', self._upSideLine, ''))
        self._constructionLine.append(
            ('_downMiddleLine', self._downMiddleLine, ''))
        self._constructionLine.append(
            ('_downSideLine', self._downSideLine, ''))
        self._finalCurve.append(
            ('_downMiddleCurve', self._downMiddleCurve, ''))
        self._constructionPoint.append(('_8cmMiddle', self._8cmMiddle, '8'))
        self._constructionPoint.append(('_6mmMiddle', self._6mmMiddle, '6'))
        self._constructionPoint.append(
            ('pThroughRot', pThroughRot, 'pThroughRot'))
        self._finalCurve.append(('_downSideCurve', self._downSideCurve, ''))

        self.fillDicoPoints(self.__class__.__name__.replace("byA_", ""),
                            self._parent)
        self._freeze(self.__class__.__name__)