[package]
name = "cadrum"
version = "0.8.11"
edition = "2021"
description = "Rust CAD library powered by statically linked, headless OpenCASCADE (OCCT 8.0.0) — runs natively and in the browser via WebAssembly"
license = "MIT"
readme = "README.md"
repository = "https://github.com/lzpel/cadrum"
keywords = ["opencascade", "cad", "step", "gltf", "geometry"]
categories = ["graphics", "science"]
exclude = ["/figure", "/notes", "/steps", "/sandbox*", "/.github"]

[features]
default = ["color", "png"]
# Enable TShapeId, Rgb, and colormap on Shape for face-level color tracking
color = []
# Build OCCT from upstream sources when the cache is empty, instead of
# downloading a prebuilt tarball. Off by default — most users will use the
# prebuilt binary path.
source-build = ["dep:cmake"]
# PNG raster output for Scene2D via tiny-skia.
png = ["dep:tiny-skia"]
# Pure Rust CAD backend (no OCCT dependency)
pure = []

[dependencies]
cxx = "1"
glam = { version = ">=0.29", features = ["std"] }
# Pure-Rust 2D rasterizer used by Scene2D::write_png. Pulled in only with
# the `png` feature; tiny-skia bundles its own PNG encoder so no separate
# `png` crate dep is needed.
tiny-skia = { version = "0.11", optional = true }


[build-dependencies]
cxx-build = "1"
# download and extract prebuilt OCCT tarball
minreq = { version = "2", features = ["https-rustls"] }
libflate = "2"
tar = "0.4"
walkdir = "2"
# source-build only: build OCCT from upstream sources
cmake = { version = "0.1", optional = true }
# source-build + CADRUM_BUNDLE_GCC_RUNTIME: query the target compiler for libstdc++.a path
cc = "1"

[dev-dependencies]
# Used by examples/codegen.rs to parse traits.rs and rewrite marker regions.
regex = "1"

# Examples that depend on the `color` feature. Cargo will skip building these
# under `--no-default-features`. Examples without a `[[example]]` entry
# (02_write_read, markdown) build under all feature configurations.

[[example]]
name = "00_chijin"
required-features = ["color"]

[[example]]
name = "01_primitives"
required-features = ["color"]

[[example]]
name = "03_transform"
required-features = ["color"]

[[example]]
name = "04_boolean"
required-features = ["color"]

[[example]]
name = "05_extrude"
required-features = ["color"]

[[example]]
name = "06_loft"

[[example]]
name = "07_sweep"
required-features = ["color"]

[[example]]
name = "08_shell"
required-features = ["color"]

[[example]]
name = "101_joint"
