import math import core from drawer.BaseDrawer import VentGraphDrawer class FanLocalDrawer(VentGraphDrawer): def initialize_data(self): pass def draw_obj(self,center,route): rad = 0.5 * self.obj.width self.msp.add_circle(center=center, radius=rad, dxfattribs={"layer": f"图层{self.obj.layer_id}"}) a1 = center[0], center[1] + rad a2 = center[0], center[1] + rad * 3 / 2 a3 = center[0] + rad * 1 / 2, center[1] + rad * 3 / 2 a1 = core.rotate_point_around_another(a1, center, route) a2 = core.rotate_point_around_another(a2, center, route) a3 = core.rotate_point_around_another(a3, center, route) self.msp.add_line(a1, a2, dxfattribs={"layer": f"图层{self.obj.layer_id}"}) self.msp.add_line(a2, a3, dxfattribs={"layer": f"图层{self.obj.layer_id}"}) a4 = core.rotate_point_around_another(a1, center, -2/3*math.pi) a5 = core.rotate_point_around_another(a2, center, -2/3*math.pi) a6 = core.rotate_point_around_another(a3, center, -2/3*math.pi) self.msp.add_line(a4, a5, dxfattribs={"layer": f"图层{self.obj.layer_id}"}) self.msp.add_line(a5, a6, dxfattribs={"layer": f"图层{self.obj.layer_id}"}) a7 = core.rotate_point_around_another(a1, center, 2/3*math.pi) a8 = core.rotate_point_around_another(a2, center, 2/3*math.pi) a9 = core.rotate_point_around_another(a3, center, 2/3*math.pi) self.msp.add_line(a7, a8, dxfattribs={"layer": f"图层{self.obj.layer_id}"}) self.msp.add_line(a8, a9, dxfattribs={"layer": f"图层{self.obj.layer_id}"})