ezdxf v0.11 requires CPython 3.6 or the latest pypy3 version for installation, testing and development.
Now using standard git branches master
and stable
:
master
actual development state, pull requests should be targeted to this branchstable
latest stable releaseAdditional support for creating radial and diameter dimensions
For a more simple usage many entities support a transform_to_wcs()
method. This entities can
be created by using UCS (User Coordinate System)
locations and transform them into WCS coordinates by transform_to_wcs(ucs)
.
Therefore the UCS()
class got new transformation features:
UCS.rotate(axis, angle)
returns a new UCS rotated around WCS vector axis
UCS.rotate_local_x(angle)
returns a new UCS rotated around local x-axisUCS.rotate_local_y(angle)
returns a new UCS rotated around local y-axisUCS.rotate_local_z(angle)
returns a new UCS rotated around local z-axisUCS.copy()
returns a new copy of UCSUCS.shift(delta)
shifts UCS inplace by vector delta
UCS.moveto(location)
set new UCS origin to location
inplaceTutorial for UCS based Transformation
Following DXF entities support transform_to_wcs()
:
Embedded ACIS entities like 3DSOLID, REGION, SURFACE and so on, do not expose their geometry without a commercial license from Spatial Inc. and therefore can not be modified by ezdxf!
The MeshTransformer class supports many inplace
transformations like translate, scale and rotate, it is a subclass of MeshBuilder()
and therefore compatible
to the DXF MESH entity, POLYMESH and POLYFACE support will be added soon.
Following factory functions from module ezdxf.render
return MeshTransformer()
objects:
cube()
cylinder()
cylinder_2p()
cone()
cone_2p()
sphere()
extrude()
from_profiles_linear()
from_profiles_spline()
rotation_form()
Constructive Solid Geometry (CSG) is a modeling technique that uses Boolean operations like union and intersection
to combine 3D solids. The MeshTransformer()
class is the interface between ezdxf and pycsg.
For more information go to ezdxf.addons.pycsg.
master
: development statestable
: latest stable releaseDimension.get_measurement()
supports angular, angular3p and ordinate dimensionsLayout.add_radius_dim()
implementedLayout.add_radius_dim_2p()
and Layout.add_radius_dim_cra()
Layout.add_diameter_dim()
implementedLayout.add_diameter_dim_2p()
Circle.vertices(angles)
yields vertices for iterable angles in WCSEllipse.vertices(params)
yields vertices for iterable params in WCSstart_point
and end_point
returns start- and end point of arc in WCSstart_point
and end_point
returns start- and end point of ellipse in WCSadd_polyline2d([(1, 2, 0.5), (3, 4, 0)], format='xyb')
Polyline.append_formatted_points()
with user defined point format supportDrawing.set_modelspace_vport(height, center)
set initial view/zoom location for the modelspaceDrawing.output_encoding
returns required output encodingtransform_to_wcs(ucs)
method, automatically take advantage of the new UCS transformation methods, but not all entity
types are supported, embedded ACIS entities like 3DSOLID, REGION, SURFACE and so on, do not expose their geometry.transform_to_wcs(ucs)
implemented for: 3DFACE, ARC, ATTDEF, ATTRIB, CIRCLE, ELLIPSE, HATCH, IMAGE, INSERT,
LEADER, LINE, LWPOLYLINE, MESH, MTEXT, POINT, POLYLINE, RAY, SHAPE, SOLID, SPLINE, TEXT, TRACE, XLINEUCS.rotate(axis, angle)
returns a new UCS rotated around WCS vector axis
UCS.rotate_local_x(angle)
returns a new UCS rotated around local x-axisUCS.rotate_local_y(angle)
returns a new UCS rotated around local y-axisUCS.rotate_local_z(angle)
returns a new UCS rotated around local z-axisUCS.copy()
returns a new copy of UCSUCS.shift(delta)
shifts UCS inplace by vector delta
UCS.moveto(location)
set new UCS origin to location
inplacesize
and center
properties for bounding box classesInsert.ucs()
returns an UCS placed in block reference insert
location, UCS axis aligned to the block axis.Insert.reset_transformation()
reset block reference location, rotation and extrusion vector.ezdxf.math.left_of_line
to ezdxf.math.is_point_left_of_line
ezdxf.math.point_to_line_relation()
2D function returns -1
for left oft line, +1
for right oif line , 0
on the lineezdxf.math.is_point_on_line_2d()
test if 2D point is on 2D line ezdxf.math.distance_point_line_2d()
distance of 2D point from 2D lineezdxf.math.is_point_in_polygon_2d()
test if 2D point is inside of a 2D polygon ezdxf.math.intersection_line_line_2d()
calculate intersection for 2D lines ezdxf.math.offset_vertices_2d()
calculate 2D offset vertices for a 2D polygon ezdxf.math.normal_vector_3p()
returns normal vector for 3 pointsezdxf.math.is_planar_face()
test if 3D face is planarezdxf.math.subdivide_face()
linear subdivision for 2D/3D faces/polygons ezdxf.math.intersection_ray_ray_3d()
calculate intersection for 3D rays ezdxf.math.Plane()
3D plane construction tool ezdxf.render.MeshTransformer()
inplace mesh transformation class, subclass of MeshBuilder()
MeshBuilder.render()
added UCS supportMeshBuilder.render_normals()
render face normals as LINE entities, useful to check face orientationezdxf.render.forms.cone_2p()
create 3D cone mesh from two pointsezdxf.render.forms.cylinder_2p()
create 3D cylinder mesh from two pointsezdxf.render.forms.sphere()
create 3D sphere meshpycsg
add-on, a simple Constructive Solid Geometry (CSG) kernel created by Evan Wallace (Javascript) and
Tim Knip (Python)ezdxf.options.use_old_predefined_pattern_scaling
to True, to use the old pattern scaling before v0.11 ezdxf.PATTERN
constant, use PATTERN = ezdxf.pattern.load()
instead, set argument
old_pattern=True
to use the old pattern scaling before v0.11Table.key()
accepts only strings, therefore tables check in
accepts also only strings
like entity.dxf.name
ezdxf.comments.from_file
) or stream (ezdxf.comments.from_stream
)UCS.to_ocs_angle_deg()
and UCS.to_ocs_angle_rad()
new()
is_point_left_of_line()
algorithm was incorrectdimtxsty
is Standard
if options.default_dimension_text_style
is not definedStandard
as default for undefined dimension styles, e.g. EZDXF
without setup