1234567891011121314151617 |
- class NodeGapDrawer:
- def __init__(self,msp,point_list,layer_id):
- self.msp = msp
- self.point_list =point_list
- self.layer_id = layer_id
- def draw_gap(self):
- hatch = self.msp.add_hatch(dxfattribs={"layer": f"图层{self.layer_id}"})
- hatch.rgb = (0, 0, 0)
- edge_path = hatch.paths.add_edge_path()
- for i in range(len(self.point_list)):
- if i+1<len(self.point_list): edge_path.add_line(self.point_list[i], self.point_list[i + 1])
- edge_path.add_line(self.point_list[-1], self.point_list[0])
|