Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion NOTICE
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
DraftCraft™
Copyright (c) 2026 Skryx Dev and WithShalom Studios.
Portions Copyright (c) 2026 ArtCraft Team and the CADCraft contributors.
The DWG reader and writer (crates/dwg: read, write, records, bits, crc, lz77) come from BlackCAD
(https://github.com/withshalom/blackcad), Copyright (c) 2026 WithShalom Studios, MIT OR Apache-2.0.

Licensed under the MIT License or the Apache License, Version 2.0, at your option
(LICENSE-MIT, LICENSE-APACHE).
Expand All @@ -15,7 +17,8 @@ Third-party material
Software dependencies are listed in Cargo.lock. One is under a weak-copyleft licence: the acadrust
crate (DWG reading and writing, https://github.com/hakanaktt/acadrust) is licensed under the
Mozilla Public License 2.0 and is used unmodified as a separate library (crates/dwg). Its source
is available from crates.io and the repository above.
is available from crates.io and the repository above. DraftCraft's own DWG reader and writer don't
use it; it is the fallback for files they don't cover yet (crates/dwg/src/acadrust).


DraftCraft's icons, drafting font, hatch patterns and linetypes are drawn or defined in code.
Expand Down
10 changes: 6 additions & 4 deletions crates/dwg/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "draftcraft-dwg"
description = "DraftCraft DWG bridge: converts DWG to and from DXF bytes using the acadrust crate (MPL-2.0, used unmodified)"
description = "DraftCraft's DWG codec: reads R13–2018 DWG into object records and writes 2018 DWG (from BlackCAD), with the acadrust crate (MPL-2.0, used unmodified) as a fallback"
version.workspace = true
edition.workspace = true
license.workspace = true
Expand All @@ -11,11 +11,13 @@ workspace = true
[dependencies]
log = { workspace = true }

# The same targets as build.rs's `no_dwg_bridge` leave acadrust out: wasm32, and FreeBSD aarch64,
# where acadrust 0.6.6 passed a `*const c_char` (u8 there) to its own `*const i8` sysctlbyname.
# The same target as build.rs's `no_acadrust` leaves acadrust out: FreeBSD aarch64, where
# acadrust 0.6.6 passed a `*const c_char` (u8 there) to its own `*const i8` sysctlbyname.
# wasm32 builds it: acadrust uses `web-time` for its clocks and runs its parallel stages
# sequentially there, and it memory-maps files only on native targets.
# A commit of acadrust's main branch, not a release: 0.6.8 and older write 2004–2018 DWG files that
# AutoCAD refuses (their section map has no empty first entry; acadrust issue #281, fixed by PR #280).
# Go back to a crates.io version (also in crates/io/Cargo.toml) once one includes that fix.
[target.'cfg(not(any(target_arch = "wasm32", all(target_os = "freebsd", target_arch = "aarch64"))))'.dependencies]
[target.'cfg(not(all(target_os = "freebsd", target_arch = "aarch64")))'.dependencies]
# MPL-2.0: used as an unmodified dependency only (see plan/adr/0001 and NOTICE).
acadrust = { git = "https://github.com/hakanaktt/acadrust", rev = "008c6391bbb5deb7baf4bd44495b7b1cfc53eceb" }
8 changes: 4 additions & 4 deletions crates/dwg/build.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
//! Sets `no_dwg_bridge` on the targets built without acadrust (see Cargo.toml): the DWG functions
//! Sets `no_acadrust` on the target built without acadrust (see Cargo.toml): the DWG functions
//! there return an error that says to use DXF.

fn main() {
println!("cargo:rerun-if-changed=build.rs");
println!("cargo::rustc-check-cfg=cfg(no_dwg_bridge)");
println!("cargo::rustc-check-cfg=cfg(no_acadrust)");
let arch = std::env::var("CARGO_CFG_TARGET_ARCH").unwrap_or_default();
let os = std::env::var("CARGO_CFG_TARGET_OS").unwrap_or_default();
if arch == "wasm32" || (os == "freebsd" && arch == "aarch64") {
println!("cargo::rustc-cfg=no_dwg_bridge");
if os == "freebsd" && arch == "aarch64" {
println!("cargo::rustc-cfg=no_acadrust");
}
}
1,321 changes: 1,321 additions & 0 deletions crates/dwg/src/acadrust/mod.rs

Large diffs are not rendered by default.

File renamed without changes.
Loading