Skip to content

armgit / forma

Public Imported from GitHub
0

A 1.2 MB pure-Rust rewrite of headless Blender built for AI agents — 3D B-rep modeling engine, CLI, and MCP server

fix: kernel and export soundness (remesh winding, batch fallback, 1-simplex decimate, materials/UVs, STEP) (#75)

Nebula68794c45308e
diff --git a/crates/forma-core/src/boolean.rs b/crates/forma-core/src/boolean.rs
index b27c123..a78ce94 100644
--- a/crates/forma-core/src/boolean.rs
+++ b/crates/forma-core/src/boolean.rs
@@ -2202,9 +2202,10 @@ fn apply_disjoint_group(
for t in &group[1..] {
merged.append_mesh(t);
}
- let cand = boolean_op(a, &merged, op, b_name, op_id)?;
- if count_bad_or_unoriented_edges(&cand) == 0 && !cand.faces.is_empty() {
- return Ok(cand);
+ if let Ok(cand) = boolean_op(a, &merged, op, b_name, op_id) {
+ if count_bad_or_unoriented_edges(&cand) == 0 && !cand.faces.is_empty() {
+ return Ok(cand);
+ }
}
// Automatic binary-split fallback so multi-hole batches never fail when sequential cuts pass!
let mid = group.len() / 2;
@@ -2239,6 +2240,8 @@ pub fn boolean_batch(
// while preventing 8-20+ hole rows from shattering 2 giant plate triangles with 500+ planes).
const MAX_BATCH_TOOLS: usize = 4;
const MAX_BATCH_FACES: usize = 256;
+ let target_scale = a.aabb().size().len().max(1e-6);
+ let disj_eps = (1e-4_f64).min(1e-4 * target_scale);
let bbs: Vec<Aabb> = tools.iter().map(|t| t.aabb()).collect();
let mut used = vec![false; tools.len()];
let mut acc = a.clone();
@@ -2250,6 +2253,8 @@ pub fn boolean_batch(
let mut group: Vec<&PolyMesh> = vec![&tools[i]];
let mut group_faces = tools[i].faces.len();
let mut batch_bbs = vec![bbs[i]];
+ let mut group_bb = bbs[i];
+ let mut min_tool_dim = bbs[i].size().len();
for j in (i + 1)..tools.len() {
if used[j] || group.len() >= MAX_BATCH_TOOLS {
continue;
@@ -2257,10 +2262,20 @@ pub fn boolean_batch(
if group_faces + tools[j].faces.len() > MAX_BATCH_FACES {
continue;
}
- if !batch_bbs.iter().any(|bb| bb.overlaps(&bbs[j], 1e-4)) {
+ if !batch_bbs.iter().any(|bb| bb.overlaps(&bbs[j], disj_eps)) {
+ let mut next_bb = group_bb;
+ next_bb.include(bbs[j].min);
+ next_bb.include(bbs[j].max);
+ let next_min = min_tool_dim.min(bbs[j].size().len());
+ // Avoid merging tiny tools across a huge span that would defeat extreme_ratio normalization.
+ if next_min < 0.02 * next_bb.size().len() {
+ continue;
+ }
group.push(&tools[j]);
group_faces += tools[j].faces.len();
batch_bbs.push(bbs[j]);
+ group_bb = next_bb;
+ min_tool_dim = next_min;
used[j] = true;
}
}
diff --git a/crates/forma-core/src/export.rs b/crates/forma-core/src/export.rs
index c27b093..bececfb 100644
--- a/crates/forma-core/src/export.rs
+++ b/crates/forma-core/src/export.rs
@@ -798,19 +798,50 @@ pub fn write_step_bytes_with_unit(mesh: &PolyMesh, unit: Unit) -> Result<Vec<u8>
vp_ids.push(vpid);
}
+ // Expand non-planar n-gons into planar triangles so every STEP ADVANCED_FACE lies on a true plane.
+ let mut planar_faces: Vec<Vec<usize>> = Vec::with_capacity(mesh.faces.len());
+ for (fi, f) in mesh.faces.iter().enumerate() {
+ let n = f.verts.len();
+ if n < 3 {
+ continue;
+ }
+ if n == 3 {
+ planar_faces.push(f.verts.to_vec());
+ continue;
+ }
+ let fnrm = mesh.face_normal(fi);
+ let p0 = mesh.verts[f.verts[0]];
+ let max_dev = f.verts[1..]
+ .iter()
+ .map(|&vi| (mesh.verts[vi] - p0).dot(fnrm).abs())
+ .fold(0.0_f64, f64::max);
+ if fnrm.len_sq() >= 0.5 && max_dev <= 1e-6 {
+ planar_faces.push(f.verts.to_vec());
+ } else {
+ for [a, b, c] in mesh.triangulate_face(fi) {
+ planar_faces.push(vec![a, b, c]);
+ }
+ }
+ }
+
// 2. Deduplicated undirected edges -> LINE + EDGE_CURVE (oriented min_v -> max_v)
let mut edge_map: std::collections::BTreeMap<(usize, usize), usize> = std::collections::BTreeMap::new();
- for f in &mesh.faces {
- let n = f.verts.len();
+ for fv in &planar_faces {
+ let n = fv.len();
for i in 0..n {
- let u = f.verts[i];
- let v = f.verts[(i + 1) % n];
+ let u = fv[i];
+ let v = fv[(i + 1) % n];
if u == v {
continue;
}
let key = if u < v { (u, v) } else { (v, u) };
if !edge_map.contains_key(&key) {
- let d = (mesh.verts[key.1] - mesh.verts[key.0]).normalized();
+ let diff = mesh.verts[key.1] - mesh.verts[key.0];
+ let d = if diff.len_sq() > 1e-24 {
+ diff.normalized()
+ } else {
+ Vec3::X
+ };
let dir_id = alloc();
let vec_id = alloc();
let line_id = alloc();
@@ -828,19 +859,24 @@ pub fn write_step_bytes_with_unit(mesh: &PolyMesh, unit: Unit) -> Result<Vec<u8>
}
// 3. Faces -> PLANE + EDGE_LOOP + FACE_OUTER_BOUND + ADVANCED_FACE
- let mut face_ids = Vec::with_capacity(mesh.faces.len());
- for (fi, f) in mesh.faces.iter().enumerate() {
- let n = f.verts.len();
+ let mut face_ids = Vec::with_capacity(planar_faces.len());
+ for fv in &planar_faces {
+ let n = fv.len();
if n < 3 {
continue;
}
- let fnrm = mesh.face_normal(fi);
+ let v0 = mesh.verts[fv[0]];
+ let mut nsum = Vec3::ZERO;
+ for k in 1..(n - 1) {
+ nsum = nsum + (mesh.verts[fv[k]] - v0).cross(mesh.verts[fv[k + 1]] - v0);
+ }
+ let fnrm = nsum.normalized();
if fnrm.len_sq() < 0.5 {
continue;
}
let mut ref_dir = None;
for i in 0..n {
- let edge = mesh.verts[f.verts[(i + 1) % n]] - mesh.verts[f.verts[i]];
+ let edge = mesh.verts[fv[(i + 1) % n]] - mesh.verts[fv[i]];
let ortho = edge - fnrm * edge.dot(fnrm);
if ortho.len_sq() > 1e-20 {
ref_dir = Some(ortho.normalized());
@@ -853,8 +889,8 @@ pub fn write_step_bytes_with_unit(mesh: &PolyMesh, unit: Unit) -> Result<Vec<u8>
});
let mut oe_ids = Vec::with_capacity(n);
for i in 0..n {
- let u = f.verts[i];
- let v = f.verts[(i + 1) % n];
+ let u = fv[i];
+ let v = fv[(i + 1) % n];
if u == v {
continue;
}
@@ -879,7 +915,7 @@ pub fn write_step_bytes_with_unit(mesh: &PolyMesh, unit: Unit) -> Result<Vec<u8>
let af_id = alloc();
s.push_str(&format!("#{n_dir}=DIRECTION('',({:.8},{:.8},{:.8}));\n", fnrm.x, fnrm.y, fnrm.z));
s.push_str(&format!("#{r_dir}=DIRECTION('',({:.8},{:.8},{:.8}));\n", ref_dir.x, ref_dir.y, ref_dir.z));
- s.push_str(&format!("#{ax_id}=AXIS2_PLACEMENT_3D('',#{},#{n_dir},#{r_dir});\n", cp_ids[f.verts[0]]));
+ s.push_str(&format!("#{ax_id}=AXIS2_PLACEMENT_3D('',#{},#{n_dir},#{r_dir});\n", cp_ids[fv[0]]));
s.push_str(&format!("#{pl_id}=PLANE('',#{ax_id});\n"));
s.push_str(&format!("#{af_id}=ADVANCED_FACE('',(#{fb_id}),#{pl_id},.T.);\n"));
face_ids.push(af_id);
diff --git a/crates/forma-core/src/mesh.rs b/crates/forma-core/src/mesh.rs
index 6588caf..f12b608 100644
--- a/crates/forma-core/src/mesh.rs
+++ b/crates/forma-core/src/mesh.rs
@@ -631,20 +631,31 @@ impl PolyMesh {
self.verts = new_verts;
let mut clean_faces: Vec<Face> = Vec::with_capacity(self.faces.len());
for mut f in self.faces.drain(..) {
+ let has_uvs = f.uvs.len() == f.verts.len();
let mut dedup: SmallVec<[usize; 4]> = SmallVec::new();
- for &vi in &f.verts {
+ let mut dedup_uvs: Vec<[f32; 2]> = Vec::with_capacity(f.uvs.len());
+ for (idx, &vi) in f.verts.iter().enumerate() {
let nvi = remap[vi];
if dedup.last().copied() != Some(nvi) {
dedup.push(nvi);
+ if has_uvs {
+ dedup_uvs.push(f.uvs[idx]);
+ }
}
}
if dedup.len() > 1 && dedup.first() == dedup.last() {
dedup.pop();
+ if has_uvs {
+ dedup_uvs.pop();
+ }
}
if dedup.len() < 3 {
continue;
}
f.verts = dedup;
+ if has_uvs {
+ f.uvs = dedup_uvs;
+ }
let v0 = self.verts[f.verts[0]];
let mut area2 = Vec3::ZERO;
for k in 1..(f.verts.len() - 1) {
diff --git a/crates/forma-core/src/ops.rs b/crates/forma-core/src/ops.rs
index 47ad203..9d17a17 100644
--- a/crates/forma-core/src/ops.rs
+++ b/crates/forma-core/src/ops.rs
@@ -187,6 +187,9 @@ pub fn inset_faces(
let sel_set: HashSet<usize> = selected.iter().copied().collect();
let mut out = PolyMesh::new();
out.verts = mesh.verts.clone();
+ out.materials = mesh.materials.clone();
+ out.smooth_angle_deg = mesh.smooth_angle_deg;
+ out.weighted_normals = mesh.weighted_normals;
for (fi, f) in mesh.faces.iter().enumerate() {
if !sel_set.contains(&fi) {
@@ -244,18 +247,20 @@ pub fn inset_faces(
// Rim quads
for i in 0..n {
let j = (i + 1) % n;
- out.add_face(
+ let rim_fi = out.add_face(
smallvec![f.verts[i], f.verts[j], inner_verts[j], inner_verts[i]],
op_id,
Some("rim"),
);
+ out.faces[rim_fi].mat_id = f.mat_id;
}
// Inner face
let mut inner_tags = f.tags.clone();
if !inner_tags.iter().any(|t| t == "inner") {
inner_tags.push("inner".into());
}
- out.add_face_with_tags(inner_verts, op_id, Some(f.lineage), &inner_tags);
+ let inner_fi = out.add_face_with_tags(inner_verts, op_id, Some(f.lineage), &inner_tags);
+ out.faces[inner_fi].mat_id = f.mat_id;
}
out.compact_unused_verts();
out.ensure_outward_winding();
@@ -1093,6 +1098,10 @@ fn try_bevel_z_rims(
}
let mut m = PolyMesh::new();
+ m.materials = mesh.materials.clone();
+ m.smooth_angle_deg = mesh.smooth_angle_deg;
+ m.weighted_normals = mesh.weighted_normals;
+ let uniform_mat = if mesh.materials.len() == 1 { Some(0u16) } else { None };
let mut rings: Vec<Vec<usize>> = Vec::with_capacity(clean_rings.len());
for (p2, z, _) in &clean_rings {
let mut ring = Vec::with_capacity(n);
@@ -1120,6 +1129,11 @@ fn try_bevel_z_rims(
// Top cap
let top_f: SmallVec<[usize; 4]> = rings.last().unwrap().iter().copied().collect();
m.add_face(top_f, op_id, Some("top"));
+ if let Some(mid) = uniform_mat {
+ for f in &mut m.faces {
+ f.mat_id = mid;
+ }
+ }
m.ensure_outward_winding();
Some(m)
}
@@ -1133,6 +1147,9 @@ fn bevel_general_polyhedron(
) -> Result<PolyMesh, String> {
let sel_set: HashSet<(usize, usize)> = selected_edges.iter().copied().collect();
let mut out = PolyMesh::new();
+ out.materials = mesh.materials.clone();
+ out.smooth_angle_deg = mesh.smooth_angle_deg;
+ out.weighted_normals = mesh.weighted_normals;
let mut face_corner_map: HashMap<(usize, usize), usize> = HashMap::new(); // (fi, orig_v) -> new_v
// Shrink corners of faces adjacent to selected edges
@@ -1188,7 +1205,8 @@ fn bevel_general_polyhedron(
face_corner_map.insert((fi, v), nvi);
new_fv.push(nvi);
}
- out.add_face_with_tags(new_fv, op_id, Some(f.lineage), &f.tags);
+ let out_fi = out.add_face_with_tags(new_fv, op_id, Some(f.lineage), &f.tags);
+ out.faces[out_fi].mat_id = f.mat_id;
}
// Bridge bevel quads across every edge touching affected vertices
@@ -1928,11 +1946,39 @@ pub fn decimate_mesh(
}
}
- // Edelsbrunner Link-Condition: lk(u) ∩ lk(v) must equal the 2 opposite vertices of shared tris
- let common = nbrs_u.iter().filter(|w| **w != v && nbrs_v.contains(w)).count();
+ // Full Edelsbrunner Link-Condition:
+ // 0-simplex: lk(u) ∩ lk(v) must equal the 2 opposite vertices (c0, c1) of the shared tris.
+ // 1-simplex: (c0, c1) cannot simultaneously form surviving triangles with both u and v
+ // (which collapses a 4-tri tetrahedron component into two zero-volume opposing triangles).
+ let mut common_verts = [0usize; 2];
+ let mut common = 0usize;
+ for &w in &nbrs_u {
+ if w != v && nbrs_v.contains(&w) {
+ if common < 2 {
+ common_verts[common] = w;
+ }
+ common += 1;
+ }
+ }
if common != 2 {
continue;
}
+ let (c0, c1) = (common_verts[0], common_verts[1]);
+ let u_has_c0c1 = v_tris[u].iter().any(|&ti| {
+ alive_tri[ti] && {
+ let t = tris[ti].0;
+ t.contains(&c0) && t.contains(&c1)
+ }
+ });
+ let v_has_c0c1 = v_tris[v].iter().any(|&ti| {
+ alive_tri[ti] && {
+ let t = tris[ti].0;
+ t.contains(&c0) && t.contains(&c1)
+ }
+ });
+ if u_has_c0c1 && v_has_c0c1 {
+ continue;
+ }
// Normal-flip & degeneracy check on all surviving incident triangles
let new_p = item.best_pt;
diff --git a/crates/forma-core/src/remesh.rs b/crates/forma-core/src/remesh.rs
index 41545ab..792524e 100644
--- a/crates/forma-core/src/remesh.rs
+++ b/crates/forma-core/src/remesh.rs
@@ -34,7 +34,9 @@ pub fn remesh_voxel(mesh: &PolyMesh, voxel_size: f64, op_id: u32) -> Result<Poly
// Collect triangles and project onto every `(y, z)` scanline with tiny deterministic jitter
// so rays never graze exact vertices or edges (Simulation of Simplicity parity guarantee!).
- let mut scanlines: Vec<Vec<f64>> = vec![Vec::new(); ny * nz];
+ // Store `(x_hit, winding_delta)` using the sign of `det = ((v1-v0) x (v2-v0)).x` so non-zero
+ // winding unions overlapping multi-shell meshes instead of XOR-hollowing them.
+ let mut scanlines: Vec<Vec<(f64, i32)>> = vec![Vec::new(); ny * nz];
let eps_y = 1.137e-7 * h;
let eps_z = 2.713e-7 * h;
let inv_h = 1.0 / h;
@@ -83,7 +85,8 @@ pub fn remesh_voxel(mesh: &PolyMesh, voxel_size: f64, op_id: u32) -> Result<Poly
continue;
}
let x_hit = v0.x + u * d1x + v * d2x;
- scanlines[row_off + iy].push(x_hit);
+ let delta = if det < 0.0 { 1 } else { -1 };
+ scanlines[row_off + iy].push((x_hit, delta));
}
}
}
@@ -98,20 +101,22 @@ pub fn remesh_voxel(mesh: &PolyMesh, voxel_size: f64, op_id: u32) -> Result<Poly
if xs.len() < 2 {
continue;
}
- xs.sort_unstable_by(|a, b| a.total_cmp(b));
+ xs.sort_unstable_by(|a, b| a.0.total_cmp(&b.0));
let base = (iz * ny + iy) * nx;
- let mut k = 0usize;
- while k + 1 < xs.len() {
- let x_in = xs[k];
- let x_out = xs[k + 1];
- let ix0 = (((x_in - origin.x) * inv_h).ceil() as isize).clamp(1, nx as isize - 2) as usize;
- let ix1 = (((x_out - origin.x) * inv_h).floor() as isize).clamp(1, nx as isize - 2) as usize;
- if ix0 <= ix1 {
- for ix in ix0..=ix1 {
- inside[base + ix] = true;
+ let mut winding = 0i32;
+ for k in 0..(xs.len() - 1) {
+ winding += xs[k].1;
+ if winding != 0 {
+ let x_in = xs[k].0;
+ let x_out = xs[k + 1].0;
+ let ix0 = (((x_in - origin.x) * inv_h).ceil() as isize).clamp(1, nx as isize - 2) as usize;
+ let ix1 = (((x_out - origin.x) * inv_h).floor() as isize).clamp(1, nx as isize - 2) as usize;
+ if ix0 <= ix1 {
+ for ix in ix0..=ix1 {
+ inside[base + ix] = true;
+ }
}
}
- k += 2;
}
}
}
@@ -211,7 +216,7 @@ pub fn remesh_voxel(mesh: &PolyMesh, voxel_size: f64, op_id: u32) -> Result<Poly
let xs = &scanlines[(z + dz) * ny + (y + dy)];
let mut best_x = mid.x;
let mut best_d = h * 0.6;
- for &xh in xs {
+ for &(xh, _) in xs {
if xh >= px0 - 1e-9 && xh <= px0 + h + 1e-9 {
let d = (xh - mid.x).abs();
if d < best_d {
diff --git a/crates/forma-core/src/scene.rs b/crates/forma-core/src/scene.rs
index 43da087..4b7912d 100644
--- a/crates/forma-core/src/scene.rs
+++ b/crates/forma-core/src/scene.rs
@@ -493,7 +493,7 @@ impl Scene {
.remove(name)
.map(|_| {
if self.last_modified.as_deref() == Some(name) {
- self.last_modified = None;
+ self.last_modified = self.parts.keys().next_back().cloned();
}
})
.ok_or_else(|| SceneError::UnknownPart(name.to_string(), self.part_list_str()))
diff --git a/crates/forma-lang/tests/audit_regressions.rs b/crates/forma-lang/tests/audit_regressions.rs
index 1c7da10..fb09c58 100644
--- a/crates/forma-lang/tests/audit_regressions.rs
+++ b/crates/forma-lang/tests/audit_regressions.rs
@@ -202,3 +202,96 @@ fn insert_asset_overwrite_at_capacity_does_not_evict() {
assert!(s.assets.contains_key("k00.obj"), "overwriting existing key must not evict k00");
assert_eq!(s.assets.get("k15.obj").unwrap(), &vec![99]);
}
+
+#[test]
+fn remesh_voxel_unions_overlapping_shells_without_xor_cavity() {
+ // Two overlapping 2x2x2 cubes shifted by 0.5 along X -> union volume is 2.5 * 2 * 2 = 10.0.
+ // Even-odd XOR would hollow out the 1.5x2x2 overlap (volume 6.0), leaving only ~4.0.
+ let mut combined = make_box(2.0, 2.0, 2.0, 1);
+ let mut b2 = make_box(2.0, 2.0, 2.0, 2);
+ b2.translate(Vec3::new(0.5, 0.0, 0.0));
+ combined.append_mesh(&b2);
+ let remeshed = remesh_voxel(&combined, 0.12, 3).expect("remesh_voxel overlapping shells");
+ let inv = MeshInvariants::compute(&remeshed);
+ assert!(inv.is_valid_solid(), "remeshed union must be watertight solid");
+ assert!(
+ inv.volume > 8.5,
+ "non-zero winding must union overlapping shells (~10.0), got vol={:.3}",
+ inv.volume
+ );
+}
+
+#[test]
+fn decimate_mesh_preserves_4_tri_tetrahedron_component() {
+ use forma_core::ops::decimate_mesh;
+ use forma_core::PolyMesh;
+
+ // Build a multi-component mesh: a box (12 tris) + a regular tetrahedron (4 tris).
+ let mut m = make_box(2.0, 2.0, 2.0, 1);
+ let mut tet = PolyMesh::new();
+ let v0 = tet.add_vert(Vec3::new(5.0, 0.0, 0.0));
+ let v1 = tet.add_vert(Vec3::new(6.0, 0.0, 0.0));
+ let v2 = tet.add_vert(Vec3::new(5.5, 0.866, 0.0));
+ let v3 = tet.add_vert(Vec3::new(5.5, 0.289, 0.816));
+ tet.add_face(vec![v0, v2, v1], 2, None);
+ tet.add_face(vec![v0, v1, v3], 2, None);
+ tet.add_face(vec![v1, v2, v3], 2, None);
+ tet.add_face(vec![v2, v0, v3], 2, None);
+ tet.ensure_outward_winding();
+ m.append_mesh(&tet);
+
+ let dec = decimate_mesh(&m, 0.25, Some(4), 3).expect("decimate must succeed");
+ let inv = MeshInvariants::compute(&dec);
+ assert!(inv.is_valid_solid(), "1-simplex link guard must prevent collapsed 2-tri tetrahedron");
+}
+
+#[test]
+fn inset_and_bevel_preserve_materials_and_weld_syncs_uvs() {
+ use forma_core::ops::{bevel_edges, inset_faces};
+ use forma_core::selector::EdgeSelector;
+
+ let mut b = make_box(2.0, 2.0, 2.0, 1);
+ b.assign_material(
+ Material {
+ name: "copper".into(),
+ color: [0.8, 0.45, 0.25, 1.0],
+ metallic: 0.9,
+ roughness: 0.3,
+ },
+ None,
+ );
+ let ins = inset_faces(&b, &FaceSelector::Top, 0.2, 0.1, 2).unwrap();
+ assert_eq!(ins.materials.len(), 1);
+ assert!(ins.faces.iter().all(|f| f.mat_id == 0));
+
+ let bev = bevel_edges(&b, &EdgeSelector::TopRim, 0.15, 1, 3).unwrap();
+ assert_eq!(bev.materials.len(), 1);
+ assert!(bev.faces.iter().all(|f| f.mat_id == 0));
+
+ // weld_and_clean must keep f.uvs.len() == f.verts.len() when collapsing coincident vertices
+ let mut m = make_box(1.0, 1.0, 1.0, 1);
+ let dup = m.add_vert(m.verts[m.faces[0].verts[0]]);
+ m.faces[0].verts.push(dup);
+ m.faces[0].uvs = [[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 0.0]]
+ .into_iter()
+ .collect();
+ m.weld_and_clean(1e-6);
+ assert_eq!(m.faces[0].uvs.len(), m.faces[0].verts.len());
+}
+
+#[test]
+fn remove_part_keeps_last_modified_on_remaining_part_and_step_triangulates_nonplanar_quads() {
+ use forma_core::export::write_step_bytes_with_unit;
+
+ let mut s = Scene::new();
+ s.strict_manifold = true;
+ eval_script(&mut s, Dialect::Pipe, "a = box(1,1,1)\nb = box(1,1,1) | move(3,0,0)\ndel(\"b\")").unwrap();
+ assert_eq!(s.last_part_name(), Some("a"));
+
+ // Non-planar quad on a distorted box must export valid STEP without zero-length directions
+ let mut b = make_box(2.0, 2.0, 2.0, 1);
+ b.verts[0].z += 0.4;
+ let step = String::from_utf8(write_step_bytes_with_unit(&b, Unit::Meter).unwrap()).unwrap();
+ assert!(!step.contains("DIRECTION('',(0.00000000,0.00000000,0.00000000))"));
+ assert!(step.contains("CLOSED_SHELL"));
+}