Skip to main content

Crate cadkit

Crate cadkit 

Source
Expand description

Read DWG, DGN and DXF drawings into one format-neutral model.

let doc = cadkit::open("plan.dgn")?;
for model in &doc.models {
    println!("{}: {} entities", model.name, model.entities.len());
}

Native, lossless APIs of each format are available under dgn, dwg and dxf.

Re-exports§

pub use cadkit_dgn as dgn;
pub use cadkit_dwg as dwg;
pub use cadkit_dxf as dxf;
pub use cadkit_gml as gml;

Modules§

aci
AutoCAD Color Index (ACI) to RGB table.
bytes
Bounds-checked little-endian reader for untrusted input.
error
Error type shared by all cadkit crates.
export
Yazıcılardan önce bellek içi modelin kaynak bütçesini denetler.
geom
Basic geometry types.
geom_ops
Geometry helpers: vector math, affine Transform, circular/elliptic arcs, polyline bulges and NURBS evaluation.
model
Format-neutral drawing model.
ops
Model traversal and derived properties: Document::walk, Document::bbox, Entity::resolved_color and EntityKind::type_name.
options
Reader options and resource limits.
polygon
Çizim birimlerinde, kapalı ve düzlemsel halkaların sınırlı doğrulaması.
svg
2D SVG rendering of a Document (top view, XY plane).
text
Text helpers shared by the DXF and DWG readers: MTEXT format-code stripping and the \U+XXXX / \M+nXXXX escape decoding. Panic-free; output size is bounded by the input.
units
Length-unit helpers: conversion to meters and DWG/DXF $INSUNITS codes.

Structs§

Attribute
Non-graphic data attached to an entity (DWG ATTRIB, DGN tag, item-type property).
AttributeDisplay
Text presentation of a displayed attribute value.
BBox
An axis-aligned bounding box.
Block
A block definition (DGN: shared cell definition).
Document
A complete drawing.
Entity
One drawn object.
HatchLoop
One hatch boundary loop.
Layer
A layer (DGN: level).
Limits
Hard resource limits that protect against malicious or corrupt input. Every reader must check sizes taken from the file against these before allocating or looping.
Linetype
A linetype definition.
Model
A space that holds drawn entities: model space, a paper-space layout or a DGN model.
Point3
A 3D point. 2D data uses z = 0 (or the elevation).
Raw
Original bytes of a record, for lossless inspection.
ReadOptions
Options accepted by every reader.
SourceInfo
Origin of a Document.
SvgOptions
SVG rendering options.
TextStyle
A text style definition.
Units
Drawing units.
Vec3
A 3D vector (directions, normals, axes).
Vertex
Polyline vertex.
Warning
A recoverable problem found while reading.

Enums§

Attachment
Multi-line text attachment point.
Color
Color.
DimensionType
Dimension kind.
DxfVersion
DXF output version.
EntityKind
Geometry and type-specific data of an Entity.
Error
Why reading or writing failed.
Format
File format family.
GroupKind
What a EntityKind::Group represents.
HAlign
Horizontal text alignment.
HatchEdge
A hatch boundary edge.
LengthUnit
Length unit. Mirrors the DWG $INSUNITS set.
Lineweight
Line weight.
ModelKind
Kind of Model.
VAlign
Vertical text alignment.
Value
A loosely typed value for attributes and props.

Functions§

detect
Detects the format of bytes from its header.
open
Reads a drawing file from disk with default options.
open_with
Reads a drawing file from disk.
read
Reads a drawing of any supported format with default options.
read_with
Reads a drawing of any supported format.
to_citygml
Nötr geometriyi açık CRS/LoD seçimiyle genel CityGML nesnelerine yazar.
to_dgn
Tek nötr modeli, birimleri ve model boyutu eşleşen seed ile DGN V8’e yazar.
to_dxf
Writes a document as ASCII DXF.
to_json
Serializes a document to JSON.
to_svg
Renders a document model as SVG.

Type Aliases§

Props
Format-specific extra data, keyed "<format>.<name>" (e.g. "dgn.level_id").
Result
Result alias using Error.