Repository navigation
0.6.0: code pages, rebuilt dimensions, header variables, attributes, geometric tolerances
Reading a drawing as its own file says to: its code page, header variables, number format and attributes, the dimension values that were missing, and four entity types that were skipped (#30, #31, #33, #34, #36, #37, #39).
New
- Code page (#36). A file is read through its
$DWGCODEPAGE:ANSI_1252(McMaster-Carr's drawings) readsé,°andØas written, not as Shift-JIS. A file of R2007 or later is read as UTF-8.%%nnnand\M+nXXXXare decoded and\U+surrogate pairs are one character.DXF.CodePage,Drawing.codePageandDimension.codePageare new. - Rebuilding dimensions (#37).
Drawing.rebuildingDimensions(_:)rebuilds DIMENSIONs from the loose pieces a converter leaves (value texts, dimension lines, extension lines and marks), infers the scale of each layer group, and says what it could not explain.Dimension.rebuiltmarks them.dxfdump --rebuild [--scale N] [--numbers ...]. On the Jw_cad 2120 it rebuilds all 29 dimensions at 1:80. - How a drawing writes numbers (#39).
DimensionText(_:numbers:codePage:),Dimension.text(numbers:)andDimensionRebuild.Options(numbers:)take aNumberConvention:.commaSeparatesThousands(Jw_cad's10,439is 10439),.commaIsDecimalMark(0,125is 0.125) or.plain, the default, which leaves a comma out of a number as before. Full-width digits and the full-width comma read as numbers. - Angular and ordinate values (#33).
computedMeasurementhas a value for angular, three-point angular and ordinate dimensions: degrees for the angles (on the side of the arc location), a distance along x or y for an ordinate (Dimension.isXOrdinate). An angle typed into the text (45°,45%%d) is a newDimensionText.Part.angle, intypedAngles. - Header variables (#31).
Drawing.headerVariablesholds every variable of the HEADER section by name, with its group-coded values.measurement,currentDimensionStyleName,dimensionScale,linearUnitFormat,linearUnitPrecisionand a computedcurrentDimensionStyleare built on it.dxfdump --header. - Attributes (#30).
BlockReference.attributesholds the ATTRIB records of an INSERT (tag, value, position, height, rotation, layer, flags, identity) andBlock.attributeDefinitionsthe ATTDEFs.ReadOptions(expandAttributes:)flattens visible attributes intoTEXTentities whose identityvianames the reference. R2018 multiline attributes read their text.dxfdump --attributes. - Geometric tolerances, solids, wipeouts and faces (#34).
.tolerancereads a feature control frame into rows of characteristic, tolerance value with its modifiers, and datums ({\Fgdt;i}%%v0.012%%v%%vB%%v%%vis symmetry, 0.012, datum B); a symbol or box it cannot place is kept and flagged, never guessed..solid,.wipeoutand.face3Dare read as well. None of the four appears inskippedany more. - Oracles and tools:
tools/oracle.py --header,tools/attrib_oracle.py,tools/oracle_diff.py, and fixture generators for each.
Checked against ezdxf on real drawings
- Header variables: 2,943 DXF files, no differences on any variable.
- Attributes: 170 drawings, 7,020 attributes on model-space references, 3,634 inside blocks, 6,680 definitions and all 441 visible ones after expansion, no differences.
- SOLID and 3DFACE: 365 SOLIDs in 35 drawings and 13,106 3DFACEs in 170, every count and coordinate agrees.
- Angular: all 8 three-point angular dimensions in two AutoCAD drawings match the text AutoCAD stored. ezdxf puts the arc on the other side for two of them, so the side rule follows AutoCAD, not ezdxf.
Changed (see "Upgrading from 0.5" in the README)
DXF.Entityhas four new cases,Countsfour new fields, andContour.Warninga new case,.ignoredEntities(type:count:), which replaces.skippedEntitiesfor these types. An exhaustiveswitchover any of them needs the new cases.DimensionText.Parthas a new case,.angle, andtypedNumbersof45°is[], where it was[45].- Header values are read from the HEADER section only; a group 9 elsewhere in the file was once taken for a variable. No real drawing differs.
- ATTRIB is no longer in
skipped. A stray ATTRIB and a model-space ATTDEF still are. - A SOLID on a
-zplane is converted into the world, as an ARC is. A block expansion no longer scales an angular dimension's group 42 by the insertion scale. - Every existing initialiser keeps its parameters in order, the new ones last and defaulted.
Not yet
- No real TOLERANCE or WIPEOUT was found on the machines checked, so both rest on ezdxf-written fixtures; how AutoCAD writes a projected-zone height or a datum identifier is unverified and lands in
Frame.unread. - No AutoCAD ordinate dimension was available, so ordinate values are checked against ezdxf only and are not signed. No real file has an angular dimension carrying group 42.
DIMAUNITandDIMADEC(angle display units and places) are not modelled. WIPEOUT clip mode and a SOLID's R11 elevation are not read.- An AutoCAD-written title block was not available for #30; attributes are checked on ezdxf-written R2000, R2018 multiline and array fixtures and on 170 real R12 and R2013 drawings.
- Decoding of TOLERANCE and WIPEOUT for a DWG is SwiftDWG#13.