<commit_before># Purpose: examples for using Clothoid() add-on
# Created: 09.02.2010, 2018 adapted for ezdxf
# Copyright (c) 2010-2018, <NAME>
# License: MIT License
from __future__ import unicode_literals
import ezdxf
from ezdxf.addons import Clothoid


def four_c(A, length, rotation):
    render(Clothoid(start=(2, 2), length=length, paramA=A, rotation=rotation), dxfattribs={'color': 1})
    render(Clothoid(start=(2, 2), mirror='x', length=length, paramA=A, rotation=rotation), dxfattribs={'color': 2})
    render(Clothoid(start=(2, 2), mirror='y', length=length, paramA=A, rotation=rotation), dxfattribs={'color': 3})
    render(Clothoid(start=(2, 2), mirror='xy', length=length, paramA=A, rotation=rotation), dxfattribs={'color': 4})


def render(clothoid, dxfattribs):
    clothoid.render(msp, segments=100, dxfattribs=dxfattribs)
    clothoid.render_spline(msp, segments=10, dxfattribs={'color': 6, 'linetype': "DASHED"})


NAME = 'clothoid.dxf'
dwg = ezdxf.new('R2000')
msp = dwg.modelspace()

msp.add_line((-20, 0), (20, 0), dxfattribs={'linetype': "PHANTOM"})
msp.add_line((0, -20), (0, 20), dxfattribs={'linetype': "PHANTOM"})
for rotation in [0, 30, 45, 60, 75, 90]:
    four_c(10., 25, rotation)
auditor = dwg.auditor()
result = auditor.run()

if dwg.validate(print_report=True):
    dwg.saveas(NAME)
    print("drawing '%s' created.\n" % NAME)
<commit_msg>minor edit<commit_after># Purpose: examples for using Clothoid() add-on
# Created: 09.02.2010, 2018 adapted for ezdxf
# Copyright (c) 2010-2018, <NAME>
# License: MIT License
from __future__ import unicode_literals
import ezdxf
from ezdxf.addons import Clothoid


def four_c(A, length, rotation):
    render(Clothoid(start=(2, 2), length=length, paramA=A, rotation=rotation), dxfattribs={'color': 1})
    render(Clothoid(start=(2, 2), mirror='x', length=length, paramA=A, rotation=rotation), dxfattribs={'color': 2})
    render(Clothoid(start=(2, 2), mirror='y', length=length, paramA=A, rotation=rotation), dxfattribs={'color': 3})
    render(Clothoid(start=(2, 2), mirror='xy', length=length, paramA=A, rotation=rotation), dxfattribs={'color': 4})


def render(clothoid, dxfattribs):
    clothoid.render(msp, segments=100, dxfattribs=dxfattribs)
    clothoid.render_spline(msp, segments=10, dxfattribs={'color': 6, 'linetype': "DASHED"})


NAME = 'clothoid.dxf'
dwg = ezdxf.new('R2000')
msp = dwg.modelspace()

msp.add_line((-20, 0), (20, 0), dxfattribs={'linetype': "PHANTOM"})
msp.add_line((0, -20), (0, 20), dxfattribs={'linetype': "PHANTOM"})
for rotation in [0, 30, 45, 60, 75, 90]:
    four_c(10., 25, rotation)

if dwg.validate(print_report=True):
    dwg.saveas(NAME)
    print("drawing '%s' created.\n" % NAME)

{'fraction_non_alphanumeric': 0.17965850037119524, 'fraction_numerical': 0.051224944320712694, 'mean_word_length': 6.12962962962963, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5310945', 'n_tokens_mistral': 1155, 'n_tokens_neox': 1042, 'n_words': 233}