3. dxf¶
Module for outputing from numpy/python to dxf file format, a vector graphics file format used for laser cutting and CAD applications – Dustin 2012ish
3.2. Classes and Functions¶
-
class
ilpm.dxf.
DXF
[source]¶ Bases:
object
Class for handling dxf files using python. DXF is a vector graphics format widely used in CAD applications.
Methods
circle
(self, X, r[, layer, preview_points])Create a circle in the dxf instance
line
(self, x0, y0, x1, y1[, layer])Create a line segment in the dxf instance
plot_preview
(self[, show])Plot the contents of the dxf instance
polyline
(self, X[, layer, closed])Create a sequence of line segments in the dxf instance
save
(self, fn)Output the dxf instance to a dxf file
-
line
(self, x0, y0, x1, y1, layer='0')[source]¶ Create a line segment in the dxf instance
- Parameters
- x0float
starting x coordinate for lineseg
- y0float
starting y coordinate for lineseg
- x1float
ending x coordinate for lineseg
- y1float
ending y coordinate for lineseg
- layerstr (default=‘0’)
which layer of the dxf vector graphics image to add line to
-
polyline
(self, X, layer='0', closed=False)[source]¶ Create a sequence of line segments in the dxf instance
- Parameters
- Xlength N list of length 2 lists of floats or N x 2 float array
the sequence of points for which to create linesegments, in order
- layerstr (default=‘0’)
which layer of the dxf vector graphics image to add line to
- closedbool
whether to connect X[-1] to X[0] as a lineseg
-
circle
(self, X, r, layer='0', preview_points=200)[source]¶ Create a circle in the dxf instance
- Parameters
- Xlength 2 list of floats or 2 x 1 float array
the center point for the circle to create
- rfloat
the radius of the circle
- layerstr (default=‘0’)
which layer of the dxf vector graphics image to add line to
- preview_pointsint
how many points with which to approximate the circle in the preview (the actual dxf file has a true vector graphics circle)
-