예제 #1
0
 def _arc_caps(start: Vec3, end: Vec3, color1: int, color2: int):
     attribs = _dxfattribs(mline)
     center = start.lerp(end)
     radius = (end - start).magnitude / 2.0
     angle = (start - center).angle_deg
     attribs['center'] = center
     attribs['radius'] = radius
     attribs['color'] = color1
     attribs['start_angle'] = angle
     attribs['end_angle'] = angle + (180 if color1 == color2 else 90)
     arc1 = factory.new('ARC', dxfattribs=attribs, doc=doc)
     if color1 == color2:
         return arc1,
     attribs['start_angle'] = angle + 90
     attribs['end_angle'] = angle + 180
     attribs['color'] = color2
     arc2 = factory.new('ARC', dxfattribs=attribs, doc=doc)
     return arc1, arc2
예제 #2
0
 def _arc_caps(start: Vec3, end: Vec3, color1: int,
               color2: int) -> Sequence["Arc"]:
     attribs = _dxfattribs(mline)
     center = start.lerp(end)
     radius = (end - start).magnitude / 2.0
     angle = (start - center).angle_deg
     attribs["center"] = center
     attribs["radius"] = radius
     attribs["color"] = color1
     attribs["start_angle"] = angle
     attribs["end_angle"] = angle + (180 if color1 == color2 else 90)
     arc1 = cast("Arc", factory.new("ARC", dxfattribs=attribs, doc=doc))
     if color1 == color2:
         return (arc1, )
     attribs["start_angle"] = angle + 90
     attribs["end_angle"] = angle + 180
     attribs["color"] = color2
     arc2 = cast("Arc", factory.new("ARC", dxfattribs=attribs, doc=doc))
     return arc1, arc2