예제 #1
0
파일: mTR13.py 프로젝트: AttilaForgacs/ring
    def calculate_intersections(self):
        super(TR13, self).calculate_intersections()

        c = self.context
        p = self.params

        c.variables = []
        c.equations = []

        solutions = solver.calc_intersection('tc', 'lc', c)

        self.sub_result = (
            sorted(solutions, key=itemgetter(2), reverse=True)[1]
        )

        x = float(self.sub_result[0])
        y = float(self.sub_result[1])
        cy = float(self.sub_result[2])

        c['p2_Y'] = y
        c['p2_X'] = p.W - x
        c['p1_X'] = x
        c['p1_Y'] = y
        c['lc_CY'] = cy
        c['rc_CY'] = cy
예제 #2
0
    def calculate_intersections(self):
        super(TR170, self).calculate_intersections()

        c = self.context
        p = self.params

        c.variables = []
        c.equations = []

        solutions = solver.calc_intersection("ltc", "tc", c)
        self.sub_result = sorted(solutions, key=itemgetter(2), reverse=True)[1]

        x = float(self.sub_result[0])
        y = float(self.sub_result[1])
        cy = float(self.sub_result[2])

        c["p1_X"] = x
        c["p1_Y"] = y

        c["p2_Y"] = y
        c["p2_X"] = p.W - x

        c["p3_X"] = p.P3
        # c['p3_Y'] = p.RI + p.R40 - p.P3
        c["p3_Y"] = c["lbc_CY"] - p.P3

        c["p4_X"] = p.W - p.R40 - p.P1
        c["p4_Y"] = p.RI

        c["p5_X"] = p.W - p.R40
        c["p5_Y"] = p.RI
예제 #3
0
    def calculate_intersections(self):
        super(TR213, self).calculate_intersections()

        c = self.context
        p = self.params
        c.variables = []
        c.equations = []

        c['x0'] = x0 = 0.
        c['y0'] = y0 = p.RI + p.H - p.P1 #P1==Hohe Sctrigbha, P2==Winkel

        x2 = x0 + math.cos(math.radians(90. - p.P2))
        y2 = y0 + math.sin(math.radians(90. - p.P2))

        solutions = solver.calc_line_vs_circle_intersections(
            'tc',
            x0, y0,
            x2, y2,
            c
        )
        self.sub_result = (
            sorted(solutions, key=itemgetter(1), reverse=True)[0]
        )

        x = float(self.sub_result[0])
        y = float(self.sub_result[1])

        c['x2'] = x
        c['y2'] = y

        solutions = solver.calc_intersection('bc', 'lbc', c)
        self.sub_result = (
            sorted(solutions, key=itemgetter(2), reverse=True)[-2]
        )

        x = float(self.sub_result[0])
        y = float(self.sub_result[1])
        cy = float(self.sub_result[2])

        c['p3_X'] = x
        c['p3_Y'] = y

        c['p4_Y'] = y
        c['p4_X'] = p.W - x

        c['lbc_CY'] = cy
        c['rbc_CY'] = cy
예제 #4
0
파일: mTR5.py 프로젝트: AttilaForgacs/ring
    def calculate_intersections(self):
        super(TR5, self).calculate_intersections()

        c = self.context
        p = self.params

        c.variables = []
        c.equations = []

        solutions = solver.calc_intersection('tc', 'ltc', c)
        self.sub_result = (
            sorted(solutions, key=itemgetter(2), reverse=True)[1]
        )

        x = float(self.sub_result[0])
        y = float(self.sub_result[1])
        cy = float(self.sub_result[2])

        c['p1_X'] = x
        c['p1_Y'] = y

        c['p2_Y'] = y
        c['p2_X'] = p.W - x

        c['ltc_CY'] = cy
        c['rtc_CY'] = cy

        c['a'] = a = p.R20 / (2 ** 0.5)

        solutions = solver.circle_subst('bc', a, c)
        self.sub_result = (
            sorted(solutions, reverse=True)[1]
        )

        y = float(self.sub_result)

        c['p3_X'] = a
        c['p3_Y'] = y

        c['p4_Y'] = y
        c['p4_X'] = p.W - a