Clothoid¶
Type: Composite Entity
Clothoid curves are approximated by POLYLINE.
For an explanation of clothoid curves see Wikipedia:
http://en.wikipedia.org/wiki/Clothoid
-
DXFEngine.
clothoid
(start=(0, 0), rotation=0., length=1., paramA=1.0, mirror="", segments=100, **kwargs)¶ Parameters: - start – insert point as 2D points (float-tuples)
- rotation (float) – in degrees
- length (loat) – length of curve in drawing units
- paramA (float) – clothoid parameter A
- mirror (str) –
'x'
for mirror curve about x-axis,'y'
for mirror curve about y-axis,'xy'
for mirror curve about x- and y-axis - segments (int) – count of line segments for polyline approximation
- linetype (str) – linetype name, if not defined = BYLAYER
- layer (str) – layer name
- color (int) – range [1..255], 0 = BYBLOCK, 256 = BYLAYER
Example¶
import dxfwrite
from dxfwrite import DXFEngine as dxf
def four_c(A, length, rotation):
dwg.add(dxf.clothoid(start=(2, 2), length=length, paramA=A,
rotation=rotation, color=1))
dwg.add(dxf.clothoid(start=(2, 2), mirror='x', length=length, paramA=A,
rotation=rotation, color=2))
dwg.add(dxf.clothoid(start=(2, 2), mirror='y', length=length, paramA=A,
rotation=rotation, color=3))
dwg.add(dxf.clothoid(start=(2, 2), mirror='xy', length=length, paramA=A,
rotation=rotation, color=4))
name = 'clothoid.dxf'
dwg = dxf.drawing(name)
dwg.add(dxf.line((-20,0), (20, 0), linetype="DASHDOT2"))
dwg.add(dxf.line((0, -20), (0, 20), linetype="DASHDOT"))
for rotation in [0, 30, 45, 60, 75, 90]:
four_c(10., 25, rotation)
