1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//! # csx
//!
//! Pure Rust continuous-structure geometry and material modeling, compatible
//! with CSXCAD and openEMS.
//!
//! A [`ContinuousStructure`] holds named [`Property`]s (materials, metals,
//! excitations, probes, ...). Each property owns [`Primitive`]s describing
//! where it applies; overlapping primitives are resolved by priority. The
//! structure also carries a [`RectilinearGrid`] (the FDTD mesh), a
//! [`ParameterSet`] for parametric models and the background material.
//!
//! ```
//! use csx::primitives::{BoxShape, Cylinder};
//! use csx::properties::Material;
//! use csx::{ContinuousStructure, CoordSystem, Primitive, Property, TypeMask, Vec3};
//!
//! let mut model = ContinuousStructure::new();
//! model.parameters.set("h", 1.6);
//!
//! // FR4 substrate, its thickness given by the parameter `h`.
//! let fr4 = model.add_property(Property::material("FR4", Material::new(4.3, 0.0)));
//! model.add_primitive(fr4, Primitive::new(BoxShape {
//! start: [-10.0, -10.0, 0.0].into(),
//! stop: csx::ScalarPoint(["10".into(), "10".into(), "h".into()]),
//! }))?;
//!
//! // A metal via with higher priority.
//! let pec = model.add_property(Property::metal("via"));
//! model.add_primitive(pec, Primitive::new(Cylinder::new([0.0, 0.0, 0.0], [0.0, 0.0, 1.6], 0.3))
//! .with_priority(10))?;
//!
//! model.update()?; // evaluate parametric values
//!
//! let hit = model.property_at(Vec3::new(5.0, 0.0, 0.8), CoordSystem::Cartesian, TypeMask::ANY);
//! assert_eq!(hit.unwrap().property.name, "FR4");
//! let hit = model.property_at(Vec3::new(0.1, 0.0, 0.8), CoordSystem::Cartesian, TypeMask::ANY);
//! assert_eq!(hit.unwrap().property.name, "via");
//! # Ok::<(), csx::Error>(())
//! ```
//!
//! This is a clean-room implementation written from public documentation and
//! the observable file format only.
pub use CoordSystem;
pub use ;
pub use RectilinearGrid;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;