-
Beta Was this translation helpful? Give feedback.
Answered by
mozman
Apr 27, 2024
Replies: 2 comments 1 reply
-
No, complex linetypes are not supported by the From my experience as a professional CAD designer, such patterns often have a problem with non-rectangular ends and miters in general. This is particularly difficult to control in an automatically generated drawing. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
mostl33
-
Here's a script you can play around with. As you can see, solving the beginning and end of the pattern is not so easy: import ezdxf
from ezdxf.math import Vec2
def insulation_pattern(
radius: float, height: float, count: int = 10
) -> list[tuple[Vec2, float]]:
pattern: list[tuple[Vec2, float]] = []
a = height / 2 - radius
pen = Vec2(radius, -a)
step1 = Vec2(-radius, 2 * a)
step2 = Vec2(2 * radius, 0.0)
step3 = Vec2(-radius, -2 * a)
for _ in range(count):
pattern.append((pen, 0.0))
pen += step1
pattern.append((pen, -1.0))
pen += step2
pattern.append((pen, 0.0))
pen += step3
pattern.append((pen, 1.0))
pen += step2
return pattern
def main():
doc = ezdxf.new()
msp = doc.modelspace()
msp.add_lwpolyline(insulation_pattern(radius=5, height=20, count=10), format="vb") # format=(vector, bulge)
doc.saveas("insulation.dxf")
if __name__ == "__main__":
main() |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No, complex linetypes are not supported by the
drawing
add-on.From my experience as a professional CAD designer, such patterns often have a problem with non-rectangular ends and miters in general. This is particularly difficult to control in an automatically generated drawing.